How to run python setup.py develop command inside virtualenv using ansible

1,690 views
Skip to first unread message

Roman Dryndik

unread,
Jun 27, 2014, 6:08:18 AM6/27/14
to ansible...@googlegroups.com, rman-d...@rambler.ru

I want to execute python setup.py develop command inside of virtualenv using ansible.
How to do it?

Probably could be something like this:

    - name: egg
      shell
: "python setup.py develop"


But I need to execute it inside of virtualenv. How can I do it?

Michael Schultz

unread,
Jun 27, 2014, 8:31:40 AM6/27/14
to ansible...@googlegroups.com


On Jun 27, 2014 5:08 AM, "Roman Dryndik" <dryndi...@gmail.com> wrote:
> I want to execute python setup.py develop command inside of virtualenv using ansible.
> How to do it?
>
> Probably could be something like this:
>
>     - name: egg
>       shell: "python setup.py develop"

You can specify the path to the virtualenv's python, e.g.,

    shell: "/opt/venv/bin/python setup.py develop"

Or you could "source /opt/venv/bin/activate && python setup.py develop"

I usually have a var like virtualenv_path or virtualenv_python.

--michael

Reply all
Reply to author
Forward
0 new messages