Why command Breaks Idempotency
The trap of raw shell and how to avoid it.
command Always Runs
The command module just runs whatever you give it on the host. It has no idea what 'done' looks like, so it runs every single time.
ansible.builtin.command: useradd deployAlways changed
Because command cannot inspect state, Ansible reports it as changed on every run, even when the command actually did nothing new.
changed: [web1]All lessons in this course
- Desired State, Not Step-by-Step Scripts
- Reading changed vs ok in Output
- Why command Breaks Idempotency
- Check Mode: Dry-Run with --check