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.ymlPoint 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.ymlAll lessons in this course
- YAML Syntax You Need for Ansible
- From Ad-Hoc to a Repeatable Playbook
- Run It with ansible-playbook
- Install Nginx in Five Lines