squid: don't fail when minifirewall is absent

This commit is contained in:
Jérémy Lecour 2017-01-13 09:05:32 +01:00 committed by Jérémy Lecour
parent 45a3e73947
commit 63c7123985

View file

@ -1,13 +1,11 @@
---
- name: verify that minifirewall is present
- name: Check if Minifirewall is present
stat:
path: /etc/default/minifirewall
register: minifirewall_test
- fail:
msg: "You must install and configure minifirewall to use Squid"
when: not minifirewall_test.stat.exists
- name: configure Minifirewall for Squid
block:
- name: HTTPSITES list is commented in minifirewall
replace:
dest: /etc/default/minifirewall
@ -20,7 +18,7 @@
line: "HTTPSITES='0.0.0.0/0'"
insertafter: "^#HTTPSITES="
- name: add minifirewall rules for the proxy
- name: add iptables rules for the proxy
lineinfile:
dest: /etc/default/minifirewall
regexp: "^#? *{{ item }}"
@ -37,3 +35,4 @@
dest: /etc/default/minifirewall
regexp: '^#.*(-t nat).*(-d X\.X\.X\.X)'
state: absent
when: minifirewall_test.stat.exists