1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-22 05:09:12 +00:00

[PR #11541/4cd91ba4 backport][stable-11] Fix templating bug in iptables_state tests (#11571)

Fix templating bug in iptables_state tests (#11541)

* Fix templating bug in iptables_state tests.

* Try to install older packages on RHEL.

(cherry picked from commit 4cd91ba4d4)

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
patchback[bot] 2026-03-11 22:15:49 +01:00 committed by GitHub
parent 543a292f4b
commit 8736ff46f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View file

@ -8,12 +8,21 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
- name: ensure iptables package is installed - name: ensure iptables package is installed (non-RHEL)
package: package:
name: name:
- iptables - iptables
become: true become: true
when: not (ansible_facts.distribution == 'RedHat' and ansible_facts.distribution_major_version|int >= 10)
- name: ensure iptables package is installed (RHEL 10+)
package:
name:
- "kernel-modules-extra-matched-{{ ansible_facts.kernel }}"
- "iptables-nft"
- "kernel-modules-extra-{{ ansible_facts.kernel }}"
become: true
when: ansible_facts.distribution == 'RedHat' and ansible_facts.distribution_major_version|int >= 10
- name: include tasks - name: include tasks
vars: vars:

View file

@ -272,7 +272,7 @@
assert: assert:
that: that:
- iptables_state is failed - iptables_state is failed
- "iptables_state.msg == 'Table mangle to restore not defined in {{ iptables_tests }}'" - "iptables_state.msg == ('Table mangle to restore not defined in ' ~ iptables_tests)"
success_msg: >- success_msg: >-
The previous error has been triggered by trying to restore a table The previous error has been triggered by trying to restore a table
that is missing in the file provided to iptables-restore. that is missing in the file provided to iptables-restore.