-
Notifications
You must be signed in to change notification settings - Fork 303
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
fragment can be local file that might not always exist #112
Comments
This was an accidental regression caused by introducing parameter validation. #111 fixed the README but there's some blog posts that refer to ensure => path syntax. I searched github a few weeks ago and couldn't find examples of that syntax so I've been trying to decide if we should revert that validation and add a warning or leave it as is (so as not to thrash on the semantics since it's been like this for a month). @apenney Any thoughts on that? I will add some tests for for the failure that's being described here. |
fwiw this is a deliberate feature, not documented but def something thats wanted. |
@wbean1 Could you post the exact snippet that's failing for you with the @ripienaar what's the history on how |
perhaps by accident? this module comes from 0.24.x days, lots of behaviour was left up to discovery rather than specification. What I mean with the feature being needed though is that its highly desirable to be able to pull in fragments on the local file system that are not managed by puppet which this enables. |
@wbean1 Any information you could provide on reproducing the failure you saw with the |
I was working on a PR to change the validation into a warning and while writing system tests for the warning I uncovered a nasty behaviour. It appears that there is an issue with using the ensure/symlink syntax and then trying to change the fragment back to a plain file. What happens is a symlink is left behind in the fragment dir that's not over written when the file resource for the fragment has ensure => present set.
|
This is exactly the need. I understand why local changes are not in the 'spirit' of puppet, but this was example usage...
generates the validate_re() exception previously posted
generates (when "/etc/motd.local" does not exist on the local system) Error: /Stage[main]/Motd/Concat::Fragment[motd_local]/File[/var/lib/puppet/concat/motd/fragments/90_motd_local]: Could not evaluate: Could not retrieve information from environment lab source(s) file:/etc/motd.local |
The intent is to allow the ensure => /target syntax again but with a deprecation warning. I'm still playing with fixes for the symlink replacement bug but my preferred solution would be not to allow non-existent files. I will note that the behaviour your asking for is very un-puppet like. Generally, the way to do something like that would be to create a fact for the existence of /etc/motd.local and branching on it. |
In the 1.0 release, I could have a fragment (similar to the example in README)
and if that file didn't exist locally, it didn't matter.
Keeping that syntax, I now get:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: validate_re(): "/etc/motd.local" does not match "^$|^present$|^absent$|^file$|^directory$" at /etc/puppet/modules/concat/manifests/fragment.pp:39 on node ____
If I try to use source, I get:
Error: /File[/var/lib/puppet/concat/motd/fragments/90_motd_local]: Could not evaluate: Could not retrieve information from environment devl source(s) file:/etc/motd.local
The text was updated successfully, but these errors were encountered: