Interview Prep/Ansible/Roles, Collections and Project Structure

You are asked to make a role idempotent and prove it.

IntermediateScenarioRoles, Collections and Project Structure
Answer

Situation read → Evidence required.

What I'd do → Use Molecule's default scenario, which runs converge then idempotence.

molecule test

The idempotence step fails if the second converge reports any changed task.

Why → It automates "run twice, expect zero changes".

Interview tip → Fix offenders with changed_when or a proper module, not by disabling the check.

All Ansible questions Roadmap: Ansible

More on Roles, Collections and Project Structure