0Pricing
Ansible Academy · Lesson

Desired State, Not Step-by-Step Scripts

Why declarative beats imperative.

Describe the End, Not the Steps

Ansible is declarative: you describe the end state you want, and Ansible figures out the steps to get there from wherever the host is now.

The Imperative Way

An imperative script lists exact commands in order. It assumes the starting state, so it breaks if the host is already partly set up.

apt-get update
apt-get install -y nginx
systemctl start nginx

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