Package: ansible Version: 2.1.1.0-1 Severity: important Dear Maintainer,
I want to use Ansible to configure some CentOS 7 hosts. I can log in to the host using my SSH key, using the name or the IP of the host without any problems. With Ansible, the situattion looks like this (sample): $ ping hostname PING hostname (172.20.168.27) 56(84) bytes of data. 64 bytes from 172.20.168.27 (172.20.168.27): icmp_seq=1 ttl=62 time=1.96 ms 64 bytes from 172.20.168.27 (172.20.168.27): icmp_seq=2 ttl=62 time=1.91 ms ^C --- hostname ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1001ms rtt min/avg/max/mdev = 1.913/1.940/1.968/0.051 ms $ cat smallhosts 172.20.168.27 hostname $ ansible -i smallhosts -m ping all hostname | UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh.", "unreachable": true } 172.20.168.27 | SUCCESS => { "changed": false, "ping": "pong" } As you can see, I listed the host twice in the inventory, once by IP, and once by name. If I try to contact the host by name, ansible falls over. I don't expect anyone to fix this problem at this point, but would rather use this case to support the other request for packaging 2.2, which seems to have fixed several problems in this area. Thank you! Cheers, Toni -- System Information: Debian Release: stretch/sid APT prefers testing APT policy: (990, 'testing'), (500, 'stable-updates'), (500, 'stable') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.8.0-1-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages ansible depends on: ii python-crypto 2.6.1-6+b1 ii python-httplib2 0.9.2+dfsg-1 ii python-jinja2 2.8-1 ii python-netaddr 0.7.18-2 ii python-paramiko 2.0.0-1 ii python-pkg-resources 28.7.1-1 ii python-yaml 3.12-1 pn python:any <none> Versions of packages ansible recommends: ii python-selinux 2.6-3 Versions of packages ansible suggests: ii sshpass 1.06-1 -- no debconf information