Skip to content

Conversation

@DeLoWaN
Copy link

@DeLoWaN DeLoWaN commented Jul 1, 2021

SUMMARY

inventory plugin: adding the instance hostname field as inventory hostname

I opened an issue but it's preferable to do this on a PR.

Fixes #434

I think it would be a great addition. In my setup I use the hostname field of the instance which allows me to use a full FQDN. I cannot use as-is the FQDN in the name field since it does not allow dots ".".

I am concerned about how to handle the fact that the hostname field might be absent (it is not mandatory on GCP). I fallbacked on the name field.

What do you think ?

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

inventory

ADDITIONAL INFORMATION

@stenh0use
Copy link

Can we please get some eyes on the PR? I also need this feature.

@DeLoWaN
Copy link
Author

DeLoWaN commented Nov 22, 2021

So apparently there is a workaround implemented last month: #464

@stenh0use
Copy link

Thanks! I saw that, but i guess not ideal given the hostname field does exist. it's a small lift to add that label. Do you think it will be a hard no on this PR?

@DeLoWaN
Copy link
Author

DeLoWaN commented Nov 23, 2021

I don't know, it would be nice to have some input from the maintainers, as this PR is open for more than 4 months.

@stenh0use
Copy link

Yes! I agree, I thought Ansible's strategy in forking content into community maintained collections was to avoid situations like this.

@tjtoml
Copy link

tjtoml commented Mar 4, 2022

I added this in #219 and haven't heard any feedback on it in almost 2 years. The workaround in #464 does not you to use FQDNs (the preferable solution for me) because periods/dots are unaccepted characters.

@toumorokoshi toumorokoshi added the enhancement New feature or request label Nov 12, 2022
thekad added a commit to thekad/google.cloud that referenced this pull request Jun 9, 2025
Fixes ansible-collections#434

It is basically the same as ansible-collections#438 but with a few extra checks, don't want
to rebase the whole thing.

Signed-off-by: Jorge Gallegos <[email protected]>
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.

inventory plugin: adding the instance hostname field as inventory hostname

4 participants