X-Git-Url: http://git.squeep.com/?p=awsible;a=blobdiff_plain;f=roles%2Faws-vpc-infrastructure%2Ftasks%2Fmain.yml;h=af68180f18e9682b709f253093a784e63b871b39;hp=03923fec24ba41c92fdb1ceeb22ae9922dc2241d;hb=e482b07ff313d339805b75a654f2ec17badb0cd2;hpb=0901b0eeb5d83a02b09067e77c3a20c5d9d2ef31 diff --git a/roles/aws-vpc-infrastructure/tasks/main.yml b/roles/aws-vpc-infrastructure/tasks/main.yml index 03923fe..af68180 100644 --- a/roles/aws-vpc-infrastructure/tasks/main.yml +++ b/roles/aws-vpc-infrastructure/tasks/main.yml @@ -38,6 +38,33 @@ reuse_existing_ip_allowed: yes register: access_eip +# As of ansible 2.2.1.0, it cannot set anything on the main route table +# due to limitations of the underlying boto libarary. +# +# - name: route table facts +# ec2_vpc_route_table_facts: +# region: "{{ vpc_region }}" +# filters: +# vpc-id: "{{ vpc.vpc.id }}" +# register: vpc_default_route +# +# - debug: +# var: vpc_default_route +# +# - name: Main route table +# ec2_vpc_route_table: +# state: present +# vpc_id: "{{ vpc.vpc.id }}" +# region: "{{ vpc_region }}" +# lookup: id +# route_table_id: "{{ vpc_default_route.route_tables[0].id}}" +# routes: +# - gateway_id: igw +# register: main_route +# +# - debug: +# var: main_route + - name: Private route table ec2_vpc_route_table: state: present @@ -50,22 +77,25 @@ subnets: "{{ vpc_subnets_priv|map(attribute='cidr')|list }}" register: private_rt -- name: Public route table - ec2_vpc_route_table: - state: present - vpc_id: "{{ vpc.vpc.id }}" - region: "{{ vpc_region }}" - tags: - Name: "Public-Routes-vpc-{{ vpc_region }}" - zone: pub - managed: 'no' - subnets: "{{ vpc_subnets_pub|map(attribute='cidr')|list }}" - routes: - - dest: 0.0.0.0/0 - gateway_id: "{{ igw.gateway_id }}" - register: public_rt +# Using Main route table for public subnets, for now. +# +# - name: Public route table +# ec2_vpc_route_table: +# state: present +# vpc_id: "{{ vpc.vpc.id }}" +# region: "{{ vpc_region }}" +# tags: +# Name: "Public-Routes-vpc-{{ vpc_region }}" +# zone: pub +# managed: 'no' +# subnets: "{{ vpc_subnets_pub|map(attribute='cidr')|list }}" +# routes: +# - dest: 0.0.0.0/0 +# gateway_id: "{{ igw.gateway_id }}" +# register: public_rt - name: not implemented yet debug: msg: | + Add IGW to VPC Main route table Change pub-subnets to auto-assign external IPs