We have so far seen the installation of 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 of 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 are reachable.
- The tasks' 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:
ok |
This is the number of playbook tasks that have been correctly... |