gpt4 book ai didi

ssh - 主机 user@ip_address 的 Ansible "Could not resolve hostname"错误

转载 作者:行者123 更新时间:2023-12-02 13:48:10 26 4
gpt4 key购买 nike

运行时...

$ ansible all -m ping

我明白了...

[WARNING]: sftp transfer mechanism failed on [<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="57233224231766606579646679636f79666263" rel="noreferrer noopener nofollow">[email protected]</a>]. Use ANSIBLE_DEBUG=1 to see detailed information
[WARNING]: scp transfer mechanism failed on [<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="dfabbaacab9feee8edf1eceef1ebe7f1eeeaeb" rel="noreferrer noopener nofollow">[email protected]</a>]. Use ANSIBLE_DEBUG=1 to see detailed information

<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="9beffee8efdbaaaca9b5a8aab5afa3b5aaaeaf" rel="noreferrer noopener nofollow">[email protected]</a> | FAILED! => {
"failed": true,
"msg": "failed to transfer file to /home/test/.ansible/tmp/ansible-tmp-148610479.7-240708330710714/ping.py:\n\nssh: Could not resolve hostname 172.31.48.154]:Name or service not known\r\nlost connection\n"
}
localhost | SUCCESS => {
"changed": false,
"ping": "pong"
}

最佳答案

list 中不支持使用username@host。请参阅问题 #14255 .

相反,您可以编写库存文件,如下所示:

host.example.com     ansible_connection=ssh        ansible_user=test

或者运行您的命令,例如:

$ ansible all -m ping -u test

关于ssh - 主机 user@ip_address 的 Ansible "Could not resolve hostname"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42019026/

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