title: Ansible doesn't add credentials to ~/.docker/config.json despite succesful login to registry
body: <p>I can't login to private docker login registry via ansible. The login itself is succesful, which I can see in registry container logs; besides ansible doesn't throw erorrs when doing login task. However after running ansible role, I can't pull images. Apparently ansible never adds any credentials to docker's config file. When I login manually from host machine, everything works fine. </p>
  
  <p>Does anyone know what's the problem?</p>
  
  <p>versions:  Ansible 2.3.2.0, Docker 17.12</p>
  
  <p>ansible role in <code>main.yml</code>:</p>
  
  <pre><code>---
   # should work but does not - ansible doesn't add credentials to ~/.docker.config.json... have to log manually  
  - name: login to private registry
    docker_login:
      registry: "{{ registry_container_url }}"
      username: "{{ registry_user }}"
      password: "{{ registry_password }}"
      reauthorize: yes
  </code></pre>
  
  <p>playbook only executes this role:</p>
  
  <pre><code>---
  - hosts: host1
    become: yes
    roles:
      - testrole
  </code></pre>
  
  <p>Log:</p>
  
  <pre><code>ok: [node02]
  
  TASK [docker-test : login to private registry] *************************************************************************
  changed: [node02]
  
  PLAY RECAP ************************************************************************************************************
  node02                     : ok=2    changed=1    unreachable=0    failed=0   
  </code></pre>