July 2017
Intermediate to advanced
402 pages
9h 38m
English
Execution of playbooks is done using the dedicated ansible-playbook command. The command relies on the same Ansible configuration file as we used previously and therefore we want to run the command from the root of our Ansible repository.
The syntax of the command is:
ansible-playbook <playbook.yml> [options]
We will first run the following command (adapting the value of the private-key option):
$ ansible-playbook helloworld.yml \
--private-key ~/.ssh/EffectiveDevOpsAWS.pem \
-e target=ec2 \
--list-hosts
The option -e (or --extra-vars) allows us to pass extra options for execution. In our case, we are defining the variable target (which we declared in the hosts file of our playbook) to be equal to ec2. This first ...
Read now
Unlock full access