I am writing a bash script which will run puppet as follows:

puppetd --test --env test

I need my script to be able to tell if puppet ran successfully, I thought I 
might be able to do this by checking the exit code ($?) but it seems that 
regardless of whether the puppet run succeeds or fails it always gives and 
exit code of 0.

for example:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Failed to contact Foreman execution expired at /var/puppet...script.pp on 
node servername.com
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
[user@servername]# echo $?
0

I read on the puppet documentation web pages that there is a parameter 
called --detailed-exitcodes which I thought might help but that doesn't 
work at all:

puppetd --test --detailed-exitcodes --env test
invalid option: --detailed-exitcodes
Try '/usr/sbin/puppetd --help'

Am I missing something here, is there any other way for me to tell if 
puppet failed?

Thanks
Martin

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


Reply via email to