Creating Ansible playbooks for creating VPC
We will be creating Ansible playbooks for managing VPC.
How to do it...
The following are the steps for creating Ansible playbooks:
- 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
- Create the configuration file in the
playbook
folderawsvpc.yml
.
[root@ansible playbook]# vim awsvpc.yml
---
- name: Create VPC
hosts: localhost
gather_facts: no
roles:
- vpc
- Create a file
inventory
inplaybook
folder and can be found at https://github.com/PacktPublishing/AWS-Networking-Cookbook.
- Create a file
[root@ansible playbook]# vim inventory
[local]
localhost ansible_connection=local
- Create a file
main.yml
inplaybook/roles/vpc/tasks/
folder. This file will contain the configurations required for...
- Create a file