Browse Source

Use ansible_facts

ansible_facts should be used instead of the injected vars

Change-Id: I9e6e0a257d8abf844063b257b3d9026ec8c9ce6c
changes/10/776810/4 1.3.0
Alex Schultz 2 months ago
parent
commit
41c93a403d
4 changed files with 9 additions and 9 deletions
  1. +1
    -1
      handlers/main.yml
  2. +3
    -3
      tasks/docker-update.yml
  3. +3
    -3
      tasks/docker.yml
  4. +2
    -2
      tasks/install-engine.yml

+ 1
- 1
handlers/main.yml View File

@ -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:


+ 3
- 3
tasks/docker-update.yml View File

@ -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


+ 3
- 3
tasks/docker.yml View File

@ -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


+ 2
- 2
tasks/install-engine.yml View File

@ -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…
Cancel
Save