Merge "Introduce iptables_package var"
This commit is contained in:
commit
13167d7a21
@ -1,2 +1,10 @@
|
||||
Configures the inventory private and public addresses in a multi-node job in
|
||||
iptables in order to allow traffic to and from each node without restrictions.
|
||||
Multinode firewall is configured.
|
||||
|
||||
This role is intended to install iptables and configure firewall.
|
||||
|
||||
**Role Variables**
|
||||
|
||||
.. zuul:rolevar:: iptables_package
|
||||
:default: iptables
|
||||
|
||||
Install the distribution package for Iptables.
|
||||
|
2
roles/multi-node-firewall/defaults/main.yaml
Normal file
2
roles/multi-node-firewall/defaults/main.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
iptables_package: "iptables"
|
@ -1,7 +1,16 @@
|
||||
- name: Ensure iptables
|
||||
- name: Include operating system specific vars
|
||||
include_vars: "{{ zj_distro_os }}"
|
||||
with_first_found:
|
||||
- "{{ ansible_distribution }}.yaml"
|
||||
- "{{ ansible_os_family }}.yaml"
|
||||
- "default.yaml"
|
||||
loop_control:
|
||||
loop_var: zj_distro_os
|
||||
|
||||
- name: 'Ensure {{ iptables_package }}'
|
||||
become: true
|
||||
package:
|
||||
name: iptables
|
||||
name: "{{ iptables_package }}"
|
||||
|
||||
- name: Set up the host ip addresses
|
||||
set_fact:
|
||||
|
7
roles/multi-node-firewall/vars/CentOS.yaml
Normal file
7
roles/multi-node-firewall/vars/CentOS.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
iptables_package: >-
|
||||
{% if ansible_distribution_major_version|int <= 8 -%}
|
||||
iptables
|
||||
{%- else -%}
|
||||
iptables-nft
|
||||
{%- endif %}
|
7
roles/multi-node-firewall/vars/Fedora.yaml
Normal file
7
roles/multi-node-firewall/vars/Fedora.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
iptables_package: >-
|
||||
{% if ansible_distribution_major_version|int <= 33 -%}
|
||||
iptables
|
||||
{%- else -%}
|
||||
iptables-nft
|
||||
{%- endif %}
|
7
roles/multi-node-firewall/vars/RedHat.yaml
Normal file
7
roles/multi-node-firewall/vars/RedHat.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
iptables_package: >-
|
||||
{% if ansible_distribution_major_version|int <= 8 -%}
|
||||
iptables
|
||||
{%- else -%}
|
||||
iptables-nft
|
||||
{%- endif %}
|
2
roles/multi-node-firewall/vars/default.yaml
Normal file
2
roles/multi-node-firewall/vars/default.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
---
|
||||
iptables_package: "iptables"
|
Loading…
Reference in New Issue
Block a user