Adding hostname support to dynamic inventory#689
Adding hostname support to dynamic inventory#689SirGitsalot merged 3 commits intoansible-collections:masterfrom
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 <jgallego@redhat.com>
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.
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 <jgallego@redhat.com>
I have added a whole new integration test to assert the changes in this tiny commit, PTAL @p3ck |
Signed-off-by: Jorge Gallegos <jgallego@redhat.com>
|
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