瀏覽代碼

Ignore ufw error resulting from known bug on Debian 7

In order to check the version of the linux distribution we need to
set `gather_facts` to True.

Closes #73.
Allen Riddell 10 年之前
父節點
當前提交
ae0d1ca8f4
共有 2 個檔案被更改,包括 4 行新增1 行删除
  1. 3
    0
      roles/common/tasks/ufw.yml
  2. 1
    1
      site.yml

+ 3
- 0
roles/common/tasks/ufw.yml 查看文件

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.0
34
+  failed_when: ufw_enable|failed and not ansible_lsb['codename'] == 'wheezy'

+ 1
- 1
site.yml 查看文件

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…
取消
儲存