-
Notifications
You must be signed in to change notification settings - Fork 138
Adding hostname support to dynamic inventory #689
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
Adding hostname support to dynamic inventory #689
Conversation
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]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #689 +/- ##
==========================================
- Coverage 30.31% 30.31% -0.01%
==========================================
Files 177 177
Lines 19752 19754 +2
Branches 3246 3247 +1
==========================================
Hits 5988 5988
- Misses 13757 13759 +2
Partials 7 7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This is the dynamic inventory configuration I used to test this, there is no integration test for dynamic inventory as far as I can tell: ---
plugin: google.cloud.gcp_compute
zones:
- us-central1-a
- us-central1-f
projects:
- it-cloud-gcp-eco-ansible-gcp
filters:
- status = RUNNING
service_account_file: /path/to/my/sa.json
auth_kind: serviceaccount
scopes:
- 'https://www.googleapis.com/auth/cloud-platform'
- 'https://www.googleapis.com/auth/compute.readonly'
keyed_groups:
# Create groups from GCE labels
- prefix: gcp
key: labels
name_suffix: .redhat.com
hostnames:
# List host by name instead of the default public ip
- hostname
- name |
p3ck
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - If you want to add some inventory test cases you can look at how it's done in azure...
https://github.com/ansible-collections/azure/tree/dev/tests/integration/targets/inventory_azure
|
Oh cool, I was just looking into how to test this, thanks |
Signed-off-by: Jorge Gallegos <[email protected]>
I have added a whole new integration test to assert the changes in this tiny commit, PTAL @p3ck |
Signed-off-by: Jorge Gallegos <[email protected]>
|
This one supersedes #219 as well |
SUMMARY
Fixes #434
It is basically the same as #438 but with a few extra checks.
ISSUE TYPE
COMPONENT NAME
plugins/inventory/gcp_compute.py
ADDITIONAL INFORMATION