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

Added hostname as an option for gcp_compute inventory plugin #61202

Closed

Conversation

@jim5359
Copy link

commented Aug 23, 2019

SUMMARY

In our environment we sometimes have the same server name in multiple projects. In order to connect internally to servers we must use either the hostname or private ip of the machine. The hostname is much more visually identifiable.

Currently the GCP inventory plugin only supports using public_ip, private_ip or name (servername) as the hostname for inventory. This PR adds the option to use the server hostname so Ansible will display and connect to machines using their hostname.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

gcp_compute

ADDITIONAL INFORMATION

Although the private_ip option for hostname would work in our scenario, it's hard to identify which machine each ip refers to. By using the hostname, our internal DNS can route ansible to the appropriate internal ip address while still displaying an easily identifiable name.

jim_reed
@ansibot

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2019

jim_reed added 2 commits Aug 29, 2019
jim_reed
Merge branch 'devel' into inventory_gcp_compute-add-hostname
# Conflicts:
#	lib/ansible/plugins/inventory/gcp_compute.py
jim_reed
@ansibot

This comment has been minimized.

Copy link
Contributor

commented Aug 29, 2019

@jim5359 this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

@jim5359

This comment has been minimized.

Copy link
Author

commented Aug 29, 2019

Will create new PR.

@jim5359 jim5359 deleted the jim5359:inventory_gcp_compute-add-hostname branch Aug 29, 2019

@sivel sivel removed the needs_triage label Aug 30, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.