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

42 lines
1.3 KiB
YAML

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