Issue #19924 has been reported by Adam Lewenberg.

----------------------------------------
Bug #19924: Configuration parsing on puppetmasters confuse "master" environment 
with [master] section
https://projects.puppetlabs.com/issues/19924

* Author: Adam Lewenberg
* Status: Unreviewed
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* Affected Puppet version: 2.7.18
* Keywords: 
* Branch: 
----------------------------------------
We have a development Puppet master called "pmaster-dev". As is usual, it is 
also a puppet client, although in this case not a client of itself, but rather, 
a client of a different system. As a client, it is on the "master" environment.

When pmaster-dev's puppet agent starts one of the things it does is parse the 
configuration file (normally /etc/puppet/puppet.conf).

The configuration file is broken up into sections, e.g., "[main]", "[agent]", 
"[master]", etc. Each of these sections is stored separately in the hash 
generated from parsing the configuration file. In my case, pmaster-dev has 
these sections: "memory", "master", "cli", and "agent". There can also be 
per-environment sections. For example, if there is an environment called 
"stable201301" then there can be a section in the configuration file headed 
"[stable201301]" (Russ, I bet you can already sense the problem...)

For each of the above sections (called "sources" in the code) you examine all 
the settings that have associated "hooks". If in that section the setting with 
a hook is defined, you call that setting's hook. Some of the settings that have 
hooks include catalog_format, node_name_fact, and storeconfigs.

One of the more interesting settings is "async_storeconfigs" which has a hook 
that sets up a cache class.

Recall that the sections can also include ones for each environment. THE 
PROBLEM: The "master" section can refer either to the Puppetmaster 
configurations or to the puppet client environment section. 

The usual role for the "[master]" section is for settings for a Puppet master. 
But if the Puppetmaster itself is using the "master" environment we have a 
conflict. In particular, the "async_storeconfigs" setting from the "[master]" 
gets loaded from the configuration file. Since the Puppetmaster (as a Puppet 
client) is in the "master" environment this setting causes the cache class to 
be set and so when "puppet agent --test" is run the puppet client looks for 
cached facts (which it should not).

What is the solution? Well, we could have the Puppetmaster be a member of any 
environment not named "master". A better solution would be to have the client 
configuration parser not look at the "[master]" section (since that is only 
applicable to masters).



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to