Master programming syntax, solve interactive challenges & run live code in Syntaxis Explore Arena →
menu_book Course Curriculum (Ansible) expand_more
Ansible / Roles and Reuse

block rescue always

Learn block rescue always in Ansible through a focused explanation, a topic-specific example, an engineering warning, and a mastery check.

12 min read • Intermediate
ansible-022.yml
yaml
- block:
    - ansible.builtin.command: /usr/local/bin/deploy
  rescue:
    - ansible.builtin.command: /usr/local/bin/rollback
  always:
    - ansible.builtin.debug:
        msg: "deployment finished"
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content