oVirt/ovirt-ansible-collection

ovirt_host kernel_params fails with "sequence item 0: expected str instance, dict found"

uli-weltersbach opened this issue · 0 comments

SUMMARY

According to the documentation, kernel_params can be provided in this format:

kernel_params:
  - intel_iommu=on

Source:

COMPONENT NAME

ovirt_host

STEPS TO REPRODUCE
- name: Reproduce issue
  hosts: localhost
  tasks:
    - name: oVirt auth
      ovirt.ovirt.ovirt_auth:
        url: https://engine.company.com/ovirt-engine/api
        username: user
        password: secret

    - name: Run task with arguments found in documentation
      ovirt.ovirt.ovirt_host:
        auth: "{{ ovirt_auth }}"
        name: host-123
        password: another secret
        address: host-123.company.com
        state: present
        kernel_params:
          - intel_iommu=on

AFAIK we're running version 4.4.1.10-1.el8 of oVirt (in case this is about incompatibility with the REST API):
image

We're running the following combination of packages:

ansible-compat          2.2.1     
ansible-core            2.13.5    <------
ansible-lint            6.8.2    
attrs                   22.1.0   
black                   22.10.0  
bracex                  2.3.post1
certifi                 2022.9.24
cffi                    1.15.1   
charset-normalizer      2.1.1    
click                   8.1.3    
commonmark              0.9.1    
cryptography            38.0.1   
dnspython               2.2.1    
filelock                3.8.0    
idna                    3.4      
Jinja2                  3.1.2    
jmespath                1.0.1
jsonschema              4.16.0
MarkupSafe              2.1.1
mypy-extensions         0.4.3
netaddr                 0.8.0
ntlm-auth               1.5.0
ovirt-engine-sdk-python 4.5.2      <------
packaging               21.3
pathspec                0.10.1
pip                     21.2.4
platformdirs            2.5.2
pycparser               2.21
pycurl                  7.45.1
Pygments                2.13.0
pyparsing               3.0.9
pyrsistent              0.18.1
pywinrm                 0.4.3
PyYAML                  6.0
requests                2.28.1
requests-ntlm           1.1.0
resolvelib              0.8.1
rich                    12.6.0
ruamel.yaml             0.17.21
ruamel.yaml.clib        0.2.6
setuptools              57.5.0
six                     1.16.0
subprocess-tee          0.3.5
tomli                   2.0.1
urllib3                 1.26.12
wcmatch                 8.4.1
wheel                   0.37.0
xmltodict               0.13.0
yamllint                1.28.0
EXPECTED RESULTS

The kernel_params don't cause an error and are set on the host.

ACTUAL RESULTS
TypeError: sequence item 0: expected str instance, dict found
fatal: [localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "activate": true,
            "address": "host-123.company.com",
            "check_upgrade": true,
            "cluster": null,
            "comment": null,
            "enroll_certificate": false,
            "fetch_nested": false,
            "force": false,
            "hosted_engine": null,
            "id": null,
            "iscsi": null,
            "kdump_integration": null,
            "kernel_params": [
                {
                    "intel_iommu": "on"
                }
            ],
            "name": "host-123",
            "nested_attributes": [],
            "override_display": null,
            "override_iptables": null,
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "poll_interval": 3,
            "power_management_enabled": null,
            "public_key": false,
            "reboot_after_installation": null,
            "reboot_after_upgrade": true,
            "spm_priority": null,
            "ssh_port": null,
            "state": "present",
            "timeout": 600,
            "vgpu_placement": null,
            "wait": true
        }
    },
    "msg": "sequence item 0: expected str instance, dict found"
}