Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Fix security group not in the correct VPC #15

Merged
merged 1 commit into from
Jun 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,20 @@
keypair_name: molecule_key
keypair_path: "{{ lookup('env', 'MOLECULE_EPHEMERAL_DIRECTORY') }}/ssh_key"
tasks:
- name: Create security group
- name: Find the vpc for the subnet
ec2_vpc_subnet_facts:
subnet_ids: "{{ item.vpc_subnet_id }}"
loop: "{{ molecule_yml.platforms }}"
register: subnet_facts

- name: Create security groups
ec2_group:
vpc_id: "{{ item.subnets[0].vpc_id }}"
name: "{{ security_group_name }}"
description: "{{ security_group_name }}"
rules: "{{ security_group_rules }}"
rules_egress: "{{ security_group_rules_egress }}"
loop: "{{ subnet_facts.results }}"

- name: Test for presence of local keypair
stat:
Expand Down