From d16324d1f577f147ca13fea4931d591bd11c9cb9 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Tue, 4 Aug 2020 17:04:49 +0200 Subject: [PATCH] The python3 setup has its own role. --- library/roles/python3-env/defaults/main.yml | 26 ----------- library/roles/python3-env/tasks/main.yml | 52 --------------------- 2 files changed, 78 deletions(-) delete mode 100644 library/roles/python3-env/defaults/main.yml delete mode 100644 library/roles/python3-env/tasks/main.yml diff --git a/library/roles/python3-env/defaults/main.yml b/library/roles/python3-env/defaults/main.yml deleted file mode 100644 index ef5bdc44..00000000 --- a/library/roles/python3-env/defaults/main.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -py3_env_install: False -py3_ppa: 'ppa:deadsnakes/ppa' -py3_env_major_version: 3 -py3_env_minor_version: 6 -py3_env_version: '{{ py3_env_major_version }}.{{py3_env_minor_version }}' -py3_env_pkgs_state: present -py3_pip_pkgs_state: present -py3_env_site: False - -py3_env_basic_pkgs: - - python-pip - -py3_env_dpkg: - - 'python{{ py3_env_version }}' - - 'python{{ py3_env_version }}-venv' - - 'python{{ py3_env_version }}-dev' - -py3_env_pip_default_pkgs: - - 'pip' - - 'setuptools' - - 'wheel' -py3_env_wheel_pip_pkgs: [] -py3_env_pip_pkgs: [] -py3_env_versioned_pip_pkgs: [] - diff --git a/library/roles/python3-env/tasks/main.yml b/library/roles/python3-env/tasks/main.yml deleted file mode 100644 index 4697128b..00000000 --- a/library/roles/python3-env/tasks/main.yml +++ /dev/null @@ -1,52 +0,0 @@ ---- -- block: - - name: Install the python 3 ppa repository - apt_repository: repo={{ py3_ppa }} update_cache=yes state=present - - when: - - py3_env_install - - ansible_distribution_version is version_compare('18.04', '<') - tags: [ "python", "py3_env", "py3_env_pkgs", 'python3' ] - -- block: - - name: Install the python3 deb packages - apt: name={{ py3_env_dpkg }} state={{ py3_env_pkgs_state }} update_cache=yes cache_valid_time=600 - - - name: Install python3-pip deb packages - apt: name=python3-pip state={{ py3_env_pkgs_state }} update_cache=yes cache_valid_time=600 - when: ansible_distribution_version is version_compare('18.04', '>=') - - - name: Install the correct pip3 version on Ubuntu < 18.04 - shell: python{{ py3_env_version }} -m ensurepip && pip{{ py3_env_version }} install --upgrade pip setuptools wheel - when: ansible_distribution_version is version_compare('18.04', '<') - - - name: Install a list of versioned pip3 packages on Ubuntu older than Trusty - pip: executable=pip{{ py3_env_version }} name={{ item.pkg }} version={{ item.version }} - with_items: '{{ py3_env_versioned_pip_pkgs | default ([]) }}' - when: ansible_distribution_version is version_compare('18.04', '<') - - - name: Install a list of pip3 packages on Ubuntu older than Trusty - pip: executable=pip{{ py3_env_version }} name={{ py3_env_pip_pkgs }} state={{ py3_pip_pkgs_state }} - when: ansible_distribution_version is version_compare('18.04', '<') - - - name: Ensure that we have the latest pip, setuptools and wheel versions - pip: - executable: 'pip{{ py3_env_major_version }}' - name: '{{ py3_env_pip_default_pkgs }}' - state: latest - - - name: Install a list of binary pip3 packages in wheels format - pip: executable=pip{{ py3_env_major_version }} name={{ py3_env_wheel_pip_pkgs }} state={{ py3_pip_pkgs_state }} - - - name: Install a list of versioned pip3 packages on Ubuntu Bionic or newer - pip: executable=pip{{ py3_env_major_version }} name={{ item.pkg }} version={{ item.version }} - with_items: '{{ py3_env_versioned_pip_pkgs | default ([]) }}' - when: ansible_distribution_version is version_compare('18.04', '>=') - - - name: Install a list of pip3 packages on Ubuntu Bionic or newer - pip: executable=pip{{ py3_env_major_version }} name={{ py3_env_pip_pkgs }} state={{ py3_pip_pkgs_state }} - when: ansible_distribution_version is version_compare('18.04', '>=') - - when: py3_env_install - tags: [ "python", "py3_env", "py3_env_pkgs", 'python3' ] -