Multiple Environment setup

asked 2015-08-17 09:42:54 -0500

Aly gravatar image

Newbie here, so please excuse my ignorance. I have tried searching for an answer to this, but couldn't find a simple solution.

Question:
I am needing to manage two (maybe more in the future) environments: Dev and Prod. Right now, I have nodes.pp taking care of everything, listing each node, then using:

node development {
include dev_pw
include vmwaretools
include ntp
include cronjobs
}

node production {
include dev_pw
include vmwaretools
include ntp
include cronjobs
}

Then adding my node as follows:

node 'server1.local.localhost' inherits development {
}
node 'server2.local.localhost' inherits production {
}

My problem is that I have over 500 servers to manage. And I really don't want to have to list each one in my nodes.pp file. I also don't want to have to go back in and update the list when a server gets retired for instance.

So based on my setup, what would be the best solution in this scenario? I'm thinking multiple environments, but not sure how to start setting that up. I've heard Hiera could be a solution.. but would rather keep this as simple as possible while I get used to the Puppet concept.

Installed:
RHEL 6.6
Open Source Puppet 3.8.2
Puppet-Dashboard 1.2.23

edit retag flag offensive close merge delete

Comments

If your development and production environments have different domains or even IP subnets, you could use a case statement based on those values to set the modules.

johnnyb04 gravatar imagejohnnyb04 ( 2015-08-17 13:25:00 -0500 )edit

Are you using a Puppet Master or 'offline' puppet apply? Note, with Puppet Dashboard as ENC the environments should work out of the box when using puppet master / agent setup.

helge gravatar imagehelge ( 2015-08-18 05:39:05 -0500 )edit