I am trying to provide my infrastructure on AWS using Ansible playbooks. I have an instance, and I can provide a docker engine, docker-py, etc., And I swear it worked correctly yesterday, and since then I have not changed the code.
Relevant part of my play:
- name: Ensure AWS CLI is available pip: name: awscli state: present when: aws_deploy - block: - name: Add .boto file with AWS credentials. copy: content: "{{ boto_file }}" dest: ~/.boto when: aws_deploy - name: Log in to docker registry. shell: "$(aws ecr get-login --region us-east-1)" when: aws_deploy - name: Remove .boto file with AWS credentials. file: path: ~/.boto state: absent when: aws_deploy - name: Create docker network docker_network: name: my-net - name: Start Container docker_container: name: example image: "{{ docker_registry }}/example" pull: true restart: true network_mode: host volumes: - /etc/localtime:/etc/localtime:ro - /etc/timezone:/etc/timezone
My {{ docker_registry }} set to my-acct-id.dkr.ecr.us-east-1.amazonaws.com , and the result I get is the following:
"msg": "Error pulling my-acct-id.dkr.ecr.us-east-1.amazonaws.com/example - code: None message: Get http://: http: no Host in request URL"
However, as already mentioned, this worked fine last night. Since then, I have made some changes to the VPC / subnet, but I can pass ssh to the instance and run docker pull my-acct-id.dkr.ecr.us-east-1.amazonaws.com/example without problems.
Googling did not lead me very far, because I cannot find other people with the same mistake. I wonder what has changed, and how I can fix it! Thanks!
EDIT: Versions:
- ansible - 2.2.0.0
- docker - 1.12.3 6b644ec
- docker-py - 1.10.6
source share