Automation and APIs
Idempotence
Doing it again changes nothing: a run that describes a state leaves a device already in that state alone.
An idempotent playbook compares what is with what should be and changes only the difference, so a second run
reports changed=0. That makes it safe to run on a schedule, and makes changed mean something: a device was not
as described. A script of commands is not idempotent: replaying it may add a line twice or fail on one that exists.
HTTP has the same idea: PUT and DELETE are idempotent, POST is not.