← All Ansible Automation Flashcard Decks

Ansible Testing with Molecule 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 Testing with Molecule flashcards as text
  1. In Molecule's molecule.yml, what does the 'platforms' section define?

    Answer: The test instances (containers/VMs) to create, including their names, images, and configuration

    The 'platforms' section specifies what test instances Molecule should create—their names, Docker images, OS versions, etc.

  2. What is Molecule's 'idempotency' test and why is it important?

    Answer: Molecule runs the converge playbook twice and fails if any task reports 'changed' on the second run, verifying that the role doesn't make unnecessary changes

    The idempotency check enforces a core Ansible principle—a properly written role should only make changes when needed, not on every run.

  3. How do you run Molecule tests for a specific scenario when multiple scenarios exist?

    Answer: molecule test --scenario-name scenarioname

    The '--scenario-name' flag (or '-s' shorthand) specifies which scenario to run when a role has multiple test scenarios.

  4. What is the purpose of Molecule's 'prepare' phase?

    Answer: It runs a prepare.yml playbook to configure test prerequisites on instances before the role under test is applied

    The prepare phase runs before converge to set up any prerequisites that the role expects (users, directories, packages) without those prerequisites being part of the role itself.

  5. How does Molecule integrate with CI/CD pipelines like GitHub Actions or GitLab CI?

    Answer: Molecule runs as a standard CLI tool in pipeline jobs; Docker-in-Docker or Docker socket mounting is needed for the Docker driver

    Molecule is a standard Python CLI tool that runs in any CI environment with Docker and Python available.

  6. What is the 'delegated' Molecule driver used for?

    Answer: It delegates instance management to custom playbooks (create.yml and destroy.yml), enabling Molecule to work with any infrastructure not supported by built-in drivers

    The delegated driver allows complete customization of instance lifecycle—create and destroy playbooks handle infrastructure provisioning, enabling testing on any platform.

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