2015-10-02 11:45:05 +02:00
|
|
|
---
|
2016-07-06 15:19:03 +02:00
|
|
|
- block:
|
|
|
|
- name: Install the python virtualenv packages
|
|
|
|
apt: name={{ item }} state={{ py_virtenv_pkgs_state }}
|
|
|
|
with_items: '{{ py_virtenv_pkgs }}'
|
2015-10-02 13:08:56 +02:00
|
|
|
|
2017-10-26 23:42:51 +02:00
|
|
|
# - name: Create the virtenv environments.
|
|
|
|
# command: virtualenv {{ py_virtenv_env_base_dir }}
|
2015-10-02 13:08:56 +02:00
|
|
|
|
2017-10-26 23:42:51 +02:00
|
|
|
- name: Install a list of pip packages inside the virtualenv, inherit the global site-packages if that is the choice
|
|
|
|
pip: name={{ item }} virtualenv={{ py_virtenv_env_base_dir }} virtualenv_site_packages={{ py_virtenv_site | default(False) }}
|
2016-07-06 15:19:03 +02:00
|
|
|
with_items: '{{ py_virtenv_pip_pkgs | default ([]) }}'
|
2015-10-02 13:08:56 +02:00
|
|
|
|
2016-07-06 15:19:03 +02:00
|
|
|
- name: Install a list of pip packages inside the virtualenv from a requirements.txt file, inherit the global site-packages
|
2017-10-26 23:42:51 +02:00
|
|
|
pip: requirements={{ py_virtenv_pip_requirements }} virtualenv={{ py_virtenv_env_base_dir }} virtualenv_site_packages={{ py_virtenv_site | default(False) }}
|
|
|
|
when: py_virtenv_pip_requirements is defined
|
2015-10-02 13:08:56 +02:00
|
|
|
|
2017-10-26 23:42:51 +02:00
|
|
|
when: py_virtenv_env_base_dir is defined
|
2016-07-06 15:19:03 +02:00
|
|
|
tags: [ "python", "py_virtenv" ]
|