I've started learning and using ansible for configuring my staging and production servers. One thing I'd like to do is configure /etc/hosts through the inventory file.
It seems that this is possible. Here is one such usage: https://gist.github.com/rothgar/8793800
However, I'm a little green to Ansible and I don't get it. Can someone please explain in plain english how I make it work in practice?
For example, if my inventory file contains.
[compute] 220.127.116.11 18.104.22.168 [db] 22.214.171.124 126.96.36.199 10.11.12.13 [all] compute db [all:vars] ...
I'd like to say with consistency that my hosts file after running the playbook contained
188.8.131.52 db1 184.108.40.206 db2 10.11.12.13 db3 220.127.116.11 compute1 18.104.22.168 compute2
Is this possible?