Running the playbook
As mentioned earlier, we worked our way through the playbook code; before you run the playbook, you must set the AWS_ACCESS_KEY
and AWS_SECRET_KEY
environment variables on your terminal session by running the following, making sure to update any values to those that you made a note of when you created the Ansible user in the AWS console:
$ export AWS_ACCESS_KEY=AKIAI5KECPOTNTTVM3EDA $ export AWS_SECRET_KEY=Y4B7FFiSWl0Am3VIFc07lgnc/TAtK5+RpxzIGTr
With the environment variables set, you can run the playbook running the now very familiar following code:
$ ansible-playbook -i hosts site.yml
Once completed, you should see something like the following terminal output:

Figure 10.1 – Running the playbook in a terminal
Going to the VPC and viewing the resource map in http://console.aws.amazon.com/ should display something like the following resource map:

Figure 10.2 – Viewing the resource map...