Puppet Config Print <attribute> Fails When Environment Directory 'Does Not Exist' on Agent Node
I have 2 environments on my puppetserver, production and test.
I have updated the puppet agent to use the environment named test, running puppet agent works, however I see an error when I try use puppet config print commands due to the fact there is no directory in the environment path on the agent node.
Please can you advise me what might be wrong?
Kind Regards, Nath
[sysadmin@centos ~]$ sudo puppet agent -t
Info: Using configured environment 'test' Info: Retrieving pluginfacts Info: Retrieving plugin Info: Caching catalog for centos.foxhound.com Info: Applying configuration version '8089cb3fe0610ba8f3e7d76129094548225b311f' Notice: Applied catalog in 0.17 seconds
[sysadmin@centos ~]$ cat /etc/puppetlabs/puppet/puppet.conf
server = puppetserver.dev.foxhound.com
environment = test
[sysadmin@centos ~]$ sudo puppet config print environment
get!': Could not find a directory environment named 'test' anywhere in the path: /etc/puppetlabs/code/environments. Does the directory exist? (Puppet::Environments::EnvironmentNotFound)
If I do:
sudo mkdir /etc/puppetlabs/code/environments/test
Then the error goes away
I'm not sure why
a) I need the directory to exist on the agent node
b) If I need the directory to exist, why it isn't there