Closed pitosalas closed 4 years ago
Typically if an error occurs while executing a command it is an unexpected state and it is safest to exit the runbook and have a manual operator assess the situation. If it is expected that a command can fail and it should not be a critical error that halts the runbook, you can append || true
to the command and this will prevent the command from returning a fatal error (non-zero status code).
In some cases you may want to use the assert statement to test for a specific state multiple times if you expect that will not return a failure after some period of time or number of tries.
Thanks
What if the
command
fails?What's the recommended way to handle this situation?