Test for firewalld before configuring with it

This commit is contained in:
Jason Rothstein 2021-10-24 23:07:10 -05:00
parent 8e6874a645
commit 49442dfa6a
2 changed files with 9 additions and 7 deletions

View File

@ -102,6 +102,8 @@
- name: 'ensure firewall' - name: 'ensure firewall'
when: when:
- ansible_system == 'Linux' - ansible_system == 'Linux'
- packages["firewalld"] is defined
- packages["python3-firewall"] is defined
- ensure_apache is defined - ensure_apache is defined
- ensure_apache.firewall_list is defined - ensure_apache.firewall_list is defined
- ensure_apache.firewall_list is iterable - ensure_apache.firewall_list is iterable

View File

@ -3,13 +3,13 @@
package_list: package_list:
- name: 'httpd' - name: 'httpd'
state: 'present' state: 'present'
# firewall_list: firewall_list:
# - permanent: 'yes' - permanent: 'yes'
# service: 'http' service: 'http'
# state: 'enabled' state: 'enabled'
# - permanent: 'yes' - permanent: 'yes'
# service: 'https' service: 'https'
# state: 'enabled' state: 'enabled'
seboolean_list: seboolean_list:
- name: 'httpd_can_network_connect' - name: 'httpd_can_network_connect'
persistent: 'yes' persistent: 'yes'