Issue #11268 has been updated by Josh Cooper.

Status changed from Unreviewed to Accepted

Here's a site.pp that demonstrates:

<pre>
node default {
  notify { "environment":
    message => $environment
  }
}
</pre>

On the agent:

<pre>
$ 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'
</pre>

But the server still reports environment `production`:

<pre>
$ tpm ticket11268 --compile foo2 --environment test --color false | grep message
          "message": "production"
</pre>
----------------------------------------
Bug #11268: puppet master --compile ignores environments.
https://projects.puppetlabs.com/issues/11268

Author: Nan Liu
Status: Accepted
Priority: Normal
Assignee: 
Category: compiler
Target version: 
Affected Puppet version: 
Keywords: environment, master, compile
Branch: 


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.


-- 
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to