Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --public/--private flags to specify which IP to return #4

Closed
adammck opened this issue May 13, 2015 · 6 comments
Closed

Add --public/--private flags to specify which IP to return #4

adammck opened this issue May 13, 2015 · 6 comments

Comments

@adammck
Copy link
Owner

adammck commented May 13, 2015

Right now we only return the private_ip of each instance, but it would be useful to be able to return the public IP instead, or even to correlate instances with their DNS records if possible.

@adammck
Copy link
Owner Author

adammck commented Jun 5, 2015

We now return the public IP if available, otherwise the private IP. Close enough.

@adammck adammck closed this as completed Jun 5, 2015
@rposborne
Copy link

@adammck how would you go about getting around networking requirements that prevent access from the public ip. Is there anyway to force private only?

@adammck
Copy link
Owner Author

adammck commented Dec 5, 2015

I'm afraid that there's currently no way to force a private IP when a public IP is available. I'd like to add a flag and/or ENV var to do it.

@anarcher
Copy link
Contributor

I like it! very useful for me. :-)

IMO, If the terraform-inventory returns both of public IPs and private IPs, It's more useful for me.

instance_private : ["10.1.1.1"] , instance : [ "52.3.x.x"]

But a flag and/or ENV is good.

What do you think?

@kunickiaj
Copy link

We usually address instances by private ip (site to site vpn) even though they also have public IPs assigned usually.

@trevorr
Copy link

trevorr commented Aug 17, 2016

You can force use of the private IP by setting TF_KEY_NAME. For example:

TF_KEY_NAME=private_ip ansible-playbook --inventory-file=`which terraform-inventory` ansible/consul.yml

See PR #28.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants