Thanks Luke. 

I just found a bug report describing that this behaviour has changed in 3.x 
http://projects.puppetlabs.com/issues/17692

For me, being able to determine the agent environment is very useful.
We use git for the Puppet manifests and each branch is an environment.
So we'll create new branches to test and deploy new features.
Then when it's ready to go live to all nodes, we'll merge that branch back 
into master and remove the feature branch.
I rely on being able to query puppetdb or puppet-dashboard to find out 
which nodes are using environment X, so I can safely remove a branch once 
there are no nodes using it.

We also manage Puppet with Puppet and set the environment in puppet.conf 
based on the current environment.  This does still work as the environment 
is available in the manifests.

I also found the following code (at 
https://groups.google.com/forum/#!topic/puppet-users/AM1o4Khloto) for 
turning environment into a fact.
Including it here in case it's useful to others.

require 'puppet'

Facter.add('environment') do
  setcode do
    Puppet[:environment]
  end
end


J

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/c1146880-5afa-486b-bba0-6b45b9a91153%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to