puppet directory structure (environments and profiles)
Hi, all. I'm newly managing a medium-sized (a couple dozen servers and a couple dozen Windows workstations) Puppet install, and I'm trying to come up with a directory structure that makes some sense. We're making a lot of changes right now (upgrading from 2.7 and 3.7, starting to use Forge rather than rolling our own for everything, and starting to use environments for the first time), making this a good time for a restructure. Unfortunately there are just so many things that need to be organized, and so many options that I've found online, that I'm really not sure what to go with. What would you do, and what are some best practices I could follow?
Here's what we've got now, for our company name xyz:
- puppet.conf in /etc/puppet
- nodes.pp and site.pp in /etc/puppet/manifests (the latter of which includes the former)
- All our modules in /usr/share/puppet/modules
- Our "roles" and "profiles", such as they are, in a module in /usr/share/puppet/modules/xyz
I want 3-5 environments (dev, testing, production, and maybe win7 and win7-testing).
So, a bunch of questions, then.
(1) Where do our custom and Forge modules live? Do we want our custom ones in /etc/puppet/env/$envname/modules and our Forge ones in /usr/share/puppet/modules? Or should the Forge ones go in /etc/puppet/modules, and if so, what is the /usr/share/puppet directory for? (And this might be a separate question, but what if we need different versions of a Forge module for different environments?)
(2) Where do our site.pp and nodes directories go? (Do we even need a site.pp if we use a nodes directory?) And roles and profiles (though I think we really only have profiles)? Do we want paths like these:
Or am I mixing up the hierarchy order that we should be using? Or are we supposed to have site.pp and the nodes directory inside the env directory? For that matter, is anything at all supposed to go outside the env directory? And does anything go inside the env/$envname/manifests directory other than profiles?
(3) How do we specify which environment we want for each node? Does the node definition in /etc/puppet/manifests/nodes/whatever.pp say "environment = dev", or does that not work? I tried to read the docs, but I got hung up when it started talking about a "node terminus".
Sorry this is so long. As you can see, I'm not even totally sure I'm asking all the right questions. I hope you can help me get on the right path! Thank you!