Hi Vikram, Kai is right, now that you have shared your code. You are trying to display default_ipv4_address of all the hosts. Since the hosts are unreachable, Ansible is unable to gather facts, hence it cannot find default_ipv4_address of all the hosts and verily cannot display them. Try to resolve the connectivity issue first.
Thanks -AliJ On Sun, Nov 20, 2016 at 1:30 AM, Kai Stian Olstad < [email protected]> wrote: > On 19. nov. 2016 21:16, vikram ranabhatt wrote: > >> Thanks kai for your suggestion. >> but actual purpose of >> hostvars[item]['ansible_default_ipv4']['address'] >> Is to add entry in hosts file in each machine. >> Do you have any idea why this ansible_default_ipv4 is not available?? >> > > I tried to explain that in my previous mail, I'm not sure if I can explain > it more clearly than I did. > Maybe someone else can explain it better. > > I can try one more go. > > You have 13 hosts, but you are only able to reach 1 of them. > You need to fix that so you can log in to all 13 and not just the one host > called "inception". > The other 12 hosts you get a UNREACHABLE! if you look at you output, solve > them at it will work. > > Since 12 of 13 hosts are UNREACHABLE you are not able to log in and > collect the facts about them and thats why ansible_default_ipv4 is not > available. > > -- > Kai Stian Olstad > > -- > 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/ms > gid/ansible-project/33ddc90d-5275-6d24-6baa-cfe0e86bc6c5%40olstad.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/CAF%2BYgi4RdVy-ttwyEdq_9Gon2iOmk9kX4mG3K%2BPnpBbPHNwayg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
