google.cloud icon indicating copy to clipboard operation
google.cloud copied to clipboard

Add custom hostname set in GCE to the hostnames block of the inventory plugin

Open tjtoml opened this issue 5 years ago • 2 comments

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.

tjtoml avatar May 05 '20 17:05 tjtoml

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

whyman avatar Nov 11 '20 14:11 whyman

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

whyman avatar Nov 11 '20 14:11 whyman