further progress on infrastructure buildout
[awsible] / roles / aws-vpc / tasks / main.yml
index 26a75ae8027c609b6a2f27ebbc47cc9bbe5569b4..e92a53aeafc513da275623eff79089de8485a154 100644 (file)
@@ -1,72 +1,15 @@
 ---
+- assert:
+    that:
+    - vpc_name != ''
+    - vpc_cidr != ''
+    - vpc_region != ''
+  tags: ['check_vars']
+
 - name: VPC
   ec2_vpc_net:
     state: present
     name: "{{ vpc_name }}"
     cidr_block: "{{ vpc_cidr }}"
     region: "{{ vpc_region }}"
-  register: vpc
-
-- name: IGW
-  ec2_vpc_igw:
-    state: present
-    vpc_id: "{{ vpc.vpc.id }}"
-    region: "{{ vpc_region }}"
-  register: igw
-
-- name: Name IGW
-  ec2_tag:
-    state: present
-    resource: "{{ igw.gateway_id }}"
-    region: "{{ vpc_region }}"
-    tags:
-      Name: "igw-{{ vpc_region }}"
-
-- name: Subnets
-  with_items: "{{ subnets_pub + subnets_priv }}"
-  ec2_vpc_subnet:
-    state: present
-    vpc_id: "{{ vpc.vpc.id }}"
-    region: "{{ vpc_region }}"
-    cidr: "{{ item.cidr }}"
-    az: "{{ item.az }}"
-    tags: "{{ item.resource_tags }}"
-
-- name: Access/NAT EIP
-  ec2_eip:
-    in_vpc: yes
-    region: "{{ vpc_region }}"
-    reuse_existing_ip_allowed: yes
-  register: access_eip
-
-- name: Private route table
-  ec2_vpc_route_table:
-    state: present
-    vpc_id: "{{ vpc.vpc.id }}"
-    region: "{{ vpc_region }}"
-    tags:
-      Name: "Private-Routes-vpc-{{ vpc_region }}"
-      zone: priv
-      managed: 'yes'
-    subnets: "{{ 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: "{{ 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: |
-      Change pub-subnets to auto-assign external IPs
+  register: vpc
\ No newline at end of file