An engineer runs the playbook as shown: ```yaml - hosts: all tasks: - block: - name: configure firewall command: /bin/false - name: enable service service: name=httpd enabled=yes - name: start service service: name=httpd state=started - hosts: all tasks: - name: next task debug: msg="Continuing to next play" ``` What is the expected result?
Answered 'y' for configure firewall, 'n' for enable service (skipped), and 'c' for start service (continue to next play).
Why this answer
The playbook includes a block containing only the 'configure firewall' task. When this task fails and no rescue block is defined, the play fails immediately. The playbook then moves to the next play, skipping any remaining tasks in the current play, including the 'enable service' task.
Thus, 'configure firewall' is executed, 'enable service' is skipped, and the playbook continues to the next play.
Exam trap
The EX294 exam often tests the misconception that the `always` block is mandatory or that tasks after a rescue block will still execute, but in reality, the play moves to the next play after the rescue, skipping subsequent tasks in the same play.
How to eliminate wrong answers
Option A is wrong because the 'configure firewall' task is executed, but the rescue block ensures the 'enable service' task runs after the failure, not skipped entirely. Option C is wrong because the 'configure firewall' task fails, so not all tasks are executed; the 'start service' task is skipped due to the play moving to the next play. Option D is wrong because the 'start service' task is not executed; it is skipped because the rescue block does not include it, and the playbook continues to the next play after the rescue.