Chapter 5: Implementing Task Control
Ansible task control quiz
Twelve questions on loops, conditionals, handlers and failure handling. Aim for at least nine before moving on to chapter 6.
- What is wrong with this task?
- Each entry in `loop` is `{name: jane, groups: wheel}`. How do you pass the group to the user module?
- Which older keyword behaves like `loop` for a simple list?
- Which condition runs the task only when `max_retries` has been set?
- Which condition is true for a host running RHEL or Fedora?
- What does this `when` mean?
- With Ansible Core 2.13, `do_it: "no"` (quoted) and `when: do_it`. Does the task run?
- A task has `notify: restart httpd` and reports `ok`. What happens to the handler?
- Which play setting runs already-notified handlers even when a later task fails?
- Which keyword makes a task report failure based on its output?
- In a block with rescue and always, the block succeeds. What runs next?
- Which task keeps the second run at `changed=0`?