我在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
playbook 时:
---
- name: Play
hosts: localhost
vars: []
tasks:
- name: nginx container
docker:
name: my.nginx2
image: nginx
state: started
我做错了什么?这是一个bug吗?
P.S. 使用-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