I just want to sanity check this before reinventing the wheel or more
importantly doing something outside the "norm" which may come back to
bite me on another puppet version release.

Current versions - master 2.7.12, client 2.7.13.

It appears that although puppet environments allows for environment
specific modules, however does not allow for environment specific
configurations (files) and templates only.

The environment modules implementation does not lend itself to the DRY
principle, as the modules have to be duplicated per environment so
there is no scope for "common class, different environment
configurations and templates".

I do realise that erb templating facilitates this, however I want to
isolate environment configurations and not have templates that are
common for all environments.

Use case which does NOT work:

Common mysql-server class for all environments:
modules/mysql-server/manifests/init.pp
NO modules/mysql-server/files/${hostname}.my.cnf

Environment specific files:
environments/${environment}/modules/mysql-server/files/$
{hostname}.my.cnf
NO environments/${environment}/modules/mysql-server/manifests/init.pp

This errors with:
err: Could not retrieve catalog from remote server: Error 400 on
SERVER: Could not find class mysql-server for zpf-masterdb-dev-1-80g-
ruk at /etc/puppet/modules/zpf-masterdb/manifests/init.pp:46 on node
zpf-masterdb-dev-1-80g-ruk

So if an environments/${environment}/modules/mysql-server directory
exists, puppet expects a manifest in it and will not use the module/
mysql-server/manifest/init.pp, I suppose this is the expected
behaviour?  This means that a workaround structure needs to be put in
place to faciliate a "common class, environment specific
configurations and templates.  Is that correct?

Workaround by adding:
environments/${environment}/configs/mysql-server/files/$
{hostname}.my.cnf
and declaring the full path in the manifest

    source  => "puppet:///environments/${environment}/configs/mysql-
server/${hostname}.my.cnf",

Is there a "puppet standard method" that can achieve a common class
and environment specific files and templates?

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to