← All Ansible Automation Flashcard Decks

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
  1. 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.

  2. 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.

  3. 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.

  4. 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 }}.

  5. 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.

  6. 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

  1. redhat.com — Score release, test delivery, renewal, score validity, exam information · verified Oct 2026
  2. docs.redhat.com — Fees, exam format, retake policy · verified Oct 2026