3 ms·
Have you figured out how to use ansible with virtualenv and Django? - create virtual env - activate and install pip packages - run command using that environ
by kbrannigan 4y ago
Have you figured out how to use ansible with virtualenv and Django?
- create virtual env
- activate and install pip packages
- run command using that environment
- GorsyGentle 4y agoYes, this is 100% possible with the core ansible toolkit. I don't have a copy of any of our playbooks on this as I'm at home and it's late. But it's basically just a couple of tasks. Check out `ansible.builtin.pip` to setup and install the virtualenv and then just call `ansible.builtin.command` to run it explicitly. Implicit use of the venv can be accomplished via common task argument `env` which also lets one fiddle with PATH.