|
70 | 70 | retries: 120 |
71 | 71 | delay: 10 |
72 | 72 |
|
| 73 | + - name: Remove discovered AWS NAT Gateways |
| 74 | + register: __infra_aws_nat_remove_result |
| 75 | + when: |
| 76 | + - __infra_aws_nat_gateways is defined |
| 77 | + - __infra_aws_nat_gateways.result is defined |
| 78 | + - __infra_aws_nat_gateways.result | length > 0 |
| 79 | + community.aws.ec2_vpc_nat_gateway: |
| 80 | + state: absent |
| 81 | + region: "{{ infra__region }}" |
| 82 | + wait: true |
| 83 | + nat_gateway_id: "{{ __infra_nat_gateway_remove_item.nat_gateway_id }}" |
| 84 | + release_eip: true |
| 85 | + loop_control: |
| 86 | + label: "{{ __infra_nat_gateway_remove_item.nat_gateway_id }}" |
| 87 | + loop_var: __infra_nat_gateway_remove_item |
| 88 | + loop: "{{ __infra_aws_nat_gateways.result }}" |
| 89 | + failed_when: |
| 90 | + - "'rc' in __infra_aws_nat_remove_result" |
| 91 | + - __infra_aws_nat_remove_result.rc != 0 |
| 92 | + - "'InvalidAllocationID.NotFound' not in __infra_aws_nat_remove_result.module_stderr" |
| 93 | + |
73 | 94 | - name: Remove discovered AWS Network Adapters |
74 | 95 | when: |
75 | 96 | - __infra_vpc_enis is defined |
|
115 | 136 | label: "{{ __security_group_purge_item.group_name }}" |
116 | 137 | loop: "{{ __infra_aws_sgs.security_groups }}" |
117 | 138 |
|
118 | | - - name: Remove discovered AWS NAT Gateways |
119 | | - register: __infra_aws_nat_remove_result |
120 | | - when: |
121 | | - - __infra_aws_nat_gateways is defined |
122 | | - - __infra_aws_nat_gateways.result is defined |
123 | | - - __infra_aws_nat_gateways.result | length > 0 |
124 | | - community.aws.ec2_vpc_nat_gateway: |
125 | | - state: absent |
126 | | - region: "{{ infra__region }}" |
127 | | - wait: true |
128 | | - nat_gateway_id: "{{ __infra_nat_gateway_remove_item.nat_gateway_id }}" |
129 | | - release_eip: true |
130 | | - loop_control: |
131 | | - label: "{{ __infra_nat_gateway_remove_item.nat_gateway_id }}" |
132 | | - loop_var: __infra_nat_gateway_remove_item |
133 | | - loop: "{{ __infra_aws_nat_gateways.result }}" |
134 | | - failed_when: __infra_aws_nat_remove_result.rc != 0 and 'InvalidAllocationID.NotFound' not in __infra_aws_nat_remove_result.module_stderr |
135 | | - |
136 | 139 | - name: Remove discovered AWS VPC Subnets |
137 | 140 | when: |
138 | 141 | - __infra_disc_subnet_cidrs is defined |
|
0 commit comments