|
|
|
@ -30,6 +30,7 @@
|
|
|
|
|
line: "# BEGIN ANSIBLE MANAGED BLOCK FOR IPS"
|
|
|
|
|
insertbefore: '^# Main interface'
|
|
|
|
|
create: no
|
|
|
|
|
when: not ansible_check_mode
|
|
|
|
|
|
|
|
|
|
- name: End marker for IP addresses
|
|
|
|
|
lineinfile:
|
|
|
|
@ -37,6 +38,7 @@
|
|
|
|
|
create: no
|
|
|
|
|
line: "# END ANSIBLE MANAGED BLOCK FOR IPS"
|
|
|
|
|
insertafter: '^PRIVILEGIEDIPS='
|
|
|
|
|
when: not ansible_check_mode
|
|
|
|
|
|
|
|
|
|
- name: Verify that at least 1 trusted IP is provided
|
|
|
|
|
assert:
|
|
|
|
@ -84,6 +86,7 @@
|
|
|
|
|
PRIVILEGIEDIPS='{{ minifirewall_privilegied_ips | join(' ') }}'
|
|
|
|
|
create: no
|
|
|
|
|
register: minifirewall_config_ips
|
|
|
|
|
when: not ansible_check_mode
|
|
|
|
|
|
|
|
|
|
- name: Begin marker for ports
|
|
|
|
|
lineinfile:
|
|
|
|
@ -91,6 +94,7 @@
|
|
|
|
|
line: "# BEGIN ANSIBLE MANAGED BLOCK FOR PORTS"
|
|
|
|
|
insertbefore: '^# Protected services'
|
|
|
|
|
create: no
|
|
|
|
|
when: not ansible_check_mode
|
|
|
|
|
|
|
|
|
|
- name: End marker for ports
|
|
|
|
|
lineinfile:
|
|
|
|
@ -98,6 +102,7 @@
|
|
|
|
|
line: "# END ANSIBLE MANAGED BLOCK FOR PORTS"
|
|
|
|
|
insertafter: '^SERVICESUDP3='
|
|
|
|
|
create: no
|
|
|
|
|
when: not ansible_check_mode
|
|
|
|
|
|
|
|
|
|
- name: Configure ports
|
|
|
|
|
blockinfile:
|
|
|
|
@ -122,6 +127,7 @@
|
|
|
|
|
SERVICESUDP3='{{ minifirewall_private_ports_udp | join(' ') }}'
|
|
|
|
|
create: no
|
|
|
|
|
register: minifirewall_config_ports
|
|
|
|
|
when: not ansible_check_mode
|
|
|
|
|
|
|
|
|
|
- name: Configure DNSSERVEURS
|
|
|
|
|
lineinfile:
|
|
|
|
@ -193,7 +199,9 @@
|
|
|
|
|
line: "PROXY='{{ minifirewall_proxy }}'"
|
|
|
|
|
regexp: "PROXY=('|\").*('|\")"
|
|
|
|
|
create: no
|
|
|
|
|
when: minifirewall_proxy is not none
|
|
|
|
|
when:
|
|
|
|
|
- minifirewall_proxy is not none
|
|
|
|
|
- not ansible_check_mode
|
|
|
|
|
|
|
|
|
|
- name: Configure PROXYPORT
|
|
|
|
|
lineinfile:
|
|
|
|
@ -201,7 +209,9 @@
|
|
|
|
|
line: "PROXYPORT='{{ minifirewall_proxyport }}'"
|
|
|
|
|
regexp: "PROXYPORT=('|\").*('|\")"
|
|
|
|
|
create: no
|
|
|
|
|
when: minifirewall_proxyport is not none
|
|
|
|
|
when:
|
|
|
|
|
- minifirewall_proxyport is not none
|
|
|
|
|
- not ansible_check_mode
|
|
|
|
|
|
|
|
|
|
# Warning: keep double quotes for the value,
|
|
|
|
|
# since we often reference a shell variable that needs to be interpolated
|
|
|
|
@ -211,7 +221,9 @@
|
|
|
|
|
line: "PROXYBYPASS=\"{{ minifirewall_proxybypass | join(' ') }}\""
|
|
|
|
|
regexp: "PROXYBYPASS=('|\").*('|\")"
|
|
|
|
|
create: no
|
|
|
|
|
when: minifirewall_proxybypass is not none
|
|
|
|
|
when:
|
|
|
|
|
- minifirewall_proxyport is not none
|
|
|
|
|
- not ansible_check_mode
|
|
|
|
|
|
|
|
|
|
- name: Configure BACKUPSERVERS
|
|
|
|
|
lineinfile:
|
|
|
|
@ -219,7 +231,9 @@
|
|
|
|
|
line: "BACKUPSERVERS='{{ minifirewall_backupservers | join(' ') }}'"
|
|
|
|
|
regexp: "BACKUPSERVERS=('|\").*('|\")"
|
|
|
|
|
create: no
|
|
|
|
|
when: minifirewall_backupservers is not none
|
|
|
|
|
when:
|
|
|
|
|
- minifirewall_backupservers is not none
|
|
|
|
|
- not ansible_check_mode
|
|
|
|
|
|
|
|
|
|
- name: Configure SYSCTL_ICMP_ECHO_IGNORE_BROADCASTS
|
|
|
|
|
lineinfile:
|
|
|
|
|