<h5 dir="auto">Bug Report</h5>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">docker inventory plugin</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.4.0 (fix-docker-api 16c324eff6) last updated 2017/08/16 10:35:51 (GMT +200)
  config file = /home/yannig/.ansible.cfg
  configured module search path = [u'/home/yannig/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/yannig/dev/ansible/lib/ansible
  executable location = /home/yannig/dev/ansible/bin/ansible
  python version = 2.7.13 (default, Jan 19 2017, 14:48:08) [GCC 6.3.0 20170118]"><pre class="notranslate"><code class="notranslate">ansible 2.4.0 (fix-docker-api 16c324eff6) last updated 2017/08/16 10:35:51 (GMT +200)
  config file = /home/yannig/.ansible.cfg
  configured module search path = [u'/home/yannig/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/yannig/dev/ansible/lib/ansible
  executable location = /home/yannig/dev/ansible/bin/ansible
  python version = 2.7.13 (default, Jan 19 2017, 14:48:08) [GCC 6.3.0 20170118]
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">None</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<p dir="auto">Ubuntu 17.04</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">With last docker-py 2.0, Docker inventory plugin is broken.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">Install last version of docker-py (pip install docker-py --upgrade) then launch docker.py in contrib/inventory</p>
<h5 dir="auto">EXPECTED RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ ./docker.py  --list --pretty
{
    &quot;38af95bd3ea31&quot;: [
        &quot;bla1&quot;
    ], 
    &quot;38af95bd3ea3131f05cbe0021723cc360b8fd531ceba96611aa21bc299f6c205&quot;: [
        &quot;bla2&quot;
    ], 
    &quot;40b7bccc9f393&quot;: [
        &quot;bla3&quot;
    ], "><pre class="notranslate"><code class="notranslate">$ ./docker.py  --list --pretty
{
    "38af95bd3ea31": [
        "bla1"
    ], 
    "38af95bd3ea3131f05cbe0021723cc360b8fd531ceba96611aa21bc299f6c205": [
        "bla2"
    ], 
    "40b7bccc9f393": [
        "bla3"
    ], 
</code></pre></div>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="./docker.py  --list --pretty
Traceback (most recent call last):
  File &quot;./docker.py&quot;, line 418, in &lt;module&gt;
    class AnsibleDockerClient(Client):
NameError: name 'Client' is not defined"><pre class="notranslate"><code class="notranslate">./docker.py  --list --pretty
Traceback (most recent call last):
  File "./docker.py", line 418, in &lt;module&gt;
    class AnsibleDockerClient(Client):
NameError: name 'Client' is not defined
</code></pre></div>
<p dir="auto">From <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/hoall/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/hoall">@hoall</a> on 2016-09-23T09:35:55Z</p>

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

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

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

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible --version
ansible 2.1.2.0 (stable-2.1 4c9ed1f4fb) last updated 2016/09/23 11:24:18 (GMT +200)
  lib/ansible/modules/core: (detached HEAD af67009d38) last updated 2016/09/23 11:27:16 (GMT +200)
  lib/ansible/modules/extras: (detached HEAD 1bde4310bc) last updated 2016/09/23 11:27:16 (GMT +200)
  config file =
  configured module search path = Default w/o overrides"><pre class="notranslate"><code class="notranslate">ansible --version
ansible 2.1.2.0 (stable-2.1 4c9ed1f4fb) last updated 2016/09/23 11:24:18 (GMT +200)
  lib/ansible/modules/core: (detached HEAD af67009d38) last updated 2016/09/23 11:27:16 (GMT +200)
  lib/ansible/modules/extras: (detached HEAD 1bde4310bc) last updated 2016/09/23 11:27:16 (GMT +200)
  config file =
  configured module search path = Default w/o overrides
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>

<h5 dir="auto">OS / ENVIRONMENT</h5>

<h5 dir="auto">SUMMARY</h5>

<p dir="auto">I'm creating a user with primary group and some other groups.</p>
<p dir="auto">When using the stable branch, the task from below keeps changed = true. I couldn't find out what is changed, though.</p>
<p dir="auto">Running the same task with ansible and the modules from devel works correct. Maybe you can merge the changes in ansible-modules-core in stable. Unfortantly, I can't tell which commits.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>


<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: add oracle user
  user:
    name=oracle
    group=oinstall
    groups=oinstall,dba
    password=foobar
    update_password=on_create
"><pre class="notranslate"><code class="notranslate">- name: add oracle user
  user:
    name=oracle
    group=oinstall
    groups=oinstall,dba
    password=foobar
    update_password=on_create

</code></pre></div>

<h5 dir="auto">EXPECTED RESULTS</h5>

<p dir="auto">On second run, the change should be false and state ok.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK [oracle-12c-preparation : add oracle user] ********************************
ok: [mysecret] =&gt; {&quot;append&quot;: false, &quot;changed&quot;: false, &quot;comment&quot;: &quot;&quot;, &quot;group&quot;: 1001, &quot;groups&quot;: &quot;oinstall,dba&quot;, &quot;home&quot;: &quot;/home/oracle&quot;, &quot;move_home&quot;: false, &quot;name&quot;: &quot;oracle&quot;, &quot;password&quot;: &quot;NOT_LOGGING_PASSWORD&quot;, &quot;shell&quot;: &quot;/bin/bash&quot;, &quot;state&quot;: &quot;present&quot;, &quot;uid&quot;: 1002}"><pre class="notranslate"><code class="notranslate">TASK [oracle-12c-preparation : add oracle user] ********************************
ok: [mysecret] =&gt; {"append": false, "changed": false, "comment": "", "group": 1001, "groups": "oinstall,dba", "home": "/home/oracle", "move_home": false, "name": "oracle", "password": "NOT_LOGGING_PASSWORD", "shell": "/bin/bash", "state": "present", "uid": 1002}
</code></pre></div>
<h5 dir="auto">ACTUAL RESULTS</h5>
<p dir="auto">State keeps changed.</p>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK [oracle-12c-preparation : add oracle user] ********************************
changed: [mysecret] =&gt; {&quot;append&quot;: false, &quot;changed&quot;: true, &quot;comment&quot;: &quot;&quot;, &quot;group&quot;: 1001, &quot;groups&quot;: &quot;oinstall,dba&quot;, &quot;home&quot;: &quot;/home/oracle&quot;, &quot;move_home&quot;: false, &quot;name&quot;: &quot;oracle&quot;, &quot;password&quot;: &quot;NOT_LOGGING_PASSWORD&quot;, &quot;shell&quot;: &quot;/bin/bash&quot;, &quot;state&quot;: &quot;present&quot;, &quot;uid&quot;: 1002}"><pre class="notranslate"><code class="notranslate">TASK [oracle-12c-preparation : add oracle user] ********************************
changed: [mysecret] =&gt; {"append": false, "changed": true, "comment": "", "group": 1001, "groups": "oinstall,dba", "home": "/home/oracle", "move_home": false, "name": "oracle", "password": "NOT_LOGGING_PASSWORD", "shell": "/bin/bash", "state": "present", "uid": 1002}
</code></pre></div>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate">
</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="178829879" data-permission-text="Title is private" data-url="https://github.com/ansible/ansible-modules-core/issues/4982" data-hovercard-type="issue" data-hovercard-url="/ansible/ansible-modules-core/issues/4982/hovercard" href="https://github.com/ansible/ansible-modules-core/issues/4982">ansible/ansible-modules-core#4982</a></p>