Bug 1748025 - ovirt_host_facts module returns wrong hrefs in nested values
Summary: ovirt_host_facts module returns wrong hrefs in nested values
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ansible
Version: 4.3.5
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ovirt-4.3.8
: ---
Assignee: Ondra Machacek
QA Contact: Pavol Brilla
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-02 13:49 UTC by Jan Zmeskal
Modified: 2020-03-09 12:46 UTC (History)
3 users (show)

Fixed In Version: ansible-2.9.1
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-09 12:46:47 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github ansible ansible pull 61841 0 'None' closed ovirt: Fix fetching of nested attributes 2020-03-09 12:44:02 UTC

Description Jan Zmeskal 2019-09-02 13:49:41 UTC
Description of problem:
When you execute ovirt_host_facts module against an engine, some of the returned nested values (specifically hrefs) are wrong.

Version-Release number of selected component (if applicable):
rhvm-4.3.5.5-0.1.el7.noarch
ansible-2.8.4-1.el7ae.noarch
python-ovirt-engine-sdk4-4.3.2-1.el7ev.x86_64

How reproducible:
100 %

Steps to Reproduce:
1. Have a playbook that extracts facts about one of your hosts. Example here:

- name: Test ovirt module
  hosts: localhost
  tasks:
    
    - ovirt_auth:
        url: https://<engine_url>/ovirt-engine/api
        username: admin@internal
        password: <password>
        insecure: yes

    - ovirt_host_facts:
        auth: "{{ ovirt_auth }}"
        fetch_nested: yes
        pattern: "name=host_mixed_1"
        all_content: no

    - debug:
        var: ovirt_hosts

2. Run the playbook
3. Examine the returned value

Actual results:
1. First problem is in 'permissions' key of 'ovirt_hosts' fact. This is what is returned by Ansible: https://pastebin.com/YWdjs99d
This is what can be seen in API: https://pastebin.com/CmFNxFFs
As you can see, one of the permissions returned 'null' in 'href' key. However, when inspecting the RHV API, the same permission has valid href that can be followed when put into address line in browser. By following it, I found out that it is 'SuperUser' role of user 'admin'. I also did the same experiment at another RHV engine (of version 4.3.6) and observed the same.

2. There's a different 'href' for network attachment in returned ansible value and in API.
This is returned by ansible: https://pastebin.com/JVN6iSFv
This can be seen in API: https://pastebin.com/SEeuRNeh

Expected results:
Values returned by running ovirt_host_facts and those acquired by querying API should be consistent.

Comment 1 Pavol Brilla 2019-10-04 09:10:32 UTC
Very similar issue is raised by ovirt_cluster_facts module:

Permissions returned 'null' in 'href' key. However, when inspecting the RHV API, it is 'SuperUser' role of user 'admin' - that why I think it is same as one above for ovirt_hosts_facts

Comment 2 Pavol Brilla 2019-12-18 10:59:57 UTC
Persmission has only correct ids, href links were removed from modules.


Installed Packages
rhvm.noarch                                      4.3.8.1-0.1.master.el7                                      @rhv-4.3.8
[root@10-37-138-97 ~]# ansible --version
ansible 2.9.2


Note You need to log in before you can comment on or make changes to this bug.