The recommended puppet server directory layout

puppetpuppetmaster

I am just setting up a new puppet server and wanted to find out what the best practise directory structure is? Ive had a look around on different forums and on the puppet site and what strikes me is that everyone seems to lay it out in a different way. Isnt there a recommended way and directory structure?

So far I have:

puppet/
   + manifests/
      + site.pp  
      + nodes/
          + production/
              + nodes.pp
          + dev/
              + nodes.pp
   + modules/

Im just a little stuck after this 🙂

So I think I want to separate this down to server roles such as "webserver", which has a service such as "httpd" or "nginx"

Whats the best method to lay all of this out as its driving me nuts that there doesnt seem to be a preferred method to do this, or maybe I have just missed it in all of the other information 🙁

Is is this how you would structure the directories?

puppet/
   + manifests/
      + site.pp  
      + nodes/
          + production/
              + nodes.pp (Nodes have roles)
          + dev/
              + nodes.pp
       + roles/
           + web-server-apache.pp (Roles have modules)
   + modules/
       + web-server-apache/
           + manifests/
               + init.pp (This is where "httpd" gets defined and installs latest httpd)
           + templates/
           + files/

Best Answer

Yes, the standard directory layout looks like that - what kind of variations to this structure are you seeing?

Your different services (httpd, nginx) should each be handled by modules within the modules directory, while attaching these modules to nodes for inclusion in their configuration catalog will happen within manifests.

How are you looking to define your roles? Generally that should be done in your node definitions, whether that's a nodes.pp file in your manifests directory that gets loaded by site.pp, or instead using Hiera for your node definitions (which I'd definitely recommend if you're up for it).