当我在加速模式下运行ansible-playbook时,由于某种原因,ansible任务失败,下一次运行将不会连接以下错误
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
fatal: [xxx.xxx.xxx.xxx] => Failed to connect to xxx.xxx.xxx.xxx:5099
TASK: [role | task] ***********************************************
FATAL: no hosts matched or all hosts have already failed -- aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @//task.retry
xxx.xxx.xxx.xxx : ok=0 changed=0 unreachable=1 failed=0
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
fatal: [xxx.xxx.xxx.xxx] => Failed to connect to xxx.xxx.xxx.xxx:5099
TASK: [role | task] *********************************************
FATAL: no hosts matched or all hosts have already failed -- aborting
等等…
然后在目标主机中有一个ansible procces运行.我跑
kill -9 $(ps -aux | grep accelerate | awk '{print $2}')
杀死这个过程和下一步成功.
有人知道发生了什么以及如何解决它.
最佳答案 我知道这不是你问题的答案,但是为什么在你可以启用ControlMaster for SSH时使用加速模式.在大多数情况下,它应该更快地加速模式,并且您不必担心再打开一个端口.只需将以下内容添加到ansible.cfg中:
[ssh_connection]
ssh_args = -o ControlMaster=auto -o ControlPersist=60s