Bug 1653743
Summary: | [RFE] ansible modules facts - return nested information for all elements with 'href' attribute | ||
---|---|---|---|
Product: | Red Hat Enterprise Virtualization Manager | Reporter: | Lucie Leistnerova <lleistne> |
Component: | ansible | Assignee: | Martin Necas <mnecas> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Pavol Brilla <pbrilla> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 4.3.0 | CC: | lsvaty, mgoldboi, mperina, omachace, pbrilla |
Target Milestone: | ovirt-4.3.7 | Keywords: | FutureFeature, ZStream |
Target Release: | --- | Flags: | lleistne:
testing_plan_complete?
|
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | ansible-2.8.4-1.el7ae | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-01-09 13:25:51 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | Infra | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Lucie Leistnerova
2018-11-27 14:28:05 UTC
Direct elements works, e.g. disks: <quota href="/ovirt-engine/api/datacenters/87bc2e30-f3b1-11e8-aa7d-001a4a013f36/quotas/96f2a2e4-f3b1-11e8-82b6-001a4a013f36" id="96f2a2e4-f3b1-11e8-82b6-001a4a013f36"/> --> "quota": { "href": "/ovirt-engine/api/datacenters/87bc2e30-f3b1-11e8-aa7d-001a4a013f36/quotas/96f2a2e4-f3b1-11e8-82b6-001a4a013f36", "id": "96f2a2e4-f3b1-11e8-82b6-001a4a013f36", "name": "Default" }, But when the element is in a list or other element, it doesn't work, e.g. in disks: <storage_domains> <storage_domain href="/ovirt-engine/api/storagedomains/82ceb4c9-e844-4fc7-b0ff-559052e6301f" id="82ceb4c9-e844-4fc7-b0ff-559052e6301f"/> </storage_domains> --> "storage_domains": [ { "href": "/ovirt-engine/api/storagedomains/82ceb4c9-e844-4fc7-b0ff-559052e6301f", "id": "82ceb4c9-e844-4fc7-b0ff-559052e6301f" } ], or template: <version> <version_name>base version</version_name> <version_number>1</version_number> <base_template href="/ovirt-engine/api/templates/264640fc-1b51-4263-995b-47e3e9dd3c8f" id="264640fc-1b51-4263-995b-47e3e9dd3c8f"/> </version> --> "version": { "base_template": { "href": "/ovirt-engine/api/templates/264640fc-1b51-4263-995b-47e3e9dd3c8f", "id": "264640fc-1b51-4263-995b-47e3e9dd3c8f" }, "version_name": "base version", "version_number": 1 }, Tested in ansible-2.8.0-0.9.rc3.el7ae.noarch One other thing I've found, ovirt_host_facts returns more on <cluster> than needed when not nested. ovirt_host_facts: auth: "{{ ovirt_auth }}" pattern: "name=vhost*" fetch_nested: True nested_attributes: - name returns correctly: "cluster": { "href": "/ovirt-engine/api/clusters/87c0c65c-f3b1-11e8-9209-001a4a013f36", "id": "87c0c65c-f3b1-11e8-9209-001a4a013f36", "name": "Default" }, but with fetch_nested: False returns all information on the cluster "cluster": { "affinity_groups": [], "ballooning_enabled": false, "comment": "", "cpu": { "architecture": "x86_64", "type": "Intel Westmere Family" }, .... But in module ovirt_vm_facts it works as expected. We fetch this info in ovirt_host_facts, so we are able to compare cluster version and filter it. This is different issue only in ovirt_host_facts. Can you please open an issue for that module. Done - BZ 1719303 ansible-2.8.3 has been released, please check this bug is fixed there. Can we get this verified? Working for storage_domains in disks, but for base_template in element version in template still doesn't return name of template ansible localhost -m ovirt_template_facts -a 'pattern="name=*" fetch_nested=True nested_attributes=name' ...... "version": { "base_template": { "href": "/ovirt-engine/api/templates/154f10b7-de72-4b0b-87cf-54a52d7ad035", "id": "154f10b7-de72-4b0b-87cf-54a52d7ad035" }, ...... VS <template href="/ovirt-engine/api/templates/154f10b7-de72-4b0b-87cf-54a52d7ad035" id="154f10b7-de72-4b0b-87cf-54a52d7ad035"> ..... <name>golden_template_rhel7.7</name> # ansible --version ansible 2.8.4 (In reply to Pavol Brilla from comment #10) > Working for storage_domains in disks, but for base_template in element > version in template still doesn't return name of template > > ansible localhost -m ovirt_template_facts -a 'pattern="name=*" > fetch_nested=True nested_attributes=name' > ...... > "version": { > "base_template": { > "href": > "/ovirt-engine/api/templates/154f10b7-de72-4b0b-87cf-54a52d7ad035", > "id": "154f10b7-de72-4b0b-87cf-54a52d7ad035" > }, > ...... > > VS > > <template > href="/ovirt-engine/api/templates/154f10b7-de72-4b0b-87cf-54a52d7ad035" > id="154f10b7-de72-4b0b-87cf-54a52d7ad035"> > ..... > <name>golden_template_rhel7.7</name> > > > > # ansible --version > ansible 2.8.4 Going over each nested attribute attributes and checking if it's a link would bring much bigger time complexity, for no value IMHO. We should document that by default we go only over first level attributes, not any other level of attribute and maybe add parameter which enables going deeper, but I would close this bug, and open new one to track this. Moving back to ON_QA. Issue opened for clarification: https://github.com/ansible/ansible/issues/63127 As previously stated other cases verified Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2019:2543 |