--- - hosts: localhost tasks: - block: - debug: msg='Block 1' - command: /bin/true - debug: msg='Block 2' rescue: - debug: msg='Rescue 1' - command: /bin/false - debug: msg='Rescue 2' always: - debug: msg='Always' when: ansible_os_family == 'Debian' - debug: 'msg="Nach dem Block"'