Re: [Puppet Users] Idiom for throwing an error if a command fails

2013-10-03 Thread Richard K Miller
> For example, the following code throws an error if the machine has anything > other than 8 cores. > > exec { "echo 'This machine does not have 8 cores!'; exit 1": > unless => "facter processorcount | grep -q 8", > } > > The "; exit 1" changes this from a Notice to an Error, but it seem

[Puppet Users] Idiom for throwing an error if a command fails

2013-10-02 Thread Richard K. Miller
Hi, What's the best idiom for executing a command on every Puppet run and triggering an error if the command fails? For example, the following code throws an error if the machine has anything other than 8 cores. exec { "echo 'This machine does not have 8 cores!'; exit 1": unless => "fact