【发布时间】:2016-11-30 18:40:00
【问题描述】:
我正在尝试使用 Ansible 剧本在 AWS 上预置我的基础设施。我有这个实例,并且能够配置 docker-engine、docker-py 等,我发誓,昨天这工作正常,从那以后我没有更改代码。
我的剧本的相关部分是:
- 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
我的{{ docker_registry }} 设置为my-acct-id.dkr.ecr.us-east-1.amazonaws.com,我得到的结果是:
"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"
但是,如上所述,这在昨晚正常运行。从那时起,我对 VPC/子网进行了一些更改,但我能够通过 ssh 连接到实例,并运行 docker pull my-acct-id.dkr.ecr.us-east-1.amazonaws.com/example 没有任何问题。
谷歌搜索并没有让我走得很远,因为我似乎找不到其他人有同样的错误。我想知道发生了什么变化,以及如何解决它!谢谢!
编辑:版本:
- ansible - 2.2.0.0
- 码头工人-1.12.3 6b644ec
- docker-py - 1.10.6
【问题讨论】:
-
有完全相同的问题。今天早上它对我有用,我没有改变任何东西。我开了一个bug:github.com/ansible/ansible-modules-core/issues/5775
-
我在访问私有和公共 Docker 注册表时也看到了这一点。这当然是一个令人头疼的问题。
标签: amazon-web-services docker ansible provisioning dockerpy