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
What is Ansible Molecule used for?
Answer: Testing Ansible roles and collections by automatically provisioning test instances, running playbooks, and verifying the resulting state
Molecule provides a structured framework for testing Ansible roles across multiple platforms and scenarios, enabling TDD for infrastructure code.
What is the default driver used by Molecule when initializing a new scenario?
Answer: Docker
Docker is Molecule's default driver because containers start quickly and are lightweight, making them ideal for rapid test iteration.
What command initializes a new Molecule scenario inside an existing Ansible role?
Answer: molecule init scenario
'molecule init scenario' creates the molecule/ directory structure with default configuration files for a new test scenario.
What does 'molecule converge' do?
Answer: It applies the role to the test instance by running the converge.yml playbook, without destroying the instance afterward
'molecule converge' applies the role to existing test instances, leaving them running for iterative development and debugging.
What is the difference between 'molecule test' and 'molecule converge'?
Answer: 'molecule test' runs the full lifecycle (create→converge→verify→destroy) for CI; 'molecule converge' only applies the role for interactive development
'molecule test' is for CI pipelines (full ephemeral lifecycle); 'molecule converge' is for development (persistent instances for iteration).
Which Molecule verifier uses Python test code with assertions about the remote system state?
Answer: Testinfra (via pytest)
Testinfra (integrated with pytest) allows writing Python assertions to verify file contents, service states, packages, users, and more on test instances.
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