-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement contructable support for opennebula inventory plugin: keyed… (
#4524) * Implement contructable support for opennebula inventory plugin: keyed_groups, compose, groups * Fixed templating mock issues in unit tests, corrected some linting errors * trying to make the linter happy * Now trying to make python2.7 happy * Added changelog fragment * changelog fragment needs pluralization * Update changelogs/fragments/4524-update-opennebula-inventory-plugin-to-match-documentation.yaml Co-authored-by: Felix Fontein <[email protected]> Co-authored-by: Felix Fontein <[email protected]>
- Loading branch information
1 parent
d9ba598
commit 8e72e98
Showing
4 changed files
with
342 additions
and
26 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
changelogs/fragments/4524-update-opennebula-inventory-plugin-to-match-documentation.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
bugfixes: | ||
- opennebula inventory plugin - complete the implementation of ``constructable`` for opennebula inventory plugin. Now ``keyed_groups``, ``compose``, ``groups`` actually work (https://github.com/ansible-collections/community.general/issues/4497). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
222 changes: 222 additions & 0 deletions
222
tests/unit/plugins/inventory/fixtures/opennebula_inventory.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,222 @@ | ||
[ | ||
{ | ||
"DEPLOY_ID": "bcfec9d9-c0d0-4523-b5e7-62993947e94c", | ||
"ETIME": 0, | ||
"GID": 105, | ||
"GNAME": "SW", | ||
"HISTORY_RECORDS": {}, | ||
"ID": 451, | ||
"LAST_POLL": 0, | ||
"LCM_STATE": 3, | ||
"MONITORING": {}, | ||
"NAME": "terraform_demo_00", | ||
"RESCHED": 0, | ||
"STATE": 3, | ||
"STIME": 1649886492, | ||
"TEMPLATE": { | ||
"NIC": [ | ||
{ | ||
"AR_ID": "0", | ||
"BRIDGE": "mgmt0", | ||
"BRIDGE_TYPE": "linux", | ||
"CLUSTER_ID": "0", | ||
"IP": "192.168.11.248", | ||
"MAC": "02:00:c0:a8:2b:bb", | ||
"MODEL": "virtio", | ||
"NAME": "NIC0", | ||
"NETWORK": "Infrastructure", | ||
"NETWORK_ID": "0", | ||
"NIC_ID": "0", | ||
"SECURITY_GROUPS": "0,101", | ||
"TARGET": "one-453-0", | ||
"VLAN_ID": "12", | ||
"VN_MAD": "802.1Q" | ||
} | ||
], | ||
"NIC_DEFAULT": { | ||
"MODEL": "virtio" | ||
}, | ||
"TEMPLATE_ID": "28", | ||
"TM_MAD_SYSTEM": "shared", | ||
"VCPU": "4", | ||
"VMID": "453" | ||
}, | ||
"USER_TEMPLATE": { | ||
"GUEST_OS": "linux", | ||
"INPUTS_ORDER": "", | ||
"LABELS": "foo,bench", | ||
"LOGO": "images/logos/linux.png", | ||
"MEMORY_UNIT_COST": "MB", | ||
"SCHED_REQUIREMENTS": "ARCH=\"x86_64\"", | ||
"TGROUP": "bench_clients" | ||
} | ||
}, | ||
{ | ||
"DEPLOY_ID": "25895435-5e3a-4d50-a025-e03a7a463abd", | ||
"ETIME": 0, | ||
"GID": 105, | ||
"GNAME": "SW", | ||
"HISTORY_RECORDS": {}, | ||
"ID": 451, | ||
"LAST_POLL": 0, | ||
"LCM_STATE": 3, | ||
"MONITORING": {}, | ||
"NAME": "terraform_demo_01", | ||
"RESCHED": 0, | ||
"STATE": 3, | ||
"STIME": 1649886492, | ||
"TEMPLATE": { | ||
"NIC": [ | ||
{ | ||
"AR_ID": "0", | ||
"BRIDGE": "mgmt0", | ||
"BRIDGE_TYPE": "linux", | ||
"CLUSTER_ID": "0", | ||
"IP": "192.168.11.241", | ||
"MAC": "02:00:c0:a8:4b:bb", | ||
"MODEL": "virtio", | ||
"NAME": "NIC0", | ||
"NETWORK": "Infrastructure", | ||
"NETWORK_ID": "0", | ||
"NIC_ID": "0", | ||
"SECURITY_GROUPS": "0,101", | ||
"TARGET": "one-451-0", | ||
"VLAN_ID": "12", | ||
"VN_MAD": "802.1Q" | ||
} | ||
], | ||
"NIC_DEFAULT": { | ||
"MODEL": "virtio" | ||
}, | ||
"TEMPLATE_ID": "28", | ||
"TM_MAD_SYSTEM": "shared", | ||
"VCPU": "4", | ||
"VMID": "451" | ||
}, | ||
"USER_TEMPLATE": { | ||
"GUEST_OS": "linux", | ||
"INPUTS_ORDER": "", | ||
"LABELS": "foo,bench", | ||
"LOGO": "images/logos/linux.png", | ||
"MEMORY_UNIT_COST": "MB", | ||
"SCHED_REQUIREMENTS": "ARCH=\"x86_64\"", | ||
"TESTATTR": "testvar", | ||
"TGROUP": "bench_clients" | ||
} | ||
}, | ||
{ | ||
"DEPLOY_ID": "2b00c379-3601-45ee-acf5-e7b3ff2b7bca", | ||
"ETIME": 0, | ||
"GID": 105, | ||
"GNAME": "SW", | ||
"HISTORY_RECORDS": {}, | ||
"ID": 451, | ||
"LAST_POLL": 0, | ||
"LCM_STATE": 3, | ||
"MONITORING": {}, | ||
"NAME": "terraform_demo_srv_00", | ||
"RESCHED": 0, | ||
"STATE": 3, | ||
"STIME": 1649886492, | ||
"TEMPLATE": { | ||
"NIC": [ | ||
{ | ||
"AR_ID": "0", | ||
"BRIDGE": "mgmt0", | ||
"BRIDGE_TYPE": "linux", | ||
"CLUSTER_ID": "0", | ||
"IP": "192.168.11.247", | ||
"MAC": "02:00:c0:a8:0b:cc", | ||
"MODEL": "virtio", | ||
"NAME": "NIC0", | ||
"NETWORK": "Infrastructure", | ||
"NETWORK_ID": "0", | ||
"NIC_ID": "0", | ||
"SECURITY_GROUPS": "0,101", | ||
"TARGET": "one-452-0", | ||
"VLAN_ID": "12", | ||
"VN_MAD": "802.1Q" | ||
} | ||
], | ||
"NIC_DEFAULT": { | ||
"MODEL": "virtio" | ||
}, | ||
"TEMPLATE_ID": "28", | ||
"TM_MAD_SYSTEM": "shared", | ||
"VCPU": "4", | ||
"VMID": "452" | ||
}, | ||
"USER_TEMPLATE": { | ||
"GUEST_OS": "linux", | ||
"INPUTS_ORDER": "", | ||
"LABELS": "serv,bench", | ||
"LOGO": "images/logos/linux.png", | ||
"MEMORY_UNIT_COST": "MB", | ||
"SCHED_REQUIREMENTS": "ARCH=\"x86_64\"", | ||
"TGROUP": "bench_server" | ||
} | ||
}, | ||
{ | ||
"DEPLOY_ID": "97037f55-dd2c-4549-8d24-561a6569e870", | ||
"ETIME": 0, | ||
"GID": 105, | ||
"GNAME": "SW", | ||
"HISTORY_RECORDS": {}, | ||
"ID": 311, | ||
"LAST_POLL": 0, | ||
"LCM_STATE": 3, | ||
"MONITORING": {}, | ||
"NAME": "bs-windows", | ||
"RESCHED": 0, | ||
"STATE": 3, | ||
"STIME": 1648076254, | ||
"TEMPLATE": { | ||
"NIC": [ | ||
{ | ||
"AR_ID": "0", | ||
"BRIDGE": "mgmt0", | ||
"BRIDGE_TYPE": "linux", | ||
"CLUSTER_ID": "0", | ||
"IP": "192.168.11.209", | ||
"MAC": "02:00:c0:a8:0b:dd", | ||
"MODEL": "virtio", | ||
"NAME": "NIC0", | ||
"NETWORK": "Infrastructure", | ||
"NETWORK_ID": "0", | ||
"NETWORK_UNAME": "admin", | ||
"NIC_ID": "0", | ||
"SECURITY_GROUPS": "0,101", | ||
"TARGET": "one-311-0", | ||
"VLAN_ID": "12", | ||
"VN_MAD": "802.1Q" | ||
}, | ||
[ | ||
"TEMPLATE_ID", | ||
"23" | ||
], | ||
[ | ||
"TM_MAD_SYSTEM", | ||
"shared" | ||
], | ||
[ | ||
"VCPU", | ||
"4" | ||
], | ||
[ | ||
"VMID", | ||
"311" | ||
] | ||
] | ||
}, | ||
"UID": 22, | ||
"UNAME": "bsanders", | ||
"USER_TEMPLATE": { | ||
"GUEST_OS": "windows", | ||
"INPUTS_ORDER": "", | ||
"LABELS": "serv", | ||
"HYPERVISOR": "kvm", | ||
"SCHED_REQUIREMENTS": "ARCH=\"x86_64\"", | ||
"SET_HOSTNAME": "windows" | ||
} | ||
} | ||
] |
Oops, something went wrong.