# HG changeset patch # User Oleksandr Gavenko # Date 1604519561 -7200 # Node ID 1a02d5429a5d28005099a2ca70c258fb88da0f74 # Parent cb043d4756a2622d7380f5c74a462c58504df141 Blocks. diff -r cb043d4756a2 -r 1a02d5429a5d ansible.rst --- a/ansible.rst Wed Nov 04 21:46:58 2020 +0200 +++ b/ansible.rst Wed Nov 04 21:52:41 2020 +0200 @@ -180,3 +180,19 @@ * With ``free`` strategy tasks are executed without waiting for completion of the same task on every host. +Blocks +====== + +To avoid repetitive checks or to handle failures use ``block``:: + + block: + - shell: echo do 1 + - shell: echo do 2 + when: not db_started + become: true + become_user: dba + rescue: + - shell: echo rollback + always: + - shell: echo notify +