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

Fixes #494 inventory parsing continues when labels are not available when the labels entry is used #495

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

Conversation

Yonas-Dresen
Copy link
Contributor

SUMMARY

Check if labels are present in the json file. If no labels are present, do not set name. This will cause the inventory to continue parsing and setting the next available hostname from the ordered list.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

gcp_compute

ADDITIONAL INFORMATION
hostnames:
- labels.name
- private_ip

If a vm has no labels attached it will now use the private ip

Tested behavior after change:

  • Ensure label.name is set when present
  • Ensure inventory continues parsing when labels are not available
  • Ensure inventory continues parsing when labels are available, but the requested labels is not present

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants