gpt4 book ai didi

SSH 正常,但 Ansible 返回 "unreachable"

转载 作者:行者123 更新时间:2023-12-04 19:35:02 24 4
gpt4 key购买 nike

我使用 key 的 SSH 设置正确。

ssh admin@192.168.1.111
admin@DiskStation:~$

但是 Ansible 返回一个错误:
TASK [setup] *******************************************************************
<192.168.1.111> ESTABLISH SSH CONNECTION FOR USER: admin
<192.168.1.111> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=admin -o ConnectTimeout=10 -o ControlPath=/Users/Shared/Jenkins/.ansible/cp/ansible-ssh-%h-%p-%r 192.168.1.111 '/bin/sh -c '"'"'( umask 22 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1479205446.3-33100049148171 `" && echo "` echo $HOME/.ansible/tmp/ansible-tmp-1479205446.3-33100049148171 `" )'"'"''
<192.168.1.111> PUT /var/folders/pd/8q63k3z93nx_78dggb9ltm4c00007x/T/tmpNJvc43 TO /var/services/homes/admin/.ansible/tmp/ansible-tmp-1479205446.3-33100049148171/setup
<192.168.1.111> SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=admin -o ConnectTimeout=10 -o ControlPath=/Users/Shared/Jenkins/.ansible/cp/ansible-ssh-%h-%p-%r '[192.168.1.111]'
fatal: [192.168.1.111]: UNREACHABLE! => {"changed": false, "msg": "SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh", "unreachable": true}

有人能帮我吗?

最佳答案

Ansible 为 SFTP 连接返回“无法访问”,而不是 SSH。

在目标节点(或中间的防火墙)上启用 SFTP,或将 Ansible 配置为 use SCPansible.cfg :

scp_if_ssh = True

关于SSH 正常,但 Ansible 返回 "unreachable",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40607688/

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