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 custom hostname set in GCE to the hostnames block of the inventory plugin #219

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tjtoml
Copy link

@tjtoml tjtoml commented May 5, 2020

SUMMARY

This change allows the use of the custom hostname set when creating an instance in GCE as the inventory_hostname in playbooks. Includes a fallback to the instance name in the case that a custom hostname is not defined.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

gcp_compute.py (dynamic inventory plugin)

ADDITIONAL INFORMATION

The hostname block already allowed the dynamic inventory plugin to use the instance name, but I am setting a custom hostname for my instances (via terraform) and wanted to be able to leverage that in ansible. I added a few lines of code that allowed this, with a fallback in case some instances do not have a custom hostname set.

@whyman
Copy link

whyman commented Nov 11, 2020

This would be super helpful for us... any chance of getting it merged?

@whyman
Copy link

whyman commented Nov 11, 2020

@rambleraptor Are PRs accepted on this repo or is there some other method to send changes?

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

Successfully merging this pull request may close these issues.

3 participants