running commands inside a remote virtual environment

125 views
Skip to first unread message

Fenrir Sivar

unread,
Sep 16, 2022, 2:28:18 AM9/16/22
to Ansible Project
I would like to run a shell command using a python virtual environment on a remote server.
(collecting static files for a django project)
However, how do I activate a remote virtual environment in a task?

Best Fen

Dick Visser

unread,
Sep 16, 2022, 3:04:16 AM9/16/22
to ansible...@googlegroups.com
I usually use the python from that venv explicitly in my command, for example:

/opt/venv/bin/python3 /some/script.py





--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a08620f5-1aed-4b6d-a61b-a02c9539d265n%40googlegroups.com.
--
Sent from Gmail Mobile
Reply all
Reply to author
Forward
0 new messages