Local environment does not match server environment, restarting agent run
Puppet agent for one of my nodes logs the following error in the puppet console:
Local environment: "dev" doesn't match server specified environment "production", restarting agent run with environment "production"
Other nodes connected to the same master seem to be fine. After that, I get some errors that show that my agent is executing against modules that are in the production environment but not on the dev environment. My understanding was that the
environment = dev line in the config file of the agent was the source of truth for which environment to use, but it seems that I am wrong. Where is that configured ? Is there an association between node and environment done on the master ? How can I access it ?
I'm using PE 3.2.0 (yes I know, we should upgrade).
Thanks for your help !
Some config files (might help diagnose the problem, or not ...)
[main] certname = puppet.mycompany.com dns_alt_names = puppet,puppet.mycompany.com vardir = /var/opt/lib/pe-puppet logdir = /var/log/pe-puppet rundir = /var/run/pe-puppet modulepath = /etc/puppetlabs/puppet/environments/$environment/modules:/opt/puppet/share/puppet/modules manifest = /etc/puppetlabs/puppet/manifests/site.pp server = puppet.mycompany.com user = pe-puppet group = pe-puppet archive_files = true archive_file_server = puppet.mycompany.com [master] certname = puppet.mycompany.com ca_name = 'Puppet CA generated on hqchpuppet1.mycompany.com at 2014-03-12 16:01:11 +0100' reports = console,puppetdb node_terminus = console ssl_client_header = SSL_CLIENT_S_DN ssl_client_verify_header = SSL_CLIENT_VERIFY storeconfigs_backend = puppetdb storeconfigs = true [agent] report = true classfile = $vardir/classes.txt localconfig = $vardir/localconfig graph = true pluginsync = true environment = production
[main] vardir = /var/opt/lib/pe-puppet logdir = /var/log/pe-puppet rundir = /var/run/pe-puppet modulepath = /etc/puppetlabs/puppet/modules:/opt/puppet/share/puppet/modules user = pe-puppet group = pe-puppet archive_files = true archive_file_server = puppet.mycompany.com [agent] certname = hqchjenkins01.mycompany.com environment = dev server = puppet.mycompany.com runinterval = 43200 report = true classfile = $vardir/classes.txt localconfig = $vardir/localconfig graph = true pluginsync = true configtimeout = 300