Ask Your Question
2

Which directory Architecture is recommended for puppet ?

asked 2012-12-18 09:18:54 -0500

updated 2013-01-07 04:22:04 -0500

Hi,

I'm deploying a puppet master to manage our 3-tiers environment (production, qualif, test) with PE 2.6. I added a "dev" environment to be able to create our local modules

So far I've implemented the following directory structure :

/etc/puppetlabs/puppet
├── environments
│   ├── dev
│   │   └── modules
│   │       └── site-specific
│   │           ├── manifests
│   │           │   ├── apache_custom
│   │           │   └── yum_custom
│   │           ├── spec
│   │           ├── templates
│   │           │   └── apache
│   │           └── tests
│   ├── production
│   │   └── modules
│   │       └── site-specific
│   │           └── manifests
│   │               └── yum_custom
│   ├── qualif
│   │   └── modules
│   └── test
├── files
├── hieradata
│   ├── dev
│   ├── production
│   ├── qualif
│   └── test
├── manifests
├── modules
│   └── <Forge modules>
└── ssl
    ├── ca
    │   ├── private
    │   ├── requests
    │   └── signed
    ├── certificate_requests
    ├── certs
    ├── private
    ├── private_keys
    └── public_keys

With the following puppet.conf :

[main]
    vardir = /var/opt/lib/pe-puppet
    logdir = /var/log/pe-puppet
    rundir = /var ...
(more)
edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
2

answered 2012-12-21 16:57:51 -0500

arusso gravatar image

IMO, you're doing too much work by defining static environments. I currently run something very similar to this: link

My manifest/modulepath and fileserver.conf then look like

# from puppet.conf
    manifest = /var/lib/puppet/env/manifests/$environment/site.pp
    # from lhs-to-rhs, environment modules -> prod modules -> built-in modules -> 3rd party modules
    # built-in modules should be rolled into 3rd party or production modules
    # note: I'm not crazy, the static prod reference is a fallback in case we try to run puppet
    #       against a  non-existant environment.
    modulepath = /var/lib/puppet/env/modules/$environment:\
                 /var/lib/puppet/env/modules/production:\
                 /etc ...
(more)
edit flag offensive delete link more

Comments

Intresting approach, it would clearly simplify my approach but leveraging modulpath customization and creating a common custom modules location on the "production" repository. My concern is about the fileserver.conf ...(more)

ThinkBriK gravatar imageThinkBriK ( 2013-01-04 03:00:16 -0500 )edit

Indeed, I was never able to find any docs that actually mentioned the availability of the %environment variable, I just tried it and it works. I'm running 2 sets ...(more)

arusso gravatar imagearusso ( 2013-01-04 12:55:00 -0500 )edit

I was thinking of "File serving only works well with environments if you’re only serving files from modules; if you’ve set up custom mount points in fileserver.conf ...(more)

ThinkBriK gravatar imageThinkBriK ( 2013-01-07 01:00:02 -0500 )edit

Another question : what is the point of using the production environment by default when you only get two site modules ? Any change to a class in a site module for ...(more)

ThinkBriK gravatar imageThinkBriK ( 2013-01-07 04:32:42 -0500 )edit
0

answered 2012-12-18 10:28:24 -0500

ashp gravatar image

I don't see anything wrong with the above structure but I'm not sure what you're trying to achieve with the sitespecific stuff and yumcustom/ etc. You'd be better off having a single yum module that you simply pass in parameters to with hiera or your ENC. That way you reduce duplication.

I get a feeling that you'll end up with multiple copies of your yum module and have a nightmare managing this in the future. Our entire structure is just /etc/puppet/environments/$environment/ and we rely on Hiera to set params so ... (more)

edit flag offensive delete link more

Comments

Actually the site-specific modules call the forge modules and implements hiera based parameters via a parameterized class. This way I can implement base configuration via the hiera defaults and use ...(more)

ThinkBriK gravatar imageThinkBriK ( 2013-01-04 06:11:49 -0500 )edit

Your Answer

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

Add Answer

Question Tools

2 followers

Stats

Asked: 2012-12-18 09:18:54 -0500

Seen: 2,766 times

Last updated: Dec 21 '12