|
@@ -26,13 +26,15 @@
|
26
|
26
|
register: ufw_status
|
27
|
27
|
changed_when: False # never report as "changed"
|
28
|
28
|
|
29
|
|
-- name: Enable ufw
|
30
|
|
- command: ufw --force enable
|
31
|
|
- when: "ufw_status.stdout.startswith('Status: inactive')"
|
32
|
|
- register: ufw_enable
|
33
|
|
- # ignore error resulting from known bug on Debian 7
|
34
|
|
- failed_when: ufw_enable|failed and not ansible_lsb['codename'] == 'wheezy'
|
|
29
|
+- name: Check config of ufw
|
|
30
|
+ command: cat /etc/ufw/ufw.conf
|
|
31
|
+ register: ufw_config
|
|
32
|
+ changed_when: False # never report as "changed"
|
35
|
33
|
|
36
|
|
-- name: Enable ufw again (workaround for known bug in Debian 7)
|
|
34
|
+- name: Disable logging (workaround for known bug in Debian 7)
|
|
35
|
+ command: ufw logging off
|
|
36
|
+ when: "ansible_lsb['codename'] == 'wheezy' and 'LOGLEVEL=off' not in ufw_config.stdout"
|
|
37
|
+
|
|
38
|
+- name: Enable ufw
|
37
|
39
|
command: ufw --force enable
|
38
|
|
- when: "ufw_status.stdout.startswith('Status: inactive') and ansible_lsb['codename'] == 'wheezy'"
|
|
40
|
+ when: "ufw_status.stdout.startswith('Status: inactive') or 'ENABLED=yes' not in ufw_config.stdout"
|