puppetlabs-image_build icon indicating copy to clipboard operation
puppetlabs-image_build copied to clipboard

Allow specifying of facter variables during puppet apply.

Open oc243 opened this issue 8 years ago • 4 comments

Sometimes you want to push additional variables to facter during puppet apply. For instance, secrets should not be stored under version control but are needed when the configuration is applied. In this instance using passing the secret as a facter variable to puppet is a nice way of having the configured machine have the secret but not include the secret in your source code.

This patch lets you specify facter variables at parameters to puppet docker build that are in turn sent to the puppet apply call.

oc243 avatar Apr 06 '17 10:04 oc243

Hey @garethr , do you mind taking a look at this PR when you get time? TY!

oc243 avatar Apr 10 '17 18:04 oc243

Hi @garethr. Sorry to nag, but I don't suppose you could take a look at this if you get some time? TY!

oc243 avatar Apr 25 '17 09:04 oc243

@oc243 thanks for the suggestion, and sorry for the delay.

Is there a reason for having this separate to just passing environment variables?

https://github.com/puppetlabs/puppetlabs-image_build/blob/master/lib/puppet_x/puppetlabs/imagebuilder_face.rb#L61

The extra flag isn't something that's standard to other puppet tools, and their is also the case of passing env and passing the new variable and one winning. Would be interested in your thoughts.

garethr avatar Apr 30 '17 10:04 garethr

Is there a reason for having this separate to just passing environment variables?

D'oh! Yes, that's much easier.

There might be some advantage of limiting the scope of the environment variables to only exist in the puppet apply command. That said, one is not sure if that is worth the additional complexity given that it's possible no-one would use this…

oc243 avatar May 02 '17 12:05 oc243