dnsmasq is a better solution for this purpose, but the goal is to play with Ansible.
It’s the continuation of the post: My own VPN on a VPS
The main goal is to play with Ansible. The second goal is to be able to connect to the hosts by their names rather then by their IPs. For this purpose, I will update /etc/hosts file on each host automatically by Ansible.
Preparing the host files on the Ansible server
In first place, I edit the hosts file on Ansible:
[root@vps-dc91297d ~]# tail -n3 /etc/hosts
10.8.0.1 vps
10.8.0.2 komputer01
10.8.0.3 pi
Now, I will be able to use the hosts name in the Ansible configuration file.
Leave a Reply