# Unable to combine docker\_login with credential store

**URL:** <https://forum.ansible.com/t/unable-to-combine-docker-login-with-credential-store/32372>\
**Category:** Ansible Project\
**Created:** [March 3, 2020, 9:06am UTC](https://forum.ansible.com/t/unable-to-combine-docker-login-with-credential-store/32372 "2020-03-03T09:06:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeremy\_Njock](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@Jeremy\_Njock](https://forum.ansible.com/u/Jeremy_Njock)\
**Post date:** [March 3, 2020, 9:06am UTC](https://forum.ansible.com/t/unable-to-combine-docker-login-with-credential-store/32372/1 "2020-03-03T09:06:15Z")

</div>

Hello, I’m using ansible 2.9 to install Docker on a remote RedHat, create a docker credential store with pass and pull several images from private docker registries.  
After the run of my playbook installing docker, docker credential store, etc. I remove the config.json of the **.docker** directory so it will re-initialize during the next docker login.

After this I use following ansible task to make a docker login:

`

- name: Logon  
docker\_login:  
registry: my-private-registry.on.my.internal.site  
username: myaccount  
password: “{{passwordvar}}”  
become: yes  
`

This fails because it generates plain text content in my config.json.  
`{ "auths": { "my-private-registroy.on.my.internal.site": { "auth": "U9ZjQWNjdC10cmF4LAJuZC1jaTpBKzVyWFYwSF8tNnEqcTkf", "email": null } } }`

When I remove manually the config.json file and use the docker login command on the server itself, I get what I wanted.

`{ "auths": { "my-private-registroy.on.my.internal.site": {} }, "HttpHeaders": { "User-Agent": "Docker-Client/19.03.6 (linux)" }, "credsStore": "pass" }`

Why is it not working with my ansible task?

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [March 3, 2020, 10:00am UTC](https://forum.ansible.com/t/unable-to-combine-docker-login-with-credential-store/32372/2 "2020-03-03T10:00:23Z")

</div>

Hi,

docker\_login will only support credential stores in Ansible 2.10 (see  
[https://github.com/ansible/ansible/pull/63158](https://github.com/ansible/ansible/pull/63158)).

You can try to use the new version of the module  
([https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/docker/docker\_login.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/cloud/docker/docker_login.py))  
with Ansible 2.9 if you need support for that now.

Cheers,  
Felix
