This document describes how to modify the Puppet Master (Enterprise v3.7) server configuration so that it can use environments for the manifests. Using those environment files allows the puppet agents to configure themselves in a variety of environments. It allows you to create a separate set of manifests and modules for specific environments, thereby safeguarding that untested modifications to no promote to the production nodes.
$ cd /etc/puppetlabs
$ sudo mkdir environments
$ sudo clown -r puppet:root environments
Clone the github repos into separate environments. production
environment will always used a stable, tagged version. All other environments can be modified at will
$ cd /etc/puppetlabs/environments
$ git clone git@github.com:Chirpify/puppet.git development
$ git clone git@github.com:Chirpify/puppet.git production
Create or copy the manifests into the directories
$ mkdir -p /etc/puppetlabs/environments/production/manifests
$ mkdir -p /etc/puppetlabs/environments/development/manifests
Since we have 'staging_{color}' environments, we need to create directories for those. Thankfully puppet accepts symlinks
$ ln -s /etc/puppetlabs/environments/development /etc/puppetlabs/environments/staging_red
$ ln -s /etc/puppetlabs/environments/development /etc/puppetlabs/environments/staging_blue
$ ln -s /etc/puppetlabs/environments/development /etc/puppetlabs/environments/staging
$ ln -s /etc/puppetlabs/environments/development /etc/puppetlabs/environments/marriott_test
IN /etc/puppetlabs/puppet/puppet.conf
ensure in the [main]
section that you have set the following configuration values:
[main]
environmentpath = /etc/puppetlabs/environments