python-env role: Add a task that permits to install specific versions of pip packages.

This commit is contained in:
Andrea Dell'Amico 2017-09-02 17:15:03 +02:00
parent b6e4b89965
commit 9a779358c4
1 changed files with 13 additions and 19 deletions

View File

@ -12,20 +12,6 @@
apt: name={{ item }} state={{ py_env_pkgs_state }} update_cache=yes cache_valid_time=600 apt: name={{ item }} state={{ py_env_pkgs_state }} update_cache=yes cache_valid_time=600
with_items: '{{ py_pip_deps | default([]) }}' with_items: '{{ py_pip_deps | default([]) }}'
- name: Fix the ssl warnings installing some ssl libraries
pip: name={{ item }}
with_items: '{{ py_env_pip_fix_ssl_warnings | default ([]) }}'
when:
- not py_env_trusty_workaround
- is_trusty
- name: Install a list of pip packages
pip: name={{ item }}
with_items: '{{ py_env_pip_pkgs | default ([]) }}'
when:
- not py_env_trusty_workaround
- is_trusty
when: py_env_install when: py_env_install
tags: [ "python", "py_env" ] tags: [ "python", "py_env" ]
@ -51,6 +37,13 @@
- name: Install setuptools version 33.1.1 - name: Install setuptools version 33.1.1
pip: name=setuptools version=33.1.1 state=present pip: name=setuptools version=33.1.1 state=present
when:
- py_env_trusty_workaround
- py_env_install
- is_trusty
tags: [ "python", "py_env" ]
- block:
- name: Fix the ssl warnings installing some ssl libraries - name: Fix the ssl warnings installing some ssl libraries
pip: name={{ item }} pip: name={{ item }}
with_items: '{{ py_env_pip_fix_ssl_warnings | default ([]) }}' with_items: '{{ py_env_pip_fix_ssl_warnings | default ([]) }}'
@ -59,8 +52,9 @@
pip: name={{ item }} pip: name={{ item }}
with_items: '{{ py_env_pip_pkgs | default ([]) }}' with_items: '{{ py_env_pip_pkgs | default ([]) }}'
when: - name: Install a list of versioned pip packages
- py_env_trusty_workaround pip: name={{ item.pkg }} version={{ item.version }}
- py_env_install with_items: '{{ py_env_versioned_pip_pkgs | default ([]) }}'
- is_trusty
tags: [ "python", "py_env" ] when: py_env_install
tags: [ "python", "py_env", "py_env_pkgs" ]