The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:

Feature #17783

No public interface to reinitialize all settings to find new environments

Added by Dominic Cleal over 3 years ago. Updated about 3 years ago.

Status:AcceptedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:settings
Target version:3.x
Affected Puppet version:3.0.0 Branch:
Keywords:settings interfaces backlog

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com


Description

Foreman’s proxy calls the Puppet::Settings class to learn of all environments and their settings (modulepaths) that a puppet master is configured to serve. Since the proxy is a daemon, it needs to be able to pick up changes made to puppet.conf without restarting.

With Puppet 2.x, this would look like:

Puppet.clear
Puppet.parse_config

With Puppet 3.0, we call this method indicating the run_mode we’re interested in (Foreman isn’t a face, it’s just enquiring about the behaviour of the puppetmaster):

Puppet.settings.initialize_global_settings(["--config=/path", '--run_mode' 'master'])

This can only be called once, since @global_defaults_initialized is set in Puppet::Settings and it throws an error if called twice. The clear method doesn’t reset global or app defaults (by er, default) and the only method that does is the private clear_everything_for_tests method. Calling this private method instead of clear, then calling initialize_global_settings again allows us to pick up on environment changes in puppet.conf successfully.


Related issues

Related to Puppet - Bug #7316: puppet face applications (subcommands) delivered via modu... Closed 05/02/2011

History

#1 Updated by Anonymous over 3 years ago

  • Tracker changed from Bug to Feature
  • Status changed from Unreviewed to Accepted

Are you looking for a way to read the files on disk, or do you need to include command line parameter parsing in this as well? From the description that is given, it sounds like you are just looking for something that can read the puppet configuration files on demand.

Maybe something like:


config = Puppet::Configuration.new('/etc/puppet/puppet.conf', Puppet.setting_definitions)
paths = config.collect(&:modulepath)

That could then be re-run periodically and without problem if it was self contained and didn’t rely on any global state, which is the big problem with the current settings system (it is essentially one big global hash).

#2 Updated by Dominic Cleal over 3 years ago

Andrew Parker wrote:

Are you looking for a way to read the files on disk, or do you need to include command line parameter parsing in this as well? From the description that is given, it sounds like you are just looking for something that can read the puppet configuration files on demand.

Maybe something like:

Just looking for the disk reading part as you say. We do pass in two command line parameters today for Puppet 3.0, but only to initialise the disk reading – the Puppet config file if the user specified it (else we want to use Puppet’s default) and the run_mode set to master.

The latter is important today, because we’re trying to read settings in the context of the puppetmaster.

That could then be re-run periodically and without problem if it was self contained and didn’t rely on any global state, which is the big problem with the current settings system (it is essentially one big global hash).

It’s that big hash we’re currently jumping in and reading privately I think to extract the environments information, while just querying Puppet[:foo] for other settings we’re interested in. So yes, this sounds spot on.

#3 Updated by eric sorenson over 3 years ago

  • Priority changed from Normal to High
  • Target version set to 3.x
  • Keywords changed from settings interfaces to settings interfaces backlog

Bumping to backlog for Q1'13 consideration.

#4 Updated by eric sorenson about 3 years ago

  • Priority changed from High to Normal

Also available in: Atom PDF