spurin / masteringansible

Repository for course content for Packt Mastering Ansible Course
109 stars 258 forks source link

Problem with hostnames getting started, potentially DNS. #8

Closed queglay closed 5 years ago

queglay commented 5 years ago

however in this lecture around 9 mins in, I cannot resolve the hosts https://www.udemy.com/mastering-ansible-x/learn/v4/t/lecture/9300276?st art=834

https://www.udemy.com/mastering-ansible-x

I get the error

[user@workstation ansible]$ ansible all -m ping centos1 | UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: ssh: Could not resolve hostname centos1: Name or service not known\r\n", "unreachable": true }

I suspect that a step is not defined here we we probably have to configure dns somehow, but I don't think this step happenned.

I'm using RHEL 7.6, and I have mapped the alias to the ip addresses for my NIC with sudo ifconfig eno1:0 192.168.0.48

queglay commented 5 years ago

resolved by adding thos to the top of /etc/resolve.conf in RHEL. nameserver 192.168.0.40 This should be ammended into the course instructions unless I missed it.

spurin commented 5 years ago

Thanks again @queglay, I agree with your observations. This is necessary when you're using your own control host rather than the one supplied with the lab. As per another issue you raised, I will add this as a consideration when I update the course. Marking as an enhancement.

spurin commented 5 years ago

@queglay I've also referenced this issue here as well https://masteringansible.com/2019/03/14/Using-your-own-control-host-with-the-lab/ and have again, credited you for the support, considering this closed. Thanks