<p dir="auto">From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/maciej/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/maciej">@maciej</a> on 2016-11-07T17:28:08Z</p>

<h5 dir="auto">ISSUE TYPE</h5>

<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>

<p dir="auto">docker_container</p>
<h5 dir="auto">ANSIBLE VERSION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.2.0.0
  config file = [redacted]/ansible.cfg
  configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">ansible 2.2.0.0
  config file = [redacted]/ansible.cfg
  configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[defaults]
host_key_checking=False"><pre class="notranslate"><code class="notranslate">[defaults]
host_key_checking=False
</code></pre></div>
<h5 dir="auto">OS / ENVIRONMENT</h5>

<p dir="auto">Running ansible from: macOS Sierra<br>
Provisioning: CentOS 7.2, Docker installed from <a href="https://yum.dockerproject.org/repo/main/centos/7" rel="nofollow">https://yum.dockerproject.org/repo/main/centos/7</a></p>
<h5 dir="auto">SUMMARY</h5>

<p dir="auto"><code class="notranslate">docker_container</code> module fails with:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fatal: [default]: FAILED! =&gt; {&quot;changed&quot;: false, &quot;failed&quot;: true, &quot;msg&quot;: &quot;Error pulling image httpd:latest - pull() got an unexpected keyword argument 'decode'&quot;}"><pre class="notranslate"><code class="notranslate">fatal: [default]: FAILED! =&gt; {"changed": false, "failed": true, "msg": "Error pulling image httpd:latest - pull() got an unexpected keyword argument 'decode'"}
</code></pre></div>
<p dir="auto">while pulling an image</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>

<p dir="auto">Execute ansible-playbook with the following play:</p>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: &quot;Start container&quot;
  docker_container:
    name: whatever
    image: &quot;httpd&quot;
    pull: true"><pre class="notranslate"><code class="notranslate">- name: "Start container"
  docker_container:
    name: whatever
    image: "httpd"
    pull: true
</code></pre></div>

<p dir="auto">Copied from original issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="187775121" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-core/issues/5515" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible-modules-core/issues/5515/hovercard" href="https://github.com/ansible/ansible-modules-core/issues/5515">ansible/ansible-modules-core#5515</a></p>
<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<ul dir="auto">
<li>docker_container</li>
</ul>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.2.1.0
  config file = /usr/home/sean/work/ansible/ansible.cfg
  configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">ansible 2.2.1.0
  config file = /usr/home/sean/work/ansible/ansible.cfg
  configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<ul dir="auto">
<li>Nothing.</li>
</ul>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">N/A</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">The docker_container documentation says it requires a docker-py&gt;=1.7.0. However, as of 2.2.1.0, the minimum version is actually 1.8.0 because of the addition of the <code class="notranslate">decode</code> argument to the <code class="notranslate">pull</code> method. That keyword argument was added for docker-py 1.8.0-rc1.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">Use docker_container with a remote host that has 1.7.x, such as CentOS 7.2's 1.7.2.</p>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">Work.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="failed: [host.example.com] (item=worker) =&gt; {&quot;failed&quot;: true, &quot;item&quot;: &quot;worker&quot;, &quot;msg&quot;: &quot;Error pulling image imagename:latest - pull() got an unexpected keyword argument 'decode'&quot;}"><pre class="notranslate"><code class="notranslate">failed: [host.example.com] (item=worker) =&gt; {"failed": true, "item": "worker", "msg": "Error pulling image imagename:latest - pull() got an unexpected keyword argument 'decode'"}
</code></pre></div>