Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/iptables_state/tasks/main.yml

raw
1 ---
2 ####################################################################
3 # WARNING: These are designed specifically for Ansible tests #
4 # and should not be used as examples of how to write Ansible roles #
5 ####################################################################
6
7 # Copyright (c) Ansible Project
8 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
9 # SPDX-License-Identifier: GPL-3.0-or-later
10
11 - name: ensure iptables package is installed (non-RHEL)
12 package:
13 name:
14 - iptables
15 become: true
16 when: not (ansible_facts.distribution == 'RedHat' and ansible_facts.distribution_major_version|int >= 10)
17
18 - name: ensure iptables package is installed (RHEL 10+)
19 package:
20 name:
21 - "kernel-modules-extra-matched-{{ ansible_facts.kernel }}"
22 - "iptables-nft"
23 - "kernel-modules-extra-{{ ansible_facts.kernel }}"
24 become: true
25 when: ansible_facts.distribution == 'RedHat' and ansible_facts.distribution_major_version|int >= 10
26
27 - name: include tasks
28 vars:
29 iptables_saved: "/tmp/test_iptables_state.saved"
30 iptables_tests: "/tmp/test_iptables_state.tests"
31
32 block:
33 - name: include tasks to perform basic tests (check_mode, async, idempotency)
34 include_tasks: tests/00-basic.yml
35
36 - name: include tasks to test tables handling
37 include_tasks: tests/01-tables.yml
38 when:
39 - xtables_lock is undefined
40
41 - name: include tasks to test partial restore files
42 include_tasks: tests/02-partial-restore.yml
43 when:
44 - xtables_lock is undefined
45
46
47 - name: include tasks to test rollbacks
48 include_tasks: tests/10-rollback.yml
49 when:
50 - xtables_lock is undefined
51 - ansible_connection in ['ssh', 'paramiko', 'smart']
52
53 become: true