Commit 65815766 by Feanil Patel

Prep to rename the role to vpc.

Also update vars to better follow our conventions.
parent b9ec08cd
...@@ -14,12 +14,12 @@ ...@@ -14,12 +14,12 @@
# #
# vars are namespace with the module name. # vars are namespace with the module name.
# #
edx_vpc_role_name: edx_vpc vpc_role_name: vpc
# #
# OS packages # OS packages
# #
edx_vpc_debian_pkgs: [] vpc_debian_pkgs: []
edx_vpc_redhat_pkgs: [] vpc_redhat_pkgs: []
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
module: 'ec2_vpc_local' module: 'ec2_vpc_local'
resource_tags: '{{ vpc_tags }}' resource_tags: '{{ vpc_tags }}'
cidr_block: '{{ vpc_cidr }}' cidr_block: '{{ vpc_cidr }}'
region: '{{ aws_region }}' region: '{{ vpc_aws_region }}'
state: '{{ vpc_state }}' state: '{{ vpc_state }}'
internet_gateway: yes internet_gateway: yes
wait: yes wait: yes
...@@ -41,19 +41,19 @@ ...@@ -41,19 +41,19 @@
# outside world using the internet gateway. # outside world using the internet gateway.
- name: create public network acl - name: create public network acl
ec2_acl: ec2_acl:
profile: "{{ profile }}" profile: "{{ vpc_aws_profile }}"
name: "{{ vpc_public_acl.name }}" name: "{{ vpc_public_acl.name }}"
vpc_id: "{{ created_vpc.vpc_id }}" vpc_id: "{{ created_vpc.vpc_id }}"
state: "present" state: "present"
region: "{{ aws_region }}" region: "{{ vpc_aws_region }}"
rules: "{{ vpc_public_acl.rules }}" rules: "{{ vpc_public_acl.rules }}"
register: created_public_acl register: created_public_acl
- name: create public route table - name: create public route table
ec2_rt: ec2_rt:
profile: "{{ profile }}" profile: "{{ vpc_aws_profile }}"
vpc_id: "{{ created_vpc.vpc_id }}" vpc_id: "{{ created_vpc.vpc_id }}"
region: "{{ aws_region }}" region: "{{ vpc_aws_region }}"
state: "present" state: "present"
name: "{{ vpc_name }}-public" name: "{{ vpc_name }}-public"
routes: "{{ vpc_public_route_table }}" routes: "{{ vpc_public_route_table }}"
...@@ -61,9 +61,9 @@ ...@@ -61,9 +61,9 @@
- name: create public subnets - name: create public subnets
ec2_subnet: ec2_subnet:
profile: "{{ profile }}" profile: "{{ vpc_aws_profile }}"
vpc_id: "{{ created_vpc.vpc_id }}" vpc_id: "{{ created_vpc.vpc_id }}"
region: "{{ aws_region }}" region: "{{ vpc_aws_region }}"
state: "present" state: "present"
name: "{{ item.name }}" name: "{{ item.name }}"
cidr: "{{ item.cidr }}" cidr: "{{ item.cidr }}"
...@@ -75,10 +75,10 @@ ...@@ -75,10 +75,10 @@
- name: create NAT security group - name: create NAT security group
ec2_group: ec2_group:
profile: "{{ profile }}" profile: "{{ vpc_aws_profile }}"
vpc_id: "{{ created_vpc.vpc_id }}" vpc_id: "{{ created_vpc.vpc_id }}"
state: "present" state: "present"
region: "{{ aws_region }}" region: "{{ vpc_aws_region }}"
name: "{{ nat_security_group.name }}" name: "{{ nat_security_group.name }}"
rules: "{{ nat_security_group.rules }}" rules: "{{ nat_security_group.rules }}"
description: "{{ nat_security_group.description }}" description: "{{ nat_security_group.description }}"
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
- name: check to see if we already have a nat instance - name: check to see if we already have a nat instance
local_action: local_action:
module: "ec2_lookup" module: "ec2_lookup"
region: "{{ aws_region }}" region: "{{ vpc_aws_region }}"
tags: tags:
- Name: "{{ vpc_name }}-nat-instance" - Name: "{{ vpc_name }}-nat-instance"
register: nat_instance register: nat_instance
...@@ -99,10 +99,10 @@ ...@@ -99,10 +99,10 @@
state: 'present' state: 'present'
wait: "yes" wait: "yes"
source_dest_check: false source_dest_check: false
region: "{{ aws_region }}" region: "{{ vpc_aws_region }}"
profile: "{{ profile }}" profile: "{{ vpc_aws_profile }}"
group_id: "{{ created_nat_security_group.group_id }}" group_id: "{{ created_nat_security_group.group_id }}"
key_name: "{{ vpc_nat_keypair }}" key_name: "{{ vpc_keypair }}"
vpc_subnet_id: "{{ created_public_subnets.results[0].subnet_id }}" vpc_subnet_id: "{{ created_public_subnets.results[0].subnet_id }}"
instance_type: "{{ vpc_nat_instance_type }}" instance_type: "{{ vpc_nat_instance_type }}"
instance_tags: instance_tags:
...@@ -117,15 +117,15 @@ ...@@ -117,15 +117,15 @@
- name: lookup the created nat_instance - name: lookup the created nat_instance
local_action: local_action:
module: "ec2_lookup" module: "ec2_lookup"
region: "{{ aws_region }}" region: "{{ vpc_aws_region }}"
tags: tags:
- Name: "{{ vpc_name }}-nat-instance" - Name: "{{ vpc_name }}-nat-instance"
register: nat_instance register: nat_instance
- name: assign eip to nat - name: assign eip to nat
ec2_eip: ec2_eip:
profile: "{{ profile }}" profile: "{{ vpc_aws_profile }}"
region: "{{ aws_region }}" region: "{{ vpc_aws_region }}"
instance_id: "{{ nat_instance.instances[0].id }}" instance_id: "{{ nat_instance.instances[0].id }}"
in_vpc: true in_vpc: true
reuse_existing_ip_allowed: true reuse_existing_ip_allowed: true
...@@ -133,9 +133,9 @@ ...@@ -133,9 +133,9 @@
- name: create private route table - name: create private route table
ec2_rt: ec2_rt:
profile: "{{ profile }}" profile: "{{ vpc_aws_profile }}"
vpc_id: "{{ created_vpc.vpc_id }}" vpc_id: "{{ created_vpc.vpc_id }}"
region: "{{ aws_region }}" region: "{{ vpc_aws_region }}"
state: "present" state: "present"
name: "{{ vpc_name }}-private" name: "{{ vpc_name }}-private"
routes: "{{ vpc_private_route_table }}" routes: "{{ vpc_private_route_table }}"
...@@ -143,19 +143,19 @@ ...@@ -143,19 +143,19 @@
- name: create db network acl - name: create db network acl
ec2_acl: ec2_acl:
profile: "{{ profile }}" profile: "{{ vpc_aws_profile }}"
name: "{{ vpc_db_acl.name }}" name: "{{ vpc_db_acl.name }}"
vpc_id: "{{ created_vpc.vpc_id }}" vpc_id: "{{ created_vpc.vpc_id }}"
state: "present" state: "present"
region: "{{ aws_region }}" region: "{{ vpc_aws_region }}"
rules: "{{ vpc_db_acl.rules }}" rules: "{{ vpc_db_acl.rules }}"
register: created_db_acl register: created_db_acl
- name: create db subnets - name: create db subnets
ec2_subnet: ec2_subnet:
profile: "{{ profile }}" profile: "{{ vpc_aws_profile }}"
vpc_id: "{{ created_vpc.vpc_id }}" vpc_id: "{{ created_vpc.vpc_id }}"
region: "{{ aws_region }}" region: "{{ vpc_aws_region }}"
state: "present" state: "present"
name: "{{ item.name }}" name: "{{ item.name }}"
cidr: "{{ item.cidr }}" cidr: "{{ item.cidr }}"
...@@ -175,8 +175,8 @@ ...@@ -175,8 +175,8 @@
- name: create db subnet group - name: create db subnet group
rds_subnet_group: rds_subnet_group:
profile: "{{ profile }}" profile: "{{ vpc_aws_profile }}"
region: "{{ aws_region }}" region: "{{ vpc_aws_region }}"
state: "present" state: "present"
name: "{{ vpc_db_subnet_group.name }}" name: "{{ vpc_db_subnet_group.name }}"
description: "{{ vpc_db_subnet_group.description }}" description: "{{ vpc_db_subnet_group.description }}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment