Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't allow ensure=file anymore for systemd::unit_file #434

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

baurmatt
Copy link
Contributor

Pull Request (PR) description

@cocker-cc correctly mentioned in
7f63dfa#commitcomment-139614892 that after #405 ensure=file breaks due to stdlib::ensure not being able to handle that. As file is any way only a synonym for present, let's just remove it from the possible values.

This Pull Request (PR) fixes the following issues

7f63dfa#commitcomment-139614892

@baurmatt baurmatt changed the title Don't allow ensure=file anymore Don't allow ensure=file anymore for systemd::unit_file Mar 11, 2024
Copy link
Member

@kenyon kenyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REFERENCE.md is outdated, but otherwise LGTM. Sad that we missed this in #405, I guess there isn't test coverage.

@kenyon
Copy link
Member

kenyon commented Mar 11, 2024

Might also be better to preserve backwards compatibility by just treating $ensure=file the same as $ensure=present.

@kenyon kenyon added the bug Something isn't working label Mar 11, 2024
@cocker-cc correctly mentioned in
7f63dfa#commitcomment-139614892
that after #405 `ensure=file` breaks due to `stdlib::ensure` not being
able to handle that. As `file` is any way only a synonym for `present`,
let's just remove it from the possible values.
@baurmatt
Copy link
Contributor Author

@kenyon Thanks for the review! I've update REFERENCE.md.

Regarding the backwards compatibility: I thought a lot about it. But i feels like a bad UX to have ensure allow file, but not link - which is automatically set if target is defined. Thus I prefer to remove the file option.

I've also git blamed it back to the source -> https://github.com/voxpupuli/puppet-systemd/blame/b80984882b79c4edb48486513be1436dfa6736f2/manifests/unit_file.pp
It seems it was file back than because systemd::unit_file was only a simple wrapper around a file resource but as of now, it's way more.

@kenyon
Copy link
Member

kenyon commented Mar 12, 2024

@baurmatt I agree with your analysis, this is a good change.

@baurmatt baurmatt merged commit 89edd13 into master Mar 13, 2024
35 checks passed
@baurmatt baurmatt deleted the unit_file_ensure branch March 13, 2024 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backwards-incompatible bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants