ansible-roles/library/roles/python-env/tasks/main.yml

37 lines
1.1 KiB
YAML

---
- block:
- name: Install python pip
apt: name={{ py_env_basic_pkgs | default([]) }} state={{ py_env_pkgs_state }} update_cache=yes cache_valid_time=600
when:
- py_env_install
- is_not_trusty
tags: [ "python", "py_env" ]
- block:
- name: Remove python deb packages
apt: name={{ py_env_dpkg_toremove | default([]) }} state=absent
when:
- py_env_install
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
- 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
- name: Install a list of pip packages
pip: name={{ py_env_pip_pkgs | default ([]) }} state=latest
- name: Install a list of versioned pip packages
pip: name={{ item.pkg }} version={{ item.version }}
with_items: '{{ py_env_versioned_pip_pkgs | default ([]) }}'
when:
- py_env_install
tags: [ "python", "py_env", "py_env_pkgs" ]