diff --git a/tasks/create_routing_tables.yml b/tasks/create_routing_tables.yml index 961ba60..e476353 100644 --- a/tasks/create_routing_tables.yml +++ b/tasks/create_routing_tables.yml @@ -13,7 +13,7 @@ Name: PublicRouteTable vpc_id: "{{created_vpc.vpc.id}}" with_items: "{{vpc.subnets}}" - when: '"{{item.gateway}}" is defined and "{{item.gateway}}" == "igw"' + when: 'item.gateway is defined and item.gateway == "igw"' - name: Create private route table with NAT gateway route and associate subnets to it ec2_vpc_route_table: @@ -29,7 +29,7 @@ Name: PrivateRouteTableWithNAT vpc_id: "{{created_vpc.vpc.id}}" with_items: "{{vpc.subnets}}" - when: '"{{vpc.nat_gateway_subnet_name}} is defined and {{item.gateway}}" is defined and "{{item.gateway}}" == "nat"' + when: 'vpc.nat_gateway_subnet_name is defined and item.gateway is defined and item.gateway == "nat"' - name: Create private route table and associate subnets to it ec2_vpc_route_table: