On Aug 2, 2010, at 5:50 PM, Jon Wilson wrote: > Hiya, > > Is there a way I can easily generate the catalog for a particular > puppet client, without actually running Puppet on that client? > > I'd like to write some unit tests for my Puppet master, which generate > catalogs for a set of clients, and check their content. This will > syntax & sanity check my manifests, without getting stuck in > certificate hell.
Here's a command to get you started: puppetmasterd --compile clients.fqdn I'm not sure how, but some magic is being done to get the client's facts. I'm assuming the facts are cached from an earlier run, but this is pure speculation. If you run it with --verbose, it will send that information to stderr. To make the tests much shorter on failure, you probably want to test the erb using "erb -x -P -T '-' $1 | ruby -c " and test the config using --parseonly. Warning: when the catalog is compiled, everything* that would normally be done with storeconfigs will be done. This means running tests like this can affect your existing configuration. *I'm not actually sure it does everything, but it does most of the storeconfigs stuff. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
