How to do it...

The following are the steps for creating Ansible playbooks: 

  1. Create a new playbook. The folder structure will be as follows:
[root@ansible ~ ]# cd /etc/ansible/[root@ansible ansible]# mkdir playbook[root@ansible ansible]# mkdir playbook/roles[root@ansible ansible]# mkdir playbook/roles/vpc[root@ansible ansible]# mkdir playbook/roles/vpc/{defaults,tasks}[root@ansible ansible]# cd playbook
  1. Create the configuration file in the playbook folder awsvpc.yml.
[root@ansible playbook]# vim awsvpc.yml---- name: Create VPC hosts: localhost gather_facts: no roles: - vpc
    1. Create a file inventory in playbook folder and can be found at
[root@ansible playbook]# vim inventory ...

Get AWS Networking Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.