Hi all, I'm looking for background information about how bug #7127[1] should be fixed: prerun_command don't stop puppet on error
I think there's general agreement that if the prerun command fails, then the catalog should not be applied, but the report should be sent, and the report's status should be "failed". However, what about the post-run command? In particular, if the catalog is applied successfully, but the postrun command fails, should the overall run be considered a failure? The documentation[2] says it should be: "A command to run after every agent run. If this command returns a non-zero return code, the entire Puppet run will be considered to have failed, even though it might have performed work during the normal run." But there are several problems with the way the code is currently implemented. * If the postrun command fails, puppet never sends the report. * Errors that occur while running the pre and postrun commands are not captured in the report's log. * If the catalog is applied successfully, but the postrun command fails, the report status is not changed to "failed". Right now it doesn't matter because the report is never sent, but if I fix that, it could matter. Thoughts? The only use case I know of is etckeeper, but its postrun command, etckeeper-commit-post[3], always returns 0 even if the etckeeper command fails. Finally, the prerun command is executed after dostorage, download_plugins, download_fact_plugins. Is there reason for the prerun command to occur first? 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. * The report would contain all errors from stages that were executed. * The report status, resource statuses, and metrics would be consistent. Thanks, Josh [1] http://projects.puppetlabs.com/issues/7127 [2] http://docs.puppetlabs.com/references/stable/configuration.html#postruncommand [3] https://code.launchpad.net/~soren/ubuntu/lucid/puppet/etckeeper-integration -- 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.
