It seems like it should be very simple:
tasks: - name: install python packages pip: name=${item} virtualenv=~/buildbot-env with_items: [ buildbot ] - name: create buildbot master command: buildbot create-master ~/buildbot creates=~/buildbot/buildbot.tac
However, the command will not be executed if the virtualenv script initiator is not found first, and there seems to be no need to do this in the Ansible command module .
I experimented with a search to activate a script in various .profile, .bashrc, .bash_login, etc. files, with no luck. Alternatively, there is a shell command, but it looks like an awkward hack:
- name: create buildbot master shell: source ~/buildbot-env/bin/activate && \ buildbot create-master ~/buildbot \ creates=~/buildbot/buildbot.tac executable=/bin/bash
Is there a better way?
virtualenv ansible
mikepurvis Nov 18 '13 at 4:33 2013-11-18 04:33
source share