From 89fdd609dd7513da1fe766444b53ba71dbf9c171 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 11 Aug 2020 20:05:29 +0200 Subject: [PATCH] Minimal support for EL 7. --- meta/main.yml | 3 +++ tasks/main.yml | 33 ++++++++++++++++++++++++++++----- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/meta/main.yml b/meta/main.yml index de42bc7..cbc5335 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -17,6 +17,9 @@ galaxy_info: versions: - trusty - bionic + - name: EL + versions: + - 7 galaxy_tags: - python diff --git a/tasks/main.yml b/tasks/main.yml index a721e86..25d2b94 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -6,19 +6,36 @@ when: - py_env_install | bool - ansible_facts['distribution_version'] is version('16.04', '>=') + - ansible_distribution_file_variety == "Debian" tags: [ "python", "py_env" ] - + +- block: + - name: Install python 2 pip on EL + yum: name=python2-pip state={{ py_env_pkgs_state }} + + when: + - py_env_install | bool + - ansible_distribution_file_variety == "RedHat" + tags: [ "python", "py_env" ] + - block: - name: Remove python deb packages apt: name={{ py_env_dpkg_toremove | default([]) }} state=absent - when: py_env_install | bool + when: + - py_env_install | bool + - ansible_distribution_file_variety == "Debian" tags: [ "python", "py_env", "py_env_pkgs" ] - block: - name: Install deb packages needed to compile the pip modules apt: name={{ py_pip_deps | default([]) }} state={{ py_env_pkgs_state }} update_cache=yes cache_valid_time=600 + when: + - py_env_install | bool + - ansible_distribution_file_variety == "Debian" + tags: [ "python", "py_env", "py_env_pkgs" ] +- block: - name: Install a list of versioned pip packages pip: name={{ item.pkg }} version={{ item.version }} with_items: '{{ py_env_versioned_pip_pkgs | default ([]) }}' @@ -26,9 +43,15 @@ - name: Install a list of pip packages pip: name={{ py_env_pip_pkgs | default ([]) }} state=latest - - name: Install python deb packages - apt: name={{ py_env_dpkg | default([]) }} state={{ py_env_pkgs_state }} update_cache=yes cache_valid_time=600 - when: py_env_install | bool tags: [ "python", "py_env", "py_env_pkgs" ] +- block: + - name: Install python deb packages + apt: name={{ py_env_dpkg | default([]) }} state={{ py_env_pkgs_state }} update_cache=yes cache_valid_time=600 + + when: + - py_env_install | bool + - ansible_distribution_file_variety == "Debian" + tags: [ "python", "py_env", "py_env_pkgs" ] +