0Pricing
Ansible Academy · Lesson

Converge, Verify & the Test Matrix

Run a role and assert the result.

Converge, Verify & the Test Matrix is a free Ansible Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Ansible Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

The Test Sequence

Molecule runs an ordered set of steps called the test matrix: create, converge, verify, and destroy, among others.

Create Spins Up the Host

The create step launches the platforms from molecule.yml, giving you a clean container or VM to test on.

molecule create

Converge Runs Your Role

The converge step executes converge.yml, applying your role to the freshly created test host.

molecule converge

Iterate Fast with converge

During development you can rerun converge repeatedly on the same host to try changes without recreating it each time.

Verify Asserts the Outcome

The verify step runs your assertions to confirm the role produced the files, packages, and services you expect.

molecule verify

Assert with Ansible

By default verify.yml uses the Ansible verifier, so you write checks as ordinary tasks with the assert module.

- assert:
    that: result.status == 'running'

Gather Then Check

A verify play usually gathers state first, for example with the service_facts module, then asserts against what it found.

- ansible.builtin.service_facts:

Log In and Look

When something fails, the login command drops you into a shell on the running test host to debug by hand.

molecule login

Destroy Cleans Up

The destroy step tears down the test host so nothing lingers between runs or costs you money.

molecule destroy

Test Runs the Full Matrix

The molecule test command runs the entire sequence end to end and destroys the host even when a step fails.

molecule test

Multi-Platform Matrix

List several images under platforms and Molecule tests your role on each, proving it works across distros in one run.

Quick Check

Recall which step actually applies your role to the test host.

Recap

The matrix runs create, converge to apply the role, verify to assert, and destroy to clean up. One molecule test runs it all. ✅

Frequently asked questions

Is the “Converge, Verify & the Test Matrix” lesson free?

Yes — the full text of “Converge, Verify & the Test Matrix” is free to read here on the web, and the Ansible Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Ansible Academy course, upgrade to CoddyKit PRO.

What will I learn in “Converge, Verify & the Test Matrix”?

Run a role and assert the result. You practise Ansible Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Ansible Academy?

No prior experience is required. Ansible Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Converge, Verify & the Test Matrix” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Ansible Academy lesson?

Yes. Every Ansible Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Why Test Infrastructure Code
  2. molecule init & the Scenario Layout
  3. Converge, Verify & the Test Matrix
  4. Idempotence & Lint in the Pipeline
← Back to Ansible Academy