I have this game in my indispensable play
- name: Setup virtualenv pip: requirements="/vagrant/webapp/requirements/{{ requirements_filename }}" virtualenv="$HOME/.envs/{{ project_name }}"
However, I get an error resolved by Permission. It seems that ansible is trying to install the package in the system path, not in virtualenv.
Here's the full trace:
TASK: [deploy | Setup virtualenv] ********************************************* failed: [default] => {"cmd": "/usr/bin/pip install -r /vagrant/webapp/requirements/dev.txt", "failed": true} msg: stdout: New python executable in /home/vagrant/.envs/venv/bin/python Installing setuptools, pip...done. Downloading/unpacking django>=1.8 (from -r /vagrant/webapp/requirements/requirements.txt (line 3)) Requirement already satisfied (use --upgrade to upgrade): wsgiref>=0.1.2 in /usr/lib/python2.7 (from -r /vagrant/webapp/requirements/requirements.txt (line 4)) Downloading/unpacking django-allauth>=0.19.1 (from -r /vagrant/webapp/requirements/requirements.txt (line 5)) Running setup.py (path:/tmp/pip_build_vagrant/django-allauth/setup.py) egg_info for package django-allauth Downloading/unpacking psycopg2>=2.6 (from -r /vagrant/webapp/requirements/requirements.txt (line 6)) Running setup.py (path:/tmp/pip_build_vagrant/psycopg2/setup.py) egg_info for package psycopg2 Downloading/unpacking django-currencies>=0.3.3 (from -r /vagrant/webapp/requirements/requirements.txt (line 7)) Downloading django-currencies-0.3.3.tar.gz Running setup.py (path:/tmp/pip_build_vagrant/django-currencies/setup.py) egg_info for package django-currencies Downloading/unpacking django-countries>=3.2 (from -r /vagrant/webapp/requirements/requirements.txt (line 8)) Running setup.py (path:/tmp/pip_build_vagrant/django-countries/setup.py) egg_info for package django-countries Downloading/unpacking stripe>=1.22.1 (from -r /vagrant/webapp/requirements/requirements.txt (line 9)) Running setup.py (path:/tmp/pip_build_vagrant/stripe/setup.py) egg_info for package stripe Downloading/unpacking pillow>=2.8.0 (from -r /vagrant/webapp/requirements/requirements.txt (line 10)) Running setup.py (path:/tmp/pip_build_vagrant/pillow/setup.py) egg_info for package pillow Single threaded build, not installing mp_compile: 1 processes warning: no files found matching 'LICENSE' under directory 'docs' Downloading/unpacking django-compressor>=1.4 (from -r /vagrant/webapp/requirements/requirements.txt (line 11)) Downloading/unpacking djangorestframework>=3.1.1 (from -r /vagrant/webapp/requirements/requirements.txt (line 12)) Downloading/unpacking django-filter>=0.9.2 (from -r /vagrant/webapp/requirements/requirements.txt (line 13)) Downloading django_filter-0.9.2-py2.py3-none-any.whl Obtaining formtools from git+https:
source share