Foreman environment keeps resetting to 'default_puppet_environment'

Hi,

I've got 3 environments:

  • development
  • management
  • production

My foreman host is set to "management", but after 1 or 2 puppet runs it is
set to production (default_puppet_environment).
When I set "enc_environment" to true, I'll keep getting the following
message:
Warning: Local environment: "management" doesn't match server specified
node environment "production", switching agent to "production".

I even got an hostgroup "management" which has the environment set to
"management", but won't help either.

I'm running:
CentOS 6.4 (last yum update since 2013-11-25)
Foreman 1.3.1
Puppet 3.3.2

Kind regards,
Werner

Have you set the environment variable in the puppet.conf file?

··· On Monday, November 25, 2013 2:06:32 PM UTC-5, Werner Dijkerman wrote:

Hi,

I’ve got 3 environments:

  • development
  • management
  • production

My foreman host is set to “management”, but after 1 or 2 puppet runs it is
set to production (default_puppet_environment).
When I set “enc_environment” to true, I’ll keep getting the following
message:
Warning: Local environment: “management” doesn’t match server specified
node environment “production”, switching agent to “production”.

I even got an hostgroup “management” which has the environment set to
"management", but won’t help either.

I’m running:
CentOS 6.4 (last yum update since 2013-11-25)
Foreman 1.3.1
Puppet 3.3.2

Kind regards,
Werner

Hi,

The environment in puppet.conf was correct. (environment = management)
update_environment_from_facts was set at true. I've set it to false and
everything keeps working correctly.

Thanks!

1 Like

What's your update_environment_from_facts setting set to? It may need
to be disabled on Puppet 3, as due to the order of how Puppet check-ins
work, the environment isn't determined by the point it updates from facts.

··· On 25/11/13 19:06, Werner Dijkerman wrote: > Hi, > > I've got 3 environments: > > * development > * management > * production > > My foreman host is set to "management", but after 1 or 2 puppet runs it > is set to production (default_puppet_environment). > When I set "enc_environment" to true, I'll keep getting the following > message: > Warning: Local environment: "management" doesn't match server specified > node environment "production", switching agent to "production". > > I even got an hostgroup "management" which has the environment set to > "management", but won't help either.

–
Dominic Cleal
Red Hat Engineering