Ansible Modules & Task Execution Flashcards
6 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 6 Ansible Modules & Task Execution flashcards as text
What keyword is used to conditionally execute a task based on a variable or fact?
Answer: when
The 'when' keyword accepts a Jinja2 expression and skips the task if the expression evaluates to false.
Which task keyword allows you to loop over a list of items?
Answer: loop
The 'loop' keyword (introduced in Ansible 2.5) is the modern replacement for with_items and iterates tasks over a list.
What does the 'register' keyword do in an Ansible task?
Answer: Saves the task's output/return values into a variable for later use
The register keyword captures a task's result (stdout, rc, changed status, etc.) into a named variable accessible in subsequent tasks.
How do you reference the current loop item's value inside a task that uses 'loop'?
Answer: {{ item }}
Inside a loop, the current iteration's value is always available as the special variable {{ item }}.
What does setting 'ignore_errors: yes' on a task do?
Answer: Allows the playbook to continue even if the task fails
ignore_errors: yes tells Ansible to record the failure but continue executing subsequent tasks instead of stopping the play.
What is the purpose of 'failed_when' in a task?
Answer: Define a custom condition under which the task is considered failed
failed_when overrides Ansible's default failure detection with a custom Jinja2 expression, letting you define exactly what constitutes failure.
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