繁体   English   中英

主机user @ ip_address的“无法解析主机名”错误

[英]Ansible “Could not resolve hostname” error for host user@ip_address

在运行这个...

$ ansible all -m ping

我得到这个...

[WARNING]: sftp transfer mechanism failed on [test@172.31.48.154]. Use ANSIBLE_DEBUG=1 to see detailed information
[WARNING]: scp transfer mechanism failed on [test@172.31.48.154]. Use ANSIBLE_DEBUG=1 to see detailed information

test@172.31.48.154 | 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"
}

库存中不支持使用username@host 参见问题#14255

相反,您可以像下面这样编写清单文件:

host.example.com     ansible_connection=ssh        ansible_user=test

或像这样运行您的命令:

$ ansible all -m ping -u test

暂无
暂无

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

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