gpt4 book ai didi

python - 消息 : ConnectionError(ProtocolError ('Connection aborted.' , 错误 (2, 'No such file or directory' )),)

转载 作者:太空宇宙 更新时间:2023-11-03 11:27:58 27 4
gpt4 key购买 nike

我在 TASK: nginx container 上遇到错误:

failed: [localhost] => {"changed": false, "failed": true}
msg: ConnectionError(ProtocolError('Connection aborted.', error(2, 'No such file or directory')),)

FATAL: all hosts have already failed -- aborting

当播放下一个 Ansible 剧本时:

---
- name: Play
hosts: localhost
vars: []
tasks:
- name: nginx container
docker:
name: my.nginx2
image: nginx
state: started

我做错了什么?这是错误吗?

附言-vvvv 得到的更详细的输出是:

<localhost> REMOTE_MODULE docker state=started name=my.nginx2 image=nginx
<localhost> EXEC ['/bin/sh', '-c', 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1431434101.65-11072088770561 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1431434101.65-11072088770561 && echo $HOME/.ansible/tmp/ansible-tmp-1431434101.65-11072088770561']
<localhost> PUT /tmp/tmp7ySlXq TO /home/victor/.ansible/tmp/ansible-tmp-1431434101.65-11072088770561/docker
<localhost> EXEC ['/bin/sh', '-c', u'LANG=C LC_CTYPE=C /usr/bin/python /home/victor/.ansible/tmp/ansible-tmp-1431434101.65-11072088770561/docker']
failed: [localhost] => {"changed": false, "failed": true}
msg: ConnectionError(ProtocolError('Connection aborted.', error(2, 'No such file or directory')),)

FATAL: all hosts have already failed -- aborting

最佳答案

你应该安装 docker:

- name: install docker
shell: curl -sSL https://get.docker.com/ | sh
args:
creates: /usr/bin/docker

你应该检查它是否有效:

- name: Wait for the Docker server to start
action: raw docker version
register: docker_version
until: docker_version.stdout.find("Client") != -1
retries: 30
delay: 10

并且您需要满足所有依赖项(http://docs.ansible.com/ansible/docker_module.html):

Requirements (on host that executes module)
python >= 2.6
docker-py >= 0.3.0
The docker server >= 0.10.0

关于python - 消息 : ConnectionError(ProtocolError ('Connection aborted.' , 错误 (2, 'No such file or directory' )),),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30191106/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com