Hi Josh,

This might be out of scope of your bug fix, but why not make the
behaviour configurable? If prerun/postrun fails, give people the
option of continuing or dying.

prerun_command = /bin/meow
prerun_failure_fatal = true

> It'd be great to hear about your experience with the pre/post run
> commands and what use cases you are trying to solve.
>
> Also, is there anything that is being solved with pre/post run
> commands that can't be solved using stages? For example, if the prerun
> command, catalog, and postrun commands are executed as stages, in that
> order, with each stage depending on its predecessor(s), it would
> ensure that:
>
>   * An error in one stage would prevent the following stage(s) from executing.

I have one use case to contribute. I've once had to use prerun and
postrun hooks to open up software firewall rules using iptables for
the duration of the puppet run to allow outbound http traffic for
package retrieval (don't ask, was inserting Puppet into an existing
environment). So had the equivalent of:

prerun_command = /sbin/iptables -D rule
postrun_command = /sbin/iptables -A rule

Pretty sure I couldn't use run stages for that because if the puppet
catalog failed to apply, the iptables rule would not be re-added.

-Luke

-- 
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.

Reply via email to