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.
More on Roles, Collections and Project Structure
You have a 600-line playbook that sets up web, db and monitoring. How do you restructure it?BeginnerWhere do you put a variable users of your role are expected to override?BeginnerTwo roles need to run in a fixed order, such as `common` before `nginx`.BeginnerA role is used twice with different parameters in one play, but only runs once.IntermediateYou want to share roles across several repos and teams.IntermediateHow do you pin Ansible itself so a CI run today behaves like one last month?Intermediate