title: Ansible command from inside virtualenv?
body: <p>This seems like it should be really simple:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>However, the command will not succeed unless the virtualenv's activate script is sourced first, and there doesn't seem to be provision to do that in the <a href="http://www.ansibleworks.com/docs/modules.html#command">Ansible command module</a>.</p>
  
  <p>I've experimented with sourcing the activate script in various of .profile, .bashrc, .bash_login, etc, with no luck. Alternatively, there's the shell command, but it seems like kind of an awkward hack:</p>
  
  <pre><code>- name: create buildbot master
    shell: source ~/buildbot-env/bin/activate &amp;&amp; \
           buildbot create-master ~/buildbot \
           creates=~/buildbot/buildbot.tac executable=/bin/bash
  </code></pre>
  
  <p>Is there a better way?</p>