Search code examples
puppet

Puppet agent on fail function?


Do Puppet agents have any type of on failure ability?

I want to create a rule that says if a puppet agent tries to check in fails due to an SSL issue it should remove its SSL certificates and attempt the check-in process again.

I know all the commands I want to run, it's just a matter of finding a way to execute a script on SSL failure.

Any suggestions on how to do this?


Solution

  • Do Puppet agents have any type of on failure ability?

    Not a built-in one, no. They do log failures, of course. Or I guess the PE version might have something like that -- I wouldn't know.

    I know all the commands I want to run, it's just a matter of finding a way to execute a script on SSL failure.

    Any suggestions on how to do this?

    When run in --onetime mode, the agent's exit code conveys its success or failure, but you'd still have to analyze the log / console output to ascertain the nature of any failure. To use this for scheduled runs you would want to use an external scheduler such as cron to run the agent, rather than letting it run as a daemon itself. Some folks recommend that as a general good practice.