0Pricing
Ansible Academy · Lesson

Run It with ansible-playbook

Execute and read the play output.

The ansible-playbook Command

You run a playbook with the ansible-playbook command, not plain ansible. Pass it the YAML file you want to execute.

ansible-playbook site.yml

Point It at Your Inventory

Use -i to choose which inventory file lists your hosts. Without it, Ansible falls back to its default inventory.

ansible-playbook -i inventory.ini site.yml

All lessons in this course

  1. YAML Syntax You Need for Ansible
  2. From Ad-Hoc to a Repeatable Playbook
  3. Run It with ansible-playbook
  4. Install Nginx in Five Lines
← Back to Ansible Academy