The playbook
The playbook is going to be split up into several sections. Before we make a start on the first one, let's create the folder structure. As per previous chapters, we simply need to run the following commands:
$ mkdir aws-wordpress aws-wordpress/group_vars aws-wordpress/roles
$ touch aws-wordpress/production aws-wordpress/site.yml aws-wordpress/group_vars/common.yml
Now that we have our basic structure in place, we can make a start on creating the roles, starting with the network.
Amazon VPC
All the work for creating the underlying network was completed in the previous chapter, meaning that we simply need to copy the elb
, gateway
, securitygroups
, subnets
, and vpc
folders from your previous playbook across to your current roles
folder.
Once copied, update the site.yml
file so it reads:
- name: Create and configure an Amazon VPC hosts: localhost connection: local gather_facts: True vars_files: - group_vars/common.yml roles: - roles/vpc - roles/subnets - roles...