Jos*_*ger 22 ansible ansible-playbook
我注意到Ansible使用分号删除临时脚本来分隔bash命令.
这是一个示例命令:
EXEC ssh -C -tt -v -o ControlMaster=auto -o ControlPersist=60s -o
ControlPath="/Users/devuser/.ansible/cp/ansible-ssh-%h-%p-%r" -o
KbdInteractiveAuthentication=no -o
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
-o PasswordAuthentication=no -o ConnectTimeout=10 build /bin/sh -c
'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python
/home/ec2-user/.ansible/tmp/ansible-tmp-1430847489.81-75617096172775/docker;
rm -rf
/home/ec2-user/.ansible/tmp/ansible-tmp-1430847489.81-75617096172775/
>/dev/null 2>&1'
Run Code Online (Sandbox Code Playgroud)
有没有办法告诉ansible用双符号替换分号或告诉它在运行ansible-playbook时保存脚本或输出内容?
我正在尝试调试此脚本中的错误,现在唯一出现的是:
failed: [build] => {"changed": false, "failed": true}
msg: ConnectionError(ProtocolError('Connection aborted.', error(2, 'No such file or directory')),)
Run Code Online (Sandbox Code Playgroud)
Jos*_*ger 40
我找到了环境变量 -
export ANSIBLE_KEEP_REMOTE_FILES=1
Run Code Online (Sandbox Code Playgroud)
设置它,然后重新运行ansible-playbook,然后ssh和cd到〜/ .ansible/tmp /来查找文件.