Use ansible_facts
ansible_facts should be used instead of the injected vars Change-Id: I9e6e0a257d8abf844063b257b3d9026ec8c9ce6c
This commit is contained in:
parent
063f15ec2a
commit
41c93a403d
@ -19,7 +19,7 @@
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
become: true
|
||||
when: ansible_service_mgr == 'systemd'
|
||||
when: ansible_facts['service_mgr'] == 'systemd'
|
||||
|
||||
- name: Docker | reload docker
|
||||
service:
|
||||
|
@ -8,13 +8,13 @@
|
||||
set_fact:
|
||||
registry_pkg_manager: yum
|
||||
when:
|
||||
- ansible_os_family == 'RedHat'
|
||||
- ansible_distribution_major_version|int == 7
|
||||
- ansible_facts['os_family'] == 'RedHat'
|
||||
- ansible_facts['distribution_major_version']|int == 7
|
||||
|
||||
- name: set package manager to dnf
|
||||
set_fact:
|
||||
registry_pkg_manager: dnf
|
||||
when: (ansible_os_family == 'RedHat' and ansible_distribution_major_version|int > 7) or (ansible_distribution == 'Fedora')
|
||||
when: (ansible_facts['os_family'] == 'RedHat' and ansible_facts['distribution_major_version']|int > 7) or (ansible_facts['distribution'] == 'Fedora')
|
||||
|
||||
|
||||
- name: can docker be updated
|
||||
|
@ -59,7 +59,7 @@
|
||||
path: /etc/systemd/system/docker.service.d
|
||||
state: directory
|
||||
mode: '0755'
|
||||
when: ansible_service_mgr == 'systemd'
|
||||
when: ansible_facts['service_mgr'] == 'systemd'
|
||||
|
||||
- name: unset mountflags
|
||||
ini_file:
|
||||
@ -70,7 +70,7 @@
|
||||
create: yes
|
||||
mode: '0644'
|
||||
register: _cfg_flags
|
||||
when: ansible_service_mgr == 'systemd'
|
||||
when: ansible_facts['service_mgr'] == 'systemd'
|
||||
|
||||
- name: configure OPTIONS in /etc/sysconfig/docker
|
||||
lineinfile:
|
||||
@ -163,7 +163,7 @@
|
||||
daemon_reload: yes
|
||||
become: true
|
||||
when:
|
||||
- ansible_service_mgr == 'systemd'
|
||||
- ansible_facts['service_mgr'] == 'systemd'
|
||||
- _cfg_flags is changed
|
||||
|
||||
- name: Reload docker
|
||||
|
@ -1,8 +1,8 @@
|
||||
---
|
||||
- name: Install and Start Docker
|
||||
when:
|
||||
- ansible_distribution == "CentOS"
|
||||
- ansible_distribution_major_version|int < 8
|
||||
- ansible_facts['distribution'] == "CentOS"
|
||||
- ansible_facts['distribution_major_version']|int < 8
|
||||
become: true
|
||||
block:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user