1

We are using a shared Puppet Server to manage both QA and DEV environments . The default configurations Puppet Server uses is Production environment

# puppet master --configprint all | grep production

environment = production
manifest = /data/puppetlabs/code/environments/production/manifests
modulepath = /data/puppetlabs/code/environments/production/modules:/data/puppetlabs/code/modules:/opt/puppetlabs/puppet/modules

I want to enable two more environments DEV and QA. For this I will copy the above directories and rename to qa and development environment respectively on Puppet Server. What configuration items to enable in puppet.conf to enable the new environments in Puppet Server. If I create multiple entries as in example above will it work . Please suggest .

Zama Ques
  • 523
  • 1
  • 9
  • 24
  • What version are you on? You should be using [Directory Environments](https://docs.puppet.com/puppet/3.8/reference/environments.html#about-directory-environments) by now – aairey Jun 22 '16 at 10:42

1 Answers1

2

The classical way to configure the environment is this:

#Environments
[development]
     modulepath =/etc/puppet/development/modules
     manifest = /etc/puppet/development/manifest/site.pp
     manifestdir = /etc/puppet/development/manifest

[testing]
     modulepath =/etc/puppet/testing/modules
     manifest = /etc/puppet/testing/manifest/site.pp
     manifestdir = /etc/puppet/testing/manifest

[production]
     modulepath =/etc/puppet/production/modules
     manifest = /etc/puppet/production/manifest/site.pp
     manifestdir = /etc/puppet/production/manifest

Then you can place modules and manifests for every enviroment into these folders.

But this method is considered depricated and people are using directory based environemnts. Set environmentpath to /etc/puppet/environments and create environment folders with modules and manifests there.

For example:

/etc/puppet/environments/production/modules/
/etc/puppet/environments/production/manifests/
/etc/puppet/environments/testing/modules/
/etc/puppet/environments/testing/manifests/

The, you can use r10k to automagickally download these environments fron Git branches.

Dmitry Ilyin
  • 573
  • 2
  • 5