You can try setting it to public_dns_name. It should resolve to the private IP when you're inside the vpc, and to the public IP when your outside.
On Wed, Aug 31, 2016, 23:22 Soren Olegnowicz <[email protected]> wrote: > Sure! > > Currently I run: " ansible all -m ping -i ec2.py " > > With: > > destination_variable = public_dns_name > > vpc_destination_variable = private_ip_address > > The return values for the ping will only return positive on the private > vpc instances because the ping happens via the private IP's > > If I change it to: > > vpc_destination_variable = public_ip_address > > then the return values for the ping will only return positive for the > public non-vpc instances because the ping happens via the public IP's > > I would like to be able to successfully ping all instances with the above > command. > > Hope that helps. > > On Monday, August 29, 2016 at 9:04:47 PM UTC-4, Soren Olegnowicz wrote: >> >> Hey guys I need to connect to my ec2 instances in various ways using the >> ec2.ini provided. Right now my I can only get my ec2.ini to connect to my >> instances via their private or public IP alone, but I need to connect to >> some instances via their private IP and some via their public. Any >> suggestions for introducing logic to accomplish this? >> > -- > You received this message because you are subscribed to a topic in the > Google Groups "Ansible Project" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/ansible-project/jfEO2I9pStM/unsubscribe. > To unsubscribe from this group and all its topics, 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/fbdc0064-709e-405f-8f32-5685a5dd6d52%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/fbdc0064-709e-405f-8f32-5685a5dd6d52%40googlegroups.com?utm_medium=email&utm_source=footer> > . > 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/CAO0%3DbmH2gGc2JRyoCUt_NfdMHyiFZyzuCBBLoDVwDB9ku5Jgjw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
