mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-21 20:59:10 +00:00
Fix templating bug in iptables_state tests (#11541)
* Fix templating bug in iptables_state tests. * Try to install older packages on RHEL.
This commit is contained in:
parent
9b72d95452
commit
4cd91ba4d4
2 changed files with 11 additions and 2 deletions
|
|
@ -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:
|
||||||
|
|
|
||||||
|
|
@ -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.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue