Browse Source

Merge pull request #76 from ariddell/feature/ufw-error-fix

Ignore ufw error resulting from known bug on Debian 7
Alex Payne 11 years ago
parent
commit
f64ad69950
2 changed files with 8 additions and 1 deletions
  1. 7
    0
      roles/common/tasks/ufw.yml
  2. 1
    1
      site.yml

+ 7
- 0
roles/common/tasks/ufw.yml View File

29
 - name: Enable ufw
29
 - name: Enable ufw
30
   command: ufw --force enable
30
   command: ufw --force enable
31
   when: "ufw_status.stdout.startswith('Status: inactive')"
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'
35
+
36
+- name: Enable ufw again (workaround for known bug in Debian 7)
37
+  command: ufw --force enable
38
+  when: "ufw_status.stdout.startswith('Status: inactive') and ansible_lsb['codename'] == 'wheezy'"

+ 1
- 1
site.yml View File

4
 - hosts: all
4
 - hosts: all
5
   user: deploy
5
   user: deploy
6
   sudo: True
6
   sudo: True
7
-  gather_facts: False
7
+  gather_facts: True
8
   vars_files:
8
   vars_files:
9
     - vars/defaults.yml
9
     - vars/defaults.yml
10
     - vars/user.yml
10
     - vars/user.yml

Loading…
Cancel
Save