Ask Your Question
0

how to set environment?

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

Gajendra gravatar image

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

Hi All,

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

Linux Windows AIX

Dev

Windows Linux AIX

UAT

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
0

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

Gary Steven gravatar image

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

[main]
      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.

[agent]
  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

Stats

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

Seen: 446 times

Last updated: Apr 13 '16