library/roles/python-env: Simple role to manage the pip and deb pkgs python modules installation.

This commit is contained in:
Andrea Dell'Amico 2016-07-06 14:35:38 +02:00
parent a4159b2769
commit 38b332ae2a
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,11 @@
---
py_env_pkgs_state: installed
py_env_site: False
py_env_basic_pkgs:
- python-pip
py_env_dpkg:
py_pip_deps:
py_env_pip_pkgs:

21
python-env/tasks/main.yml Normal file
View File

@ -0,0 +1,21 @@
---
- name: Install python pip
apt: name={{ item }} state={{ py_env_pkgs_state }}
with_items: py_env_basic_pkgs
tags: [ "python", "py_env" ]
- name: Install python deb packages
apt: name={{ item }} state={{ py_env_pkgs_state }}
with_items: '{{ py_env_dpkg | default([]) }}'
tags: [ "python", "py_env" ]
- name: Install deb packages needed to compile the pip modules
apt: name={{ item }} state={{ py_env_pkgs_state }}
with_items: '{{ py_pip_deps | default([]) }}'
tags: [ "python", "py_env" ]
- name: Install a list of pip packages
pip: name={{ item }} virtualenv={{ py_env_env_base_dir }}
with_items: '{{ py_env_pip_pkgs | default ()[] }}'
tags: [ "python", "py_env" ]