Bug #11268
puppet master --compile ignores environments.
| Status: | Accepted | Start date: | 12/07/2011 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | compiler | |||
| Target version: | - | |||
| Affected Puppet version: | Branch: | |||
| Keywords: | environment, master, compile | |||
| Votes: | 0 |
Description
Related to #3910, after review this is filed as a separate bug.
Passing environment on master for compilation results in it being completely ignored:
puppet master --compile raiden.local --environment=test
notice: Scope(Node[default]): scope production
notice: Scope(Node[default]): production
This works from the client, but it’s ineffective to compile large number of catalogs by changing the puppet master configuration:
info: Expiring the node cache of raiden.local
info: Not using expired node for raiden.local from cache; expired at Fri Dec 02 10:58:06 -0500 2011
info: Caching node for raiden.local
notice: Scope(Node[default]): scope production
notice: Scope(Node[default]): production
notice: Compiled catalog for raiden.local in environment production in 0.03 seconds
info: Expiring the node cache of raiden.local
info: Not using expired node for raiden.local from cache; expired at Fri Dec 02 10:58:18 -0500 2011
info: Caching node for raiden.local
notice: Scope(Node[default]): scope test
notice: Scope(Node[default]): test
$vardir/facts contain client facts in yaml format, and the environment in the yaml file is authoritative even if —environment is specified.
Related issues
History
Updated by Josh Cooper 5 months ago
- Status changed from Unreviewed to Accepted
Here’s a site.pp that demonstrates:
node default {
notify { "environment":
message => $environment
}
}
On the agent:
$ puppet agent --test --server sirrus.puppetlabs.lan --certname foo2 --environment test notice: test notice: /Stage[main]//Node[default]/Notify[environment]/message: defined 'message' as 'test' $ puppet agent --test --server sirrus.puppetlabs.lan --certname foo2 --environment production notice: production notice: /Stage[main]//Node[default]/Notify[environment]/message: defined 'message' as 'production'
But the server still reports environment production:
$ tpm ticket11268 --compile foo2 --environment test --color false | grep message
"message": "production"