foo.example.com | UNREACHABLE! => {
“changed”: false,
“msg”: “Failed to connect to the host via ssh: ssh: Could not resolve hostname foo.example.com: Name or service not known\r\n”,
“unreachable”: true
}
`
Strange about this event is that the host in question existed in the past but not anymore. It is not in my inventory file.
Ansible does not make up hosts, so that must be defined somewhere, you
can run `ansible-inventory --list -p /path/to/playbook` to ensure no
other files add that (i.e ansible_ssh_host: foo.example.com)
The inventory source is not he only place were you can define an
address, anywhere you can define a variable lets you define the
ansible_host/ansible_ssh_host/etc to change the target.
Yes, you are right. And thanks to your advise using `ansible-inventory
--list` I was able to found my mistake.
It starts with using a bad example. Because foo.example.com is more like
foo3.example.com. A `grep foo3.example.com` didn't get a result because
the host was 'hidden' by "foo[0:3].example.com" in my inventory.
Now, I found it, removed it and everything is fine.