Is there a standard way of supplying the hosts to ip mapping without
relying on /etc/hosts?

My typical ansible-playbook procedure is

1. Create a vm
2. Add ip fqdn hostname line to /etc/hosts
3. Add hostname to groups in ansible_hosts file

I would prefer to keep dynamically generated hosts separate from /etc/hosts

something like

ansible-playbook -i hosts -z etc_hosts site.yml

where -z specifies the host-ip mapping file.

I am aware of the ability to have in hosts

[my_group]
host_vm_name ansible-ssh-host=10.1.12.1

But again, dynamically managing this would be a bit tricky compared to just
generating an ansible_hosts (hosts) file and an etc-hosts file separately,
in my mind.  Better separation of concerns to have architectural grouping
in one place and ip mapping in another in my opinion.

Is there an ansible way to achieve something like this?

kesten

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to