Ansible:ssh:无法解析主机名host1:名称或服务未知

时间:2019-05-20 12:30:10

标签: ssh ansible

我是Ansible的新手,正在尝试配置对Ansible主机的SSH访问。当我键入以下命令ansible all -m ping -vvvv时,它显示在下面的输出中。我还将主机IP添加到服务器的主机文件中。

host1 | FAILED => SSH encountered an unknown error. The output was:
OpenSSH_6.7p1 Debian-5+deb8u7, OpenSSL 1.0.1t  3 May 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: /etc/ssh/ssh_config line 57: Applying options for *
debug1: auto-mux: Trying existing master
debug1: Control socket "/root/.ansible/cp/ansible-ssh-host1-22-root" does not exist
ssh: Could not resolve hostname host1: Name or service not known

它应该显示在下面的输出中:

host1 | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh.",
    "unreachable": true
}

0 个答案:

没有答案
相关问题