The app1 application server is configured with Ansible: the program logs in to machines over SSH and does the work it is given there. A colleague left a list of machines in ~/ansible-lab. Before changing anything, check the connection: ansible all -m ping goes round every machine on the list.
Check the connection to the machine on the list
In ~/ansible-lab look at your colleague's list of machines, check the connection to them with ansible all -m ping and find the lab.test lines in /etc/hosts.
First, predict
There is one machine on the list — app1. What will Ansible answer about it?
Now start the exercise, run the command and compare your prediction with the output.
Ansible answered “UNREACHABLE!” for app1. Why did it not connect?
-
UNREACHABLE!is a connection error; the module never ran. Ansible brings the module to the machine itself on every run. -
SSH did not even find the address — “Could not resolve hostname”: it never reached the service.
systemctl is-active sshanswersactive. -
Ansible started and printed an answer — student has the rights. The message in the answer is about the machine's name:
Could not resolve hostname.
SSH found no address for app1.lab.test: there is no such name in /etc/hosts.