Ansible create a virtualenv using the venv module

I ran into the same issue tonight and found that specifying the full path to the interpreter, including the arguments, worked for me (at least it does in ansible==2.2.2.0):

- pip:
     requirements: /website/requirements.txt
     virtualenv: /opt/website-venv
     virtualenv_command: /usr/bin/python3.6 -m venv

or

- pip:
    requirements: /opt/project/requirements_prod.txt
    virtualenv: /opt/.virtualenv/project_env
    virtualenv_python: python3

Leave a Comment

techhipbettruvabetnorabahisbahis forumu