0Pricing
Ansible Academy · Lesson

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 deploy

Always 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

  1. Desired State, Not Step-by-Step Scripts
  2. Reading changed vs ok in Output
  3. Why command Breaks Idempotency
  4. Check Mode: Dry-Run with --check
← Back to Ansible Academy