google.cloud
google.cloud copied to clipboard
Add custom hostname set in GCE to the hostnames block of the inventory plugin
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.
This would be super helpful for us... any chance of getting it merged?
@rambleraptor Are PRs accepted on this repo or is there some other method to send changes?