I want to insert the following entry into the /etc/hosts file somehow using Ansible.
10.33.5.44 ip-10-33-5-44
Here, the schema is that the ip should have an alias corresponding to the IP, prefixed with ip- and where the dot . would be replaced by dash -.
But to get this IP, I can only think of doing the host command on a DNS name e.g.
host euwest2-test-box.company.com
> euwest2-test-box.company.com has address 10.33.5.44
Can anyone suggest how to get that to work? Is it possible?