[Puppet-users] Managing manifests

Bradley Baetz bbaetz at acm.org
Wed Jan 17 05:53:25 CST 2007


Hi,

I was talking to Luke today about managing manifests and related
files, and he suggested that I post to the list..

What would be nice (and what I've use in in-house systems I've used
previously) is to have a way to dynamically include manifest fragments
at runtime.

Lets assume that you're setting up bugzilla using puppet. In the
'main' manifest file, site.pp, you have:

node bugzilla {
   svnserve { '/opt/bugzilla':
       module => 'bugzilla',
       rev => 'release_20070117',
   }
}

Then within the bugzilla module, theres a manifest.pp file that has:

class XXX { # Syntax???
 # Needs a webserver
 include webserver

 # Package
 package { bugzilla: }

 # Optional module we want, not pulled in by RPM dependancies
 package { 'perl-Chart': }

 # Custom template
 file { "/usr/share/bugzilla/template/en/custom/pages/using-bugzilla.html.tmpl":
   # $_path expands to /opt/bugzilla, because thats where the module
was installed.
   source => "$_path/templates/using-bugzilla.html.tmpl",
 }

 # Apache config file
 file { "/etc/httpd/conf/bugzilla.conf":
   #NB - this needs local template expansion, since the file isn't
accessible on the server
   source => template("$_path/conf/bugzilla-httpd.conf"),
   notify => Service[httpd],
 }
}

The advantage of this is that all the files and config stays with the
module. If a newer bugzilla version comes out that needs a different
http config file, and some extra modules, then the whole lot can be
changed and tagged together, and released by just changing the 'rev'
tag in the main file. Test systems can just pull a different tag from
the main file, so a test->prod release just becomes a matter of
changing the release string.

Its a bit tricky if we let this happen recursively, with the module's
manifest file able to pull other modules which need manifests
included. There are also ordering issues, eg if one of the bits here
has a |before| tag for something in a differnent manifest file.

Does this sound sensible/reasonable/a good idea?

Thanks,

Bradley


More information about the Puppet-users mailing list