Debian Codegraph @

test/integration/targets/iptables/tasks/xt_comment.yml

raw
1 ---
2 # test code for the iptables module
3 # Copyright: (c) Contributors to the Ansible project
4 # Copyright: (c) 2021, Éloi Rivard <[email protected]>
5 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
6
7 - name: install xt_comment for iptables `-m comment` tests on RHEL 10
8 dnf:
9 name:
10 - kernel-modules-extra-{{ ansible_facts.kernel }}
11 state: present
12 exclude:
13 # prevent attempts to upgrade the kernel and install kernel modules for a non-running kernel version
14 - kernel-core
15 when: ansible_distribution == 'RedHat'
16
17 - name: Use iptables with unnecessary extension match
18 iptables:
19 chain: INPUT
20 source: 8.8.8.8
21 jump: DROP
22 match: comment
23 comment: Here to include an extension
24 register: unnecessary_extension
25
26 - name: Assert success
27 assert:
28 that:
29 - unnecessary_extension is success
30 - unnecessary_extension.rule.count('-m comment') == 1