|
3 | 3 | apt:
|
4 | 4 | update_cache: yes
|
5 | 5 | become: True
|
6 |
| - when: ansible_os_family == 'Debian' |
| 6 | + when: ansible_facts.os_family == 'Debian' |
7 | 7 |
|
8 | 8 | # TODO(inc0): Gates don't seem to have ufw executable, check for it instead of ignore errors
|
9 | 9 | - name: Set firewall default policy
|
10 | 10 | become: True
|
11 | 11 | ufw:
|
12 | 12 | state: disabled
|
13 | 13 | policy: allow
|
14 |
| - when: ansible_os_family == 'Debian' |
| 14 | + when: ansible_facts.os_family == 'Debian' |
15 | 15 | ignore_errors: yes
|
16 | 16 |
|
17 | 17 | - name: Check if firewalld is installed
|
|
21 | 21 | failed_when: firewalld_check.rc > 1
|
22 | 22 | args:
|
23 | 23 | warn: false
|
24 |
| - when: ansible_os_family == 'RedHat' |
| 24 | + when: ansible_facts.os_family == 'RedHat' |
25 | 25 |
|
26 | 26 | - name: Disable firewalld
|
27 | 27 | become: True
|
|
32 | 32 | with_items:
|
33 | 33 | - firewalld
|
34 | 34 | when:
|
35 |
| - - ansible_os_family == 'RedHat' |
| 35 | + - ansible_facts.os_family == 'RedHat' |
36 | 36 | - firewalld_check.rc == 0
|
37 | 37 |
|
38 | 38 | # Upgrading docker engine may cause containers to stop. Take a snapshot of the
|
|
63 | 63 | state: link
|
64 | 64 | become: true
|
65 | 65 | when:
|
66 |
| - - ansible_os_family == 'Debian' |
| 66 | + - ansible_facts.os_family == 'Debian' |
67 | 67 | - not docker_unit_file.stat.exists
|
68 | 68 |
|
69 | 69 | - name: Install apt packages
|
70 | 70 | package:
|
71 | 71 | name: "{{ (debian_pkg_install | join(' ')).split() }}"
|
72 | 72 | state: present
|
73 | 73 | become: True
|
74 |
| - when: ansible_os_family == 'Debian' |
| 74 | + when: ansible_facts.os_family == 'Debian' |
75 | 75 | register: apt_install_result
|
76 | 76 |
|
77 | 77 | - name: Install deltarpm packages
|
|
80 | 80 | state: present
|
81 | 81 | update_cache: yes
|
82 | 82 | become: True
|
83 |
| - when: ansible_os_family == 'RedHat' |
| 83 | + when: ansible_facts.os_family == 'RedHat' |
84 | 84 |
|
85 | 85 | - name: Install RPM packages
|
86 | 86 | package:
|
87 | 87 | name: "{{ (redhat_pkg_install | join(' ')).split() }}"
|
88 | 88 | state: present
|
89 | 89 | update_cache: yes
|
90 | 90 | become: True
|
91 |
| - when: ansible_os_family == 'RedHat' |
| 91 | + when: ansible_facts.os_family == 'RedHat' |
92 | 92 | register: rpm_install_result
|
93 | 93 |
|
94 | 94 | # If any packages were updated, and any containers were running, wait for the
|
|
122 | 122 | - running_containers.rc == 0
|
123 | 123 | - running_containers.stdout != ''
|
124 | 124 | vars:
|
125 |
| - install_result: "{{ rpm_install_result if ansible_os_family == 'RedHat' else apt_install_result }}" |
| 125 | + install_result: "{{ rpm_install_result if ansible_facts.os_family == 'RedHat' else apt_install_result }}" |
126 | 126 |
|
127 | 127 | - name: Install latest pip in the virtualenv
|
128 | 128 | pip:
|
|
150 | 150 | name: "{{ (ubuntu_pkg_removals | join(' ')).split() }}"
|
151 | 151 | state: absent
|
152 | 152 | become: True
|
153 |
| - when: ansible_os_family == 'Debian' |
| 153 | + when: ansible_facts.os_family == 'Debian' |
154 | 154 |
|
155 | 155 | - name: Remove packages
|
156 | 156 | package:
|
157 | 157 | name: "{{ (redhat_pkg_removals | join(' ')).split() }}"
|
158 | 158 | state: absent
|
159 | 159 | become: True
|
160 |
| - when: ansible_os_family == 'RedHat' |
| 160 | + when: ansible_facts.os_family == 'RedHat' |
0 commit comments