Hacker News new | past | comments | ask | show | jobs | submit login

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




Yes, 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.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: