2022-11-18 18:33:37 +01:00
|
|
|
---
|
|
|
|
# tasks file for iptables-webserver
|
|
|
|
|
|
|
|
- name: Setup iptables for webserver 80 and 443
|
|
|
|
when:
|
|
|
|
- "is_docker is not true"
|
|
|
|
- "iptables_webserver_enabled is true"
|
|
|
|
block:
|
|
|
|
- name: Allow new, established packets on TCP ports 80/443 (Webserver)
|
|
|
|
ansible.builtin.iptables:
|
|
|
|
chain: INPUT
|
|
|
|
protocol: tcp
|
2022-11-19 11:48:56 +01:00
|
|
|
destination_port: "{{ item }}"
|
2022-11-18 18:33:37 +01:00
|
|
|
ctstate: NEW,ESTABLISHED
|
|
|
|
jump: ACCEPT
|
|
|
|
comment: Webserver dedicated port
|
|
|
|
loop: "{{ iptables_webserver_ports }}"
|
|
|
|
|
|
|
|
- name: iptables-persistent
|
|
|
|
ansible.builtin.include_role:
|
|
|
|
name: iptables-persistent
|