0

I see a bug about this that was accepted and then closed a year ago: http://projects.puppetlabs.com/issues/3670 but I'm using puppet 2.7.14 and am getting the same issue.

I'm trying to use "puppet solo" (i.e. just running puppet apply on each server to be configured) as I only have 2 or 3 servers in this project and adding another server as a puppetmaster would be completely overkill. Unless I'm mistaken, the best way to apply a node manually to a server is to do:

puppet master --compile=mynode > catalog.json
puppet apply --catalog catalog.json

But the puppet master command outputs a couple of warnings and notices to stdout, mixed in with the desired json content. And it uses colored output so I can't just pipe it through egrep -v '^warning:'

EDIT: I guess it's not too big of a deal to use grep - since puppet 2.7 pretty-prints the actual content and the warnings don't ever start with spaces, piping the output through egrep '^( |{|})' works

So my questions are basically:

  • Is there a better way than this to apply a puppet node without using a puppetmaster? I can't really find any good references online to using puppet without a puppetmaster, even though that seems like a perfectly reasonable thing to do for a small project.
  • Is there a setting or flag that I'm missing that will get puppet master to stop being an asshole and send its errors to stderr instead of stdout?
  • Or do I really have to turn off color logging, then grep to exclude warning: and notice: lines?
2
  • That's badly broken. I can't find a solution at the moment either, but I'd point out the bug is still open/accepted and hasn't been closed (some fields have been changed, that's all). Jun 11, 2012 at 6:14
  • ahh, I guess I read that page wrong. Well, at least it's still open and hasn't just been completely ignored
    – danny
    Jun 11, 2012 at 16:14

1 Answer 1

1

To run in a masterless Puppet mode, you can just use puppet apply without needing the separate puppet master compilation step. This is the normal way it's done and will avoid the issues you're getting with log messages in catalogs (though that really should be fixed, the ticket's still open).

You need two populated paths to use puppet apply:

  1. Manifest path: the first manifest that Puppet will read, normally called site.pp
  2. Modules path: directories containing a set of modules in the standard layout

The site.pp manifest is often at /etc/puppet/manifests/site.pp and should probably just be a list of class includes:

include module1::class, module2::class

You can then run puppet apply --modulepath=/foo/modules site.pp or even just puppet apply --modulepath=/foo/modules -e "include module1::class".

1
  • Cool. I knew about the -e flag for including classes, but I want to use some global variables across classes. So maybe I'll make separate manifests instead of nodes for each server and define some global variables in them (I should probably also make my modules more "functional" and pass in more parameters instead of relying on global variables). Anyway, thanks for the tips
    – danny
    Jun 12, 2012 at 3:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .