diff --git a/defaults/main.yaml b/defaults/main.yaml index a00a9cb..d860b9d 100644 --- a/defaults/main.yaml +++ b/defaults/main.yaml @@ -1,2 +1,2 @@ --- -docker_version: "20.10.9-3.el{{ansible_distribution_major_version}}" +docker_version: "20.10.9-3.el{{ansible_facts['distribution_major_version']}}" diff --git a/tasks/RedHat.yaml b/tasks/RedHat.yaml index f5a269a..48ad13b 100644 --- a/tasks/RedHat.yaml +++ b/tasks/RedHat.yaml @@ -30,21 +30,21 @@ state: present enablerepo: extras when: - - ansible_os_family == 'RedHat' - - ansible_distribution_major_version <= '7' + - ansible_facts['os_family'] == 'RedHat' + - ansible_facts['distribution_major_version'] <= '7' - name: Add Epel repo yum: name: epel-release state: present when: - - ansible_os_family == 'RedHat' - - ansible_distribution_major_version == '8' + - ansible_facts['os_family'] == 'RedHat' + - ansible_facts['distribution_major_version'] == '8' - name: Ensure python3-docker installed yum: name: python3-docker state: present when: - - ansible_os_family == 'RedHat' - - ansible_distribution_major_version == '8' + - ansible_facts['os_family'] == 'RedHat' + - ansible_facts['distribution_major_version'] == '8' diff --git a/tasks/main.yaml b/tasks/main.yaml index ab85353..aa059e5 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -1,3 +1,3 @@ --- - name: Include docker install - include_tasks: "{{ ansible_os_family }}.yaml" + include_tasks: "{{ ansible_facts['os_family'] }}.yaml"