Warning: Local environment: "production" doesn't match server specified node environment

2,287 views
Skip to first unread message

Matt Zagrabelny

unread,
Jan 27, 2016, 11:49:36 AM1/27/16
to puppet...@googlegroups.com
Greetings,

I've searched a bit and found some hits for the subject, but nothing that helps.

I'm using an ENC to drive the environment of my nodes.

I don't have "production" defined anywhere in my puppet.conf:

# grep production /etc/puppet/puppet.conf || echo "not there"
not there

and it is not defined on my command-line run:

puppet agent -t --server puppet-3-7 --debug

but I still get a warning about the local environment:

Warning: Local environment: "production" doesn't match server
specified node environment "apt", switching agent to "apt".

Where else (besides the /etc/puppet/puppet.conf and the command-line
option --environment) do I look for the local environment being set?

Thanks!

-m

Alfredo De Luca

unread,
Jan 27, 2016, 5:47:44 PM1/27/16
to puppet...@googlegroups.com
Hi Matt.
AFAIK production is the default environment assigned to all the nodes.

try
puppet config print environment
> --
> 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 puppet-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAOLfK3U3AFz%2BZzTvHXzLmodL8Tcw6QX1PwPvCDRtAN5fw-3SVw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



--
Alfredo

Matt Zagrabelny

unread,
Jan 28, 2016, 12:13:25 PM1/28/16
to puppet...@googlegroups.com
Hi Alfredo,

Thanks for the reply.

On Wed, Jan 27, 2016 at 4:47 PM, Alfredo De Luca
<alfredo...@gmail.com> wrote:
> Hi Matt.
> AFAIK production is the default environment assigned to all the nodes.

Sure.

> try
> puppet config print environment

Yep, production:

# puppet config print environment
production

So how do I get the warning to go away?

Warning: Local environment: "production" doesn't match server
specified node environment "apt", switching agent to "apt".

Any ideas?

-m

Martin Alfke

unread,
Jan 30, 2016, 6:03:13 AM1/30/16
to puppet...@googlegroups.com
Hi Matt,

an ENC can set an environment for a node.
In case that a node does not specify an environment it will make use of environment production.
You can specify node environment on the node in puppet.conf in agent section:

[agent]
environment = apt

Best,
Martin
> --
> 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 puppet-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAOLfK3UAMWc4dEWsspDnkGNkbiEYKSR5vN-CmxTFbP0RhfLAtQ%40mail.gmail.com.

Matt Zagrabelny

unread,
Jan 30, 2016, 11:38:10 AM1/30/16
to puppet...@googlegroups.com
Hi Martin,

On Sat, Jan 30, 2016 at 5:03 AM, Martin Alfke <tux...@gmail.com> wrote:
> Hi Matt,
>
> an ENC can set an environment for a node.

Yep. I'm using an ENC to set the environment to 'apt'.

> In case that a node does not specify an environment it will make use of environment production.
> You can specify node environment on the node in puppet.conf in agent section:
>
> [agent]
> environment = apt

Sure. I'd like to avoid setting any environment in the puppet.conf and
only use the ENC *and* not get the warning.

Any ideas?

Thanks for the help!

-m

Jason Harlow

unread,
Jan 31, 2016, 11:32:54 AM1/31/16
to Puppet Users
If you want the warning to go away, you could set the value in puppet.conf to match the ENC setting via something like the below (using puppetlabs/inifile module).

You'll still get the warning on the first run, but it should go away on subsequent ones (unless the ENC-set environment changes)

ini_setting { "puppet_environment":
  ensure  => present,
  path    => '/etc/puppet/puppet.conf',
  section => 'agent',
  setting => 'environment',
  value   => $::environment,
}
Reply all
Reply to author
Forward
0 new messages