Minimal support for EL 7.

This commit is contained in:
Andrea Dell'Amico 2020-08-11 20:05:29 +02:00
parent adce6d02ad
commit 89fdd609dd
2 changed files with 31 additions and 5 deletions

View File

@ -17,6 +17,9 @@ galaxy_info:
versions: versions:
- trusty - trusty
- bionic - bionic
- name: EL
versions:
- 7
galaxy_tags: galaxy_tags:
- python - python

View File

@ -6,19 +6,36 @@
when: when:
- py_env_install | bool - py_env_install | bool
- ansible_facts['distribution_version'] is version('16.04', '>=') - ansible_facts['distribution_version'] is version('16.04', '>=')
- ansible_distribution_file_variety == "Debian"
tags: [ "python", "py_env" ] 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: - block:
- name: Remove python deb packages - name: Remove python deb packages
apt: name={{ py_env_dpkg_toremove | default([]) }} state=absent 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" ] tags: [ "python", "py_env", "py_env_pkgs" ]
- block: - block:
- name: Install deb packages needed to compile the pip modules - 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 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 - name: Install a list of versioned pip packages
pip: name={{ item.pkg }} version={{ item.version }} pip: name={{ item.pkg }} version={{ item.version }}
with_items: '{{ py_env_versioned_pip_pkgs | default ([]) }}' with_items: '{{ py_env_versioned_pip_pkgs | default ([]) }}'
@ -26,9 +43,15 @@
- name: Install a list of pip packages - name: Install a list of pip packages
pip: name={{ py_env_pip_pkgs | default ([]) }} state=latest 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 when: py_env_install | bool
tags: [ "python", "py_env", "py_env_pkgs" ] 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" ]