The internet gateway role

While the internet gateway role is going to only variables which we have defined in common.yml, and through gathering information in previous tasks, we should continue to bootstrap the roles folder as we have been doing:

$ ansible-galaxy init roles/gateway

We are going to be using two modules in the role; the first, ec2_vpc_igw, creates the internet gateway and tags it:

- name: ensure that there is an internet gateway  ec2_vpc_igw:    region: "{{ ec2_region }}"    vpc_id: "{{ vpc_info.vpc.id }}"    state: present    tags:      "Name": "{{ environment_name }}_internet_gateway"      "Environment": "{{ environment_name }}"      "Use": "gateway"  register: igw_info

We then print the information we have registered about the internet gateway to the ...

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.