Setting up the environment
Environments in Puppet are directories holding different versions of your Puppet manifests. Whenever a node connects to a Puppet master, it informs the Puppet master of its environment. By default, all nodes report to the production environment. This causes the Puppet master to look in the production environment for manifests. You may specify an alternate environment with the--environment
setting when running puppet agent
or by settingenvironment = newenvironment
in/etc/puppet/puppet.conf
 in the agent
section.
Getting ready
Verify environmentpath
in your installation with the following puppet config
command:
[vagrant@puppet ~]$ sudo /opt/puppetlabs/bin/puppet config print environmentpath /etc/puppetlabs/code/environments
How to do it...
The steps are as follows:
- Create a production directory at
/etc/puppetlabs/code/environments
that contains both a modules and manifests directory. Then, create aÂsite.pp
that creates a file in/tmp
, as follows:
[vagrant@puppet ~]$ sudo mkdir...