braintree / runbook

A framework for gradual system automation
MIT License
730 stars 43 forks source link

Ability to set `report_on_exception = false`? #36

Closed iphoting closed 4 years ago

iphoting commented 4 years ago

Sometimes, some commands executed on SSH will return an exit status > 0 or output into StdError. In such cases, runbook will throw the SSHKit exception and exits, disallowing the remaining steps to be run.

Is there a way to suppress these known error conditions and continue the runbook execution? Or is there a way to set report_on_exception = false into the underlying SSHKit config object.

pblesi commented 4 years ago

The typical pattern for doing this is to append and || true to the end of your shell command. This will prevent the command from returning a non-zero status code. I'm not familiar with report_on_exception, but would be curious to look more into this in the event it provides better functionality than || true

iphoting commented 4 years ago

Ah, the || true pattern is perfect for my situation. Looks like dealing with report_on_exception is not really necessary, please feel free to close this. 😀