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

How to use a different puppet configuration (e.g. strict_variables) #158

Open
mookie- opened this issue Nov 8, 2017 · 4 comments
Open

Comments

@mookie-
Copy link

mookie- commented Nov 8, 2017

Hey, I have set strict_variables (https://puppet.com/docs/puppet/4.10/configuration.html#strictvariables) to true on the puppetmaster. Now I also want this setting to be there for the octocatalog-diff run. Unfortunately I couldn't figure out how I could do that. The only think I could think of would be to add a bootstrapping script which creates a puppet.conf with that setting. But this doesn't feel right :)

Does someone has an idea how I could do that?

@kpaulisse
Copy link
Contributor

Most (all) puppet config settings can also be set on the command line, so I think --command-line (or --from-command-line, --to-command-line) will probably do what you need.

See options reference for more info.

@mookie-
Copy link
Author

mookie- commented Nov 13, 2017

@kpaulisse thank you for your answer. But you can't set strict_variables on the command line (and also not for octocatalog-diff).

@kpaulisse
Copy link
Contributor

😿 OK, didn't realize it wasn't a command line option.

The need would then seem to be creating a custom puppet.conf file to be used when Puppet is run by octocatalog-diff that contains the unsettable variables. I'll re-tag this as an enhancement request. Thanks for the clarification!

@vinzent
Copy link
Contributor

vinzent commented May 31, 2018

@mookie- for me

puppet apply --strict_variables -e 'notify { "bla $doesnotexist": }'
puppet apply  -e 'notify { "bla $doesnotexist": }'

works as expected:

$ puppet apply --strict_variables -e 'notify { "bla $doesnotexist": }'
Error: Evaluation Error: Unknown variable: 'doesnotexist'. (line: 1, column: 15) on node 79a996617dea

$ puppet apply  -e 'notify { "bla $doesnotexist": }'
Warning: Unknown variable: 'doesnotexist'. (line: 1, column: 15)
Notice: Compiled catalog for 79a996617dea in environment production in 0.05 seconds
Notice: bla 
Notice: /Stage[main]/Main/Notify[bla ]/message: defined 'message' as 'bla '
Notice: Applied catalog in 0.01 seconds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants