エラーハンドリング
failed_when:指定した条件が真の場合にタスクの実行結果を failed とする。
ignore_errors:True が指定された場合、タスクの実行結果が failed であってもプレイブックの実行を中断せずに次のタスクの実行に移る。
参考:
ansible での実行結果の success / failed と ignore_errors / failed_when がよくわからなかったので調べてみた – Qiita
Error Handling In Playbooks | Ansible Documentation [Official]
fail モジュール
指定したエラーメッセージを出力してプレイブックの実行を中断する。
参考:
Ansible の fail モジュール | technote (tech.withsin.net)
fail – Fail with custom message | Ansible Documentation [Official]
block / rescue
参考: