|
If environmentpath does not exist when the Puppet Master is started, environment_timeout in puppet.conf has no effect. e.g. Running with environment_timeout = 1y in puppet.conf still exhibits the default behavior of not caching environments (environment_timeout = 0).
Here are steps to reproduce; I've used Puppet Server for this, but I'm reasonably certain the problem is in Puppet itself, not Puppet Server, and I'd expect the same behavior in any other type of Puppet master.
#1 - Delete environmentpath
rm -rf /etc/puppetlabs/code/environments
|
#1.5 Give the puppet user ownership of codedir. (side note - shouldn't packaging be doing this? All of these directories are owned by root post-install. Seems weird.)
chown -R puppet:puppet /etc/puppetlabs/code
|
#2 - Set environment_timeout in puppet.conf
echo "environment_timeout = 1y" >> /etc/puppetlabs/puppet/puppet.conf
|
#3 - Start Puppet Server
#4 - Run the agent. This should cache the environment, since we have the cache TTL set to 1 year in puppet.conf.
#5 - Re-create environmentpath and a manifests subdirectory for the production environment, and write a site.pp.
mkdir -p /etc/puppetlabs/code/environments/production/manifests
|
echo "node default { notify {'hello world': } }" >> /etc/puppetlabs/code/environments/production/manifests/site.pp
|
#6 - Run the agent again. Observe that the "hello world" resource shows-up - this is incorrect, since the environment should not have been refreshed.
Notice: hello world
|