【发布时间】:2017-11-28 02:48:05
【问题描述】:
我正在尝试使用 ansible 连接到机器并在节点上运行 ping 命令。我收到以下消息。
命令:ansible -i inventory all -m ping
消息:
centosinstance | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: Could not resolve hostname centosinstance: Name or service not known\r\n",
"unreachable": true
}
我已经在ansible.cfg 文件中提到了私钥文件和远程用户名。
可能的原因是什么?
【问题讨论】:
-
同时显示您的库存文件内容
-
有一个错误信息给你:
Could not resolve hostname centosinstance. -
@ArbabNazar :这是库存文件“centosinstance centosinstance1”中的内容。我在库存文件中有两个实例,两台机器都出现相同的错误。