Debian Codegraph @

ansible_collections/community/aws/tests/integration/targets/networkfirewall_policy/tasks/cleanup.yml

raw
1 ---
2 - name: 'Fetch all policies'
3 networkfirewall_policy_info: {}
4 register: account_policies_info
5 ignore_errors: true
6
7 - name: 'Get a list of all rules matching {{ policy_name_prefix }}'
8 set_fact:
9 matching_policies: '{{ account_policies_info.policy_list | select("search", policy_name_prefix) | list }}'
10 ignore_errors: true
11
12 # These should just be "no-ops" caused by the deletion being in-progress.
13 # Waiters are not supported at this time.
14 - name: 'Delete matching policies'
15 networkfirewall_policy:
16 arn: '{{ item }}'
17 state: absent
18 ignore_errors: true
19 loop: '{{ matching_policies }}'
20
21 ###
22
23 - name: 'Fetch all account rule groups'
24 networkfirewall_rule_group_info: {}
25 register: account_rules_info
26 ignore_errors: true
27
28 - name: 'Get a list of all rules matching {{ group_name_prefix }}'
29 set_fact:
30 matching_rules: '{{ account_rules_info.rule_list | select("search", group_name_prefix) | list }}'
31 ignore_errors: true
32
33 # These should just be "no-ops" caused by the deletion being in-progress.
34 # Waiters are not supported at this time.
35 - name: 'Delete matching rule groups'
36 networkfirewall_rule_group:
37 arn: '{{ item }}'
38 state: absent
39 ignore_errors: true
40 loop: '{{ matching_rules }}'