Executing Ansible
So far, we've learned how to install Ansible, listed the hosts in the inventory, and set up our Ansible playbook. Now, we can run Ansible to configure our VMs.
For this, we will run the Ansible tool with the ansible-playbook
command, like this:
ansible-playbook -i inventory playbook.yml
The basic options for this command are as follows:
- The
-i
argument with the inventory file path - The path of the playbook file
The following is the execution of this command:
The execution of this command applies the playbook to the hosts in the inventory in several steps:
- Gathering facts: Ansible checks that the hosts can be reached.
- The task's playbook is executed on hosts.
PLAY Recap
: This is the status of the changes that were executed on each host; the value of this status can be as follows: