puppet master --compile logs errors to stdout
Posted
by
danny
on Server Fault
See other posts from Server Fault
or by danny
Published on 2012-06-11T05:02:16Z
Indexed on
2012/06/12
4:42 UTC
Read the original article
Hit count: 517
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?
© Server Fault or respective owner