简体   繁体   English

Ansible:陷入连接阶段/收集事实

[英]Ansible: Stuck at connection phase / gathering facts

I keep beating my head against the wall - a few days ago, ansible stopped being able to connect to one of my boxes. 我一直把头靠在墙上 - 几天前,ansible停止了连接到我的一个盒子。 It just hangs after the output below. 它只是在下面的输出后挂起。 The only stuff I've done to the box recently is to do apt-get upgrade... Nothing else. 我最近在盒子里做的唯一事情就是做apt-get升级......没别的了。 Worked perfectly before. 以前工作得很好。 I'm the only one with rights to access it. 我是唯一有权访问它的人。

Any hints on where to look? 任何关于在哪里寻找的提示? I've tried enabling and disabling sudo in my hosts file, makes no difference. 我尝试在我的主机文件中启用和禁用sudo,没有任何区别。

Command I run: 命令我运行:

ansible-playbook site.yml -i hosts.yml -vvvv -u ubuntu ansible-playbook site.yml -i hosts.yml -vvvv -u ubuntu

Outputs this and hangs: 输出并挂起:

<cb2> ESTABLISH CONNECTION FOR USER: ubuntu
<cb2> REMOTE_MODULE setup
<cb2> EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/Users/alexweinstein/.ansible/cp/ansible-ssh-%h-%p-%r" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ubuntu -o ConnectTimeout=10 cb2 /bin/sh -c 'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python'

Note that I can ssh to the box just fine. 请注意,我可以ssh到盒子就好了。 Using ansible 1.9.4. 使用ansible 1.9.4。

ADDITIONAL INFO: 附加信息:

  • When I try to ssh into the box using the same exact ssh command as what ansible is outputting (see below), the connection goes thru just fine: 当我尝试使用与ansible输出相同的ssh命令进入框时(见下文),连接通过就好了:

ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/Users/alexweinstein/.ansible/cp/ansible-ssh-%h-%p-%r" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ubuntu -o ConnectTimeout=10 cb2 ssh -C -vvv -o ControlMaster = auto -o ControlPersist = 60s -o ControlPath =“/ Users / alexweinstein / .ansible / cp / ansible-ssh-%h-%p-%r”-o KbdInteractiveAuthentication = no -o PreferredAuthentications = gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication = no -o User = ubuntu -o ConnectTimeout = 10 cb2

  • Ping command hangs at the same exact point. Ping命令在同一点上挂起。

ansible all -i hosts.yml -m ping -vvvv ansible all -i hosts.yml -m ping -vvvv

I got the problem solved by upgrading to ansible 2.1. 我通过升级到ansible 2.1解决了问题。 BUT, as long as the verbose output was enabled (ansible-playbook -vvv, or ansible -v), the hang remained! 但是,只要启用详细输出(ansible-playbook -vvv或ansible -v),挂起就会保持! I turned the verbose output off, and the issue went away. 我关闭了详细输出,问题就消失了。

Ansible bug, clearly. 显然是Ansible bug。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM