Hi,
docker_login will only support credential stores in Ansible 2.10 (see
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)
with Ansible 2.9 if you need support for that now.
Cheers,
Felix
On Tue, 3 Mar 2020 01:06:15 -0800 (PST)
Jonas Audenaert wrote:
> 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?
>
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/20200303110023.36e643fd%40rovaniemi.