What is idempotency and why does it matter?
BeginnerConceptAd-hoc Commands, Modules and Idempotency
Answer
An operation is idempotent if running it once or ten times leaves the system in the same final state. For Ansible this means a second run reports changed=0.
It matters because it lets you re-run playbooks safely after a partial failure, use them as drift correction, and run them in CI as a test. A playbook that is not idempotent (for example appending a line with shell: echo >> file) corrupts state over repeated runs.
More on Ad-hoc Commands, Modules and Idempotency
What is an ad-hoc command and what is its syntax?BeginnerWhat does `ansible all -m ping` actually test?BeginnerGive practical use cases for ad-hoc commands.IntermediateWhat is the difference between the `command` and `shell` modules?BeginnerCompare `raw`, `command`, `shell` and `script`.IntermediateWhy prefer a dedicated module over `shell`/`command`?Beginner