Enhance connection to servers with only private_ips#35
Enhance connection to servers with only private_ips#35jogoossens wants to merge 6 commits intoUpCloudLtd:mainfrom
Conversation
All fallback to private_ipv4
|
Thank you for the pull request and sorry for the delay with this! I'll try to look into this during next week 👀 |
There was a problem hiding this comment.
Seems that these changes use quite old version of the collection as their base. Would it be possible to rebase the source branch on top of the latest release.
I did not yet look into the change itself, just noticed the merge conflict warning at the bottom of the page.
| # Fork notes: | ||
|
|
||
| This is a fork in order to develop some possible enhancements | ||
|
|
There was a problem hiding this comment.
This should be removed before merging this. Maybe it would be cleaner if you used non-default branch of your fork as the source for the pull request 🤔
| if len(possible_addresses) > 0: | ||
| self.inventory.set_variable(server.hostname, "ansible_host", to_native(possible_addresses[0])) | ||
| else: | ||
| connect_with = "private_ipv4" # Fallback to private_ipv4 if not any public address was found |
There was a problem hiding this comment.
Maybe we could make this fallback configurable by accepting a list as a value for connect_with: #37
|
Hello! 👋 We updated the connect_with:
- public_ipv4
- private_ipv4This is available in v0.10.0 🚢 If no objections, I'll close this PR. Thank you for the improvement suggestion! |
|
That sounds good, but would it give the private_ipv4 automatically if no public_ipv4? We'd need like "1 default" parameter to connect |
|
Yes, with |
Automatic fallback if no public ip's are found