Testing the playbook

As mentioned, now would be a good time to test the roles we have completed to make sure they are working as expected. To do this, open the site.yml file and add the following content:

---- name: Create, launch and configure our basic AWS environment  hosts: localhost  connection: local  gather_facts: True  vars_files:    - group_vars/common.yml  roles:    - roles/vpc    - roles/subnets    - roles/gateway    - roles/securitygroups    - roles/elb    - roles/rds    - roles/efs

Before we run our playbook, we will need to set the AWS_ACCESS_KEY and AWS_SECRET_KEY environment variables; to do this, run the following, replacing the value of each variable with the details that we generated in the previous chapter:

$ export AWS_ACCESS_KEY=AKIAI5KECPOTNTTVM3EDA ...

Get Learn Ansible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.