fixes to complete basic infrastructure buildout
[awsible] / roles / aws-vpc-infrastructure / tasks / main.yml
index 03923fec24ba41c92fdb1ceeb22ae9922dc2241d..af68180f18e9682b709f253093a784e63b871b39 100644 (file)
     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
     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