|
49 | 49 | plat__aws_xaccount_account_id: "{{ plat__cdp_xaccount_account_id }}" |
50 | 50 |
|
51 | 51 | # Runlevel first, upstream second, and discover third |
52 | | -- name: Discover AWS VPC if not defined |
| 52 | +- name: Discover AWS VPC if not defined or established by Infrastructure |
53 | 53 | when: plat__aws_vpc_id == "" and infra__aws_vpc_id is undefined |
54 | 54 | block: |
55 | 55 | - name: Query AWS VPC by name |
|
71 | 71 | plat__aws_vpc_id: "{{ __aws_vpc_info.vpcs[0].id }}" |
72 | 72 |
|
73 | 73 | - name: Set fact for AWS VPC ID if established by Infrastructure |
74 | | - when: infra__aws_vpc_id is defined |
| 74 | + when: plat__aws_vpc_id == "" and infra__aws_vpc_id is defined |
75 | 75 | ansible.builtin.set_fact: |
76 | 76 | plat__aws_vpc_id: "{{ infra__aws_vpc_id }}" |
77 | 77 |
|
78 | | -# Runlevel first, upstream second, and discover third |
79 | | -- name: Handle AWS Public and Private VPC Subnets if not defined |
80 | | - when: not plat__aws_public_subnet_ids or not plat__aws_private_subnet_ids |
| 78 | +- name: Handle AWS Subnet IDs if not defined |
| 79 | + when: not plat__aws_public_subnet_ids or not plat__aws_private_subnet_ids # Defaults are empty lists |
81 | 80 | block: |
82 | 81 | - name: Query AWS Subnets |
83 | 82 | amazon.aws.ec2_vpc_subnet_info: |
|
144 | 143 | ansible.builtin.set_fact: |
145 | 144 | plat__endpoint_access_scheme: "PUBLIC" |
146 | 145 |
|
| 146 | +# TODO Collapse the two SG queries together |
147 | 147 | - name: Discover AWS Security Group for Knox |
148 | 148 | when: infra__aws_security_group_knox_id is undefined |
149 | 149 | block: |
150 | 150 | - name: Query AWS Security Group for Knox |
151 | 151 | amazon.aws.ec2_group_info: |
152 | 152 | region: "{{ plat__region }}" |
153 | 153 | filters: |
| 154 | + vpc-id: "{{ plat__aws_vpc_id }}" |
154 | 155 | group-name: "{{ plat__security_group_knox_name }}" |
155 | 156 | register: __aws_security_group_knox_info |
156 | 157 |
|
|
171 | 172 | amazon.aws.ec2_group_info: |
172 | 173 | region: "{{ plat__region }}" |
173 | 174 | filters: |
| 175 | + vpc-id: "{{ plat__aws_vpc_id }}" |
174 | 176 | group-name: "{{ plat__security_group_default_name }}" |
175 | 177 | register: __aws_security_group_default_info |
176 | 178 |
|
|
0 commit comments