Ansible Playbooks Flashcards
7 cards from real Ansible Automation practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 7 Ansible Playbooks flashcards as text
Which directive in a play limits execution to a subset of hosts defined in the inventory?
Answer: limit
The `limit` directive (or `--limit` CLI flag) restricts playbook execution to a subset of the matched hosts.
What is the purpose of the `any_errors_fatal: true` play-level option?
Answer: Abort the entire play if any host fails a task
`any_errors_fatal: true` causes Ansible to immediately stop the play for all hosts if any single host fails a task.
Which keyword forces a task to run only once regardless of how many hosts are targeted?
Answer: run_once
`run_once: true` on a task causes it to execute on only one host in the play, typically the first host.
In a playbook, what does `gather_subset: ['network']` control?
Answer: Limits fact gathering to network-related facts only
`gather_subset` restricts `setup` module output to specific fact categories, reducing overhead.
Which statement about `pre_tasks` in a playbook is correct?
Answer: pre_tasks run before roles and tasks sections
`pre_tasks` execute before the `roles` and `tasks` blocks, allowing setup steps to complete first.
What is the effect of setting `strategy: free` in a play?
Answer: Each host executes tasks as fast as it can without waiting for others
The `free` strategy allows each host to proceed through tasks independently at its own pace.
How does `max_fail_percentage: 25` affect a play running against 8 hosts?
Answer: The play continues until more than 2 hosts fail
25% of 8 hosts is 2; the play aborts when failures exceed 2 hosts (i.e., 3 or more fail).
How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy
Sources & references
Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy
- redhat.com — Score release, test delivery, renewal, score validity, exam information · verified Oct 2026
- docs.redhat.com — Fees, exam format, retake policy · verified Oct 2026