From 080746e32a3b2365fa2ae066244ac26742b7a7c6 Mon Sep 17 00:00:00 2001 From: fgierlinger <2966031+fgierlinger@users.noreply.github.com> Date: Fri, 24 Apr 2020 18:46:45 +0200 Subject: [PATCH] Include OS specific variables The package naming for pip has changed in centos8. Previously the pip package was called python-pip for python2 and python3-pip for python3. In CentOS 8 the packages are now called python2-pip for python2 ad python3-pip for python3. --- tasks/main.yml | 7 +++++++ vars/CentOS-8.yml | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 vars/CentOS-8.yml diff --git a/tasks/main.yml b/tasks/main.yml index dda7fac..e4de8c7 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,4 +1,11 @@ --- +- name: Gather OS specific variables. + include_vars: "{{ item }}" + with_first_found: + - "vars/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" + - "vars/{{ ansible_distribution }}.yml" + - "defaults/main.yml" + - name: Ensure Pip is installed. package: name: "{{ pip_package }}" diff --git a/vars/CentOS-8.yml b/vars/CentOS-8.yml new file mode 100644 index 0000000..2f63896 --- /dev/null +++ b/vars/CentOS-8.yml @@ -0,0 +1,2 @@ +--- +pip_package: python3-pip