The most standard way is DNS :)

Also in the above, you have "ansible-ssh-host" where it is really
"ansible_ssh_host"

When you say

"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"

It sounds like you are doing dynamic things, so I'd suggest reading this
and not have a file at all:

http://docs.ansible.com/intro_dynamic_inventory.html



On Tue, Jan 21, 2014 at 6:41 PM, Kesten Broughton <
[email protected]> wrote:

>
> 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.
>



-- 
Michael DeHaan <[email protected]>
CTO, AnsibleWorks, Inc.
http://www.ansibleworks.com/

-- 
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