Unable to run docker compose in an ansible playbook : <p>I appear to be unable to run docker compose tasks in an ansible playbook. I get stuck in a loop. </p>

<p>The first error I get when running <code>sudo ansible-playbook playbook.yml</code> is the following</p>

<pre><code>fatal: [10.0.3.5]: FAILED! =&gt; {"changed": false, "msg": "Unable to load docker-compose. Try `pip install docker-compose`. Error: No module named compose"}
</code></pre>

<p>so I remote to that machine and did <code>sudo pip install docker-compose</code> and try running the playbook again. This time I get...</p>

<pre><code>fatal: [10.0.3.5]: FAILED! =&gt; {"changed": false, "msg": "Cannot have both the docker-py and docker python modules installed together as they use the same namespace and cause a corrupt installation. Please uninstall both packages, and re-install only the docker-py or docker python module"}
</code></pre>

<p>so I try uninstalling docker python...</p>

<ul>
<li><code>sudo uninstall docker python</code></li>
</ul>

<p>Then I get the following when attempting to run the playbook again</p>

<pre><code>fatal: [10.0.3.5]: FAILED! =&gt; {"changed": false, "msg": "Failed to import docker-py - No module named docker. Try `pip install docker-py`"}
</code></pre>

<p>However this is already install on the machine, as when I run <code>sudo pip install docker-py</code> I see the following...</p>

<pre><code>Requirement already satisfied (use --upgrade to upgrade): docker-py in /usr/local/lib/python2.7/dist-packages
Cleaning up...
</code></pre>

<p>Does anyone know how to escape this loop and successfully get an ansible playbook that uses docker-compose to run?</p>

<p>The machine os is <strong>linux 14.04</strong></p>

<p>Thanks,</p>
