Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

Allow specifying of facter variables during puppet apply. #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oc243
Copy link

@oc243 oc243 commented Apr 6, 2017

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.

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
Copy link
Author

oc243 commented Apr 10, 2017

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

@oc243
Copy link
Author

oc243 commented Apr 25, 2017

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

@garethr
Copy link
Contributor

garethr commented Apr 30, 2017

@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.

@oc243
Copy link
Author

oc243 commented May 2, 2017

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…

@garethr garethr force-pushed the master branch 2 times, most recently from b14f9a7 to 9e25ed0 Compare September 15, 2017 07:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants