LOGBOOK

HELP

Quiz Entry - updated: 2026.10.30

Why run the same playbook a second time, and what should the recap show?

To prove it is idempotent: the first run reports changed=2 (package installed, file copied), the second run should report ok=4 changed=0, because everything is already in the desired state.

Two runs of the same playbook: first run shows Gathering Facts ok, install changed, copy changed, service ok, recap ok=4 changed=2; second run all ok, recap ok=4 changed=0

* Same playbook, same hosts: the second run finds nothing left to do. *

In the Apache lab, the first run shows:

  • Gathering Facts: ok
  • Install httpd: changed (apache2 was installed)
  • Copy index.html: changed (the file was new)
  • Start service: ok (on Debian the package starts Apache on install, so it was already running)

Recap: ok=4 changed=2 unreachable=0 failed=0.

The second run should change nothing: ok=4 changed=0. That is the practical test of a good playbook. If a task reports changed on every run, it is either not idempotent (a command/shell task, an appending echo >>) or something on the host keeps drifting, and both deserve attention. A clean second run also means you can safely rerun the playbook any time to repair drift.

Go deeper:

From Quiz: ITIA / Ansible Inventory, Configuration and Playbooks | Updated: Oct 30, 2026