add generic iptables task
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2019-07-19 20:56:09 +02:00
parent fc57cb72bd
commit 93f7018f5c
2 changed files with 12 additions and 6 deletions

View File

@ -43,9 +43,12 @@ nginx_gzip_types:
- application/xml
nginx_iptables_enabled: False
nginx_open_ports:
- 80
- 443
nginx_iptables_rules_default:
- name: allow_nginx_ports
rules: |
-A INPUT -p tcp -m multiport --dports 80,443 -j ACCEPT
state: present
nginx_iptables_rules_extra: []
nginx_tls_enabled: False
nginx_tls_versions:

View File

@ -78,9 +78,12 @@
- name: Open ports in iptables
iptables_raw:
name: allow_nginx_ports
state: present
rules: '-A INPUT -p tcp -m multiport --dports {{ nginx_open_ports | join(",") }} -j ACCEPT'
name: "{{ item.name }}"
rules: "{{ item.rules }}"
state: "{{ item.state }}"
weight: "{{ item.weight | default(omit) }}"
table: "{{ item.table | default(omit) }}"
loop: "{{ nginx_iptables_rules_default + nginx_iptables_rules_extra }}"
when: nginx_iptables_enabled | bool
- name: Set selinux booleans