octocatalog-diff icon indicating copy to clipboard operation
octocatalog-diff copied to clipboard

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

Open mookie- opened this issue 7 years ago • 4 comments

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?

mookie- avatar Nov 08 '17 16:11 mookie-

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.

kpaulisse avatar Nov 10 '17 04:11 kpaulisse

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

mookie- avatar Nov 13 '17 18:11 mookie-

😿 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!

kpaulisse avatar Nov 13 '17 18:11 kpaulisse

@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

vinzent avatar May 31 '18 11:05 vinzent