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?