Ansible role which setup Python virtual environment.
- Install and setup VirtualEnvWrapper.
- Setup venv for specific user.
The role variables and default values.
venv_enable: true # Enable the role
venv_wrapper: '/usr/local/bin/virtualenvwrapper.sh'
venv_python: python
venv_workon_home: '/var/www/.venvs'
venv_user: '{{ deploy_user }}'
venv_user_config: '~/.bashrc'
venv_project_dir: '{{ deploy_src_dir }}'
venv_name: '{{ deploy_app_name }}'
- Clone dependencies.
- Add
venv
to your roles and change variables in your playbook file.
Example:
- hosts: all
sudo: yes
roles:
- Stouts.deploy
- Stouts.python
- venv
Licensed under the MIT License. See the LICENSE file for details.