Interview Prep/Ansible/Performance, Testing and CI/CD

Molecule's idempotence step fails. How do you find the offending task?

IntermediateScenarioPerformance, Testing and CI/CD
Answer

Situation read → Some task changes on the second run.

What I'd do →

  1. Read the log: Molecule prints the tasks that changed.
  2. Run molecule converge twice and look at the second output for changed:.
  3. Fix with real modules, changed_when, or creates.

Why → Typical causes: command/shell without guards, lineinfile with a bad regexp, templates containing timestamps.

Interview tip → Never "fix" by skipping the idempotence step.

All Ansible questions Roadmap: Ansible

More on Performance, Testing and CI/CD