user1025852
user1025852

Reputation: 2784

Ansible fails to pull docker image from aws ecr (registry)

ansible: 2.3, trying to pull image with docker_container step.

Did all the steps of amazon-ecr-credential-helper still when ansible in the docker_container step it fails on

 message: unauthorized: authentication required

Thing is that on the remote machine I'm able to pull the image manually. I have only one user there (ec2-user of aws) - so it's seems like ansible thing. thoughts?

Upvotes: 3

Views: 3515

Answers (1)

tux
tux

Reputation: 1820

So, you have configured amazon-ecr-credential-helper for the ec2-user on remote machine, and the images can be pulled manually. While, executing the playbook, I think that you are executing the play as root or with become: yes.

If you are executing the playbook with become: yes, then the image pull would fail because, the task is executed as root.

Upvotes: 1

Related Questions