Debian Codegraph @

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

raw
1 ---
2 - name: Setup Rule Groups for later use
3 block:
4 # The simplest form of rule group
5 - name: 'Create Rule Groups with minimal settings (Default order)'
6 networkfirewall_rule_group:
7 name: '{{ default_group_name }}-{{ item }}'
8 type: 'stateful'
9 capacity: '{{ rule_group_capacity }}'
10 rule_strings:
11 - 'pass tcp any any -> any any (sid:1000001;)'
12 register: default_groups
13 loop: '{{ range(1,4,1) | list }}'
14
15 # The simplest form of rule group
16 - name: 'Create Rule Groups with minimal settings (Strict order)'
17 networkfirewall_rule_group:
18 name: '{{ strict_group_name }}-{{ item }}'
19 type: 'stateful'
20 capacity: '{{ rule_group_capacity }}'
21 rule_strings:
22 - 'pass tcp any any -> any any (sid:1000001;)'
23 rule_order: strict
24 register: strict_groups
25 loop: '{{ range(1,4,1) | list }}'
26
27 - debug:
28 var: default_groups
29
30 # Store Group Names and ARNs for later
31 - set_fact:
32 default_group_names: >-
33 {{ default_groups.results
34 | map(attribute="rule_group")
35 | map(attribute="rule_group_metadata")
36 | map(attribute="rule_group_name") | list }}
37 default_group_arns: >-
38 {{ default_groups.results
39 | map(attribute="rule_group")
40 | map(attribute="rule_group_metadata")
41 | map(attribute="rule_group_arn") | list }}
42 strict_group_names: >-
43 {{ strict_groups.results
44 | map(attribute="rule_group")
45 | map(attribute="rule_group_metadata")
46 | map(attribute="rule_group_name") | list }}
47 strict_group_arns: >-
48 {{ strict_groups.results
49 | map(attribute="rule_group")
50 | map(attribute="rule_group_metadata")
51 | map(attribute="rule_group_arn") | list }}