The Problem
[root@agent201621-centos ~]# puppet agent -t
|
Info: Using configured environment 'production'
|
Info: Retrieving pluginfacts
|
Info: Retrieving plugin
|
Info: Loading facts
|
Info: Caching catalog for agent201621-centos
|
Info: Applying configuration version '1475855527'
|
Notice: Applied catalog in 0.40 seconds
|
|
[root@agent201621-centos ~]# puppet config set environment fake --section agent
|
|
[root@agent201621-centos ~]# puppet agent -t
|
Warning: Unable to fetch my node definition, but the agent run will continue:
|
Warning: Error 400 on SERVER: Could not find environment 'fake'
|
Info: Retrieving pluginfacts
|
Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Failed to generate additional resources using 'eval_generate': Error 400 on SERVER: Could not find environment 'fake'
|
Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Could not evaluate: Could not retrieve file metadata for puppet:///pluginfacts: Error 400 on SERVER: Could not find environment 'fake'
|
Info: Retrieving plugin
|
Error: /File[/opt/puppetlabs/puppet/cache/lib]: Failed to generate additional resources using 'eval_generate': Error 400 on SERVER: Could not find environment 'fake'
|
Error: /File[/opt/puppetlabs/puppet/cache/lib]: Could not evaluate: Could not retrieve file metadata for puppet:///plugins: Error 400 on SERVER: Could not find environment 'fake'
|
Info: Loading facts
|
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find environment 'fake'
|
Warning: Not using cache on failed catalog
|
Error: Could not retrieve catalog; skipping run
|
Error: Could not send report: Error 400 on SERVER: Could not find environment 'fake'
|
Now if I go ahead and make the environment on the master, it'll compile the catalog against the production environment as expected.
On the master:
[root@master201621-centos ~]# cp -r /etc/puppetlabs/code/environments/production/ /etc/puppetlabs/code/environments/fake
|
Now on the agent:
[root@agent201621-centos ~]# puppet agent -t
|
Notice: Local environment: 'fake' doesn't match server specified node environment 'production', switching agent to 'production'.
|
Info: Retrieving pluginfacts
|
Info: Retrieving plugin
|
Info: Loading facts
|
Info: Caching catalog for agent201621-centos
|
Info: Applying configuration version '1475855805'
|
Notice: Applied catalog in 0.36 seconds
|
Expected Behavior
The existence of the environment that the agent sets in puppet.conf should not matter if the ENC is controlling the environment. I expect this message in both cases.
Notice: Local environment: 'fake' doesn't match server specified node environment 'production', switching agent to 'production'.
|
|