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

fixes #5856 - use public initializer for Puppet settings #161

Closed

Conversation

domcleal
Copy link
Contributor

This PR swaps calling fairly private methods with calling the public API for initialising settings.

The reason we used to do this when adding support for Puppet 3 was that we relied on Puppet itself to parse its config file, and then pulled the parsed data structure out of its settings object. Since Puppet reads a different config file depending on which "run mode" it's in (master, agent, user (misc)), we had to force it into master so it read the same puppet.conf that the puppet master itself would be using.

Recently I replaced the code that pulled the parsed config out of Puppet with an Augeas-based implementation in dd37400, so we no longer have a requirement to load Puppet in master mode. Now the default "user" mode (used for programs 'requiring' Puppet and non-agent/master Puppet apps) will suffice, because we generally don't care about where it loads settings from.

Puppet 3.6 now broke this initialisation code because it added a new step internally ("context") that we weren't initialising. You can see this here: https://github.com/puppetlabs/puppet/blob/3.6.0/lib/puppet.rb#L150-L153

So the upshot of this is that we might as well KISS and go back to the public API for initialising settings, forgetting all about run modes: https://github.com/puppetlabs/puppet/blob/3.6.0/lib/puppet.rb#L127-L132

I've tested this on Puppet 3.6.0 and 3.0.0 and with the following puppet.conf files:

Jenkins will also test a large number of Puppet versions.

@GregSutcliffe
Copy link
Member

👍 - This makes a ton of sense now that Puppet have got sensible loading mechanisms :)

@pmoust
Copy link

pmoust commented Jun 4, 2014

@domcleal thanks for the patch. We already use this in our staging environment with Puppet 3.6.1

Personally, I would like to see this in 1.5.1

@domcleal
Copy link
Contributor Author

domcleal commented Jun 9, 2014

@ares or @ohadlevy perhaps you could review/merge? Thanks.

@ohadlevy
Copy link
Member

ohadlevy commented Jun 9, 2014

merged as 1dc369d thanks @domcleal !

@ohadlevy ohadlevy closed this Jun 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants