Skip to content

Commit dae93ab

Browse files
committed
Update orphan EBS volume purge to skip attached volumes
Add labels to EFS and EBS teardown Signed-off-by: Webster Mudge <[email protected]>
1 parent aab903c commit dae93ab

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

roles/infrastructure/tasks/teardown_aws_storage.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,18 @@
4343
loop: "{{ __infra_efs_fs.results | community.general.json_query('[*].efs') | flatten }}"
4444
loop_control:
4545
loop_var: __infra_efs_item
46+
label: "{{ __infra_efs_item.file_system_id }}"
4647

4748
- name: Remove Orphaned EBS Volumes during Purge
4849
when:
4950
- infra__force_teardown | bool
5051
- __infra_aws_ebs_vols is defined
5152
- __infra_aws_ebs_vols.volumes | length > 0
52-
- __infra_aws_ebs_item.attachment_set.status != ""
53+
- __infra_aws_ebs_item.attachment_set | length < 1
5354
amazon.aws.ec2_vol:
5455
id: "{{ __infra_aws_ebs_item.id }}"
5556
state: absent
5657
loop: "{{ __infra_aws_ebs_vols.volumes }}"
5758
loop_control:
58-
loop_var: __infra_aws_ebs_item
59+
loop_var: __infra_aws_ebs_item
60+
label: "{{ __infra_aws_ebs_item.id }}"

0 commit comments

Comments
 (0)