Ask Your Question

how to set environment?

asked 2016-04-03 12:14:53 -0600

Gajendra gravatar image

updated 2016-04-05 00:31:49 -0600

Hi All,

How do set the environment in puppet server like if i a m having below scenario. Production

Linux Windows AIX


Windows Linux AIX


Windows Linux

also can i set site.pp for each environment

Regards, Gajendra G

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-04-13 19:15:14 -0600

Gary Steven gravatar image

You will need to make an adjustment to puppet.conf on the Puppet Masters

      environmentpath  = $confdir/environments

Your Puppet Master should then be searching for modules in /etc/puppet/environments/<env>/modules

In your puppet.conf on each agent machine you can specify the environment in the agent block, this will pass the environment to the master when you fetch your catalog. You can then use the built in fact ::environment to make choices based on values.

  environment = dev

Running the agent should pull data from the master using modules found at /etc/puppet/environments/dev/modules

You can use any arbitrary string really and call your environments what you like and what makes most sense for your needs.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-04-03 12:14:53 -0600

Seen: 550 times

Last updated: Apr 13 '16