--detailed-exitcodes
というオプションを puppet apply
の際に渡すと便利らしい。
--detailed-exitcodes
Provide transaction information via exit codes. If this is enabled, an exit code of '2' means there were changes, an exit code of '4' means there were failures during the transaction, and an exit code of '6' means there were both changes and failures.
つまり、
- 変更がなくエラーもなければ
0
で終了する。 - 変更があれば
2
で終了する。 - なにも変更が無く、エラーがあった場合
4
で終了する。 - 何かが変更されてエラーもある場合は
6
で終了する。
逆にCIの時は 2
で終了した場合でもハンドルしとかないといけない。