This seems like it should be really simple:
tasks:
- name: install python packages
pip: name=${item} virtualenv=~/buildbot-env
with_items: [ buildbot ]
- nam
As I commented above, I create a script, say it is called buildbot.sh
:
source ~/buildbot-env/bin/activate
buildbot create-master [and more stuff]
Then run it on the remote with a task like this:
- name: Create buildbot master
script: buildbot.sh
To me this still seems unneccessary, but it maybe cleaner than running it in a shell command. Your playbook looks cleaner at the cost of not seeing immediately what the script does.
At least some modules do seem to use virtualenv, as both django_manage
and rax_clb
already have an inbuilt virtualenv parameter. It may not be such a big step for Ansible to include a command-in-virtenv sort of module.