It's hard to give details because you haven't explained why you don't know the IP.
I've used multicast DNS (via avahi ) on DHCP booted Raspberry Pis to advertise hostnames, then put those hostnames into groups in flat file inventories. That means the servers can change IP without having to update any config on the ansible node. You're copying this key up so you'll need some way to find the server, right? Ansible inventories can be scripts as well as flat files (that's how things like it's cloud support works). There's lots of information at: http://docs.ansible.com/ansible/intro_dynamic_inventory.html On 11 November 2016 at 17:30, anirudh vasudevan <[email protected]> wrote: > > > I know the conventional way of using Ansible is copying the ssh key on to > the target and then adding the ip address to the inventory file. In my case > I will not know the Ip address of the target that am testing on, how can > ansible get me the ip address? Any workaround > > Thanks in advance > > Thanks, > > Anirudh Vasudevan > > -- > 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]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/9e626ca7-888e-4f4a-9224-6bc580506a4b%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAK5eLPSZc-c_UBxATT7WZsUH6hUsGjO4Qh57RbjHQ%3Du2tiFxag%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
