redhat-cop/infra.osbuild

create_blueprint doesn't handle a customization that isn't a dict

jce-redhat opened this issue · 0 comments

Given the following task:

    - name: Test simplified installer blueprint
      infra.osbuild.create_blueprint:
        dest: '/tmp/simplified-installer.toml'
        name: 'SimplifiedInstaller'
        customizations:
          installation_device: '/dev/vda'
          fdo:
            manufacturing_server_url: 'http://localhost:8080'
            diun_pub_key_insecure: 'true'

the module fails because it expects the value of installation_device to be a dict:

The full traceback is:
Traceback (most recent call last):
  File "/home/localadmin/.ansible/tmp/ansible-tmp-1677268275.112922-298401-175084841890454/AnsiballZ_create_blueprint.py", line 107, in <module>
    _ansiballz_main()
  File "/home/localadmin/.ansible/tmp/ansible-tmp-1677268275.112922-298401-175084841890454/AnsiballZ_create_blueprint.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/localadmin/.ansible/tmp/ansible-tmp-1677268275.112922-298401-175084841890454/AnsiballZ_create_blueprint.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.infra.osbuild.plugins.modules.create_blueprint', init_globals=dict(_module_fqn='ansible_collections.infra.osbuild.plugins.modules.create_blueprint', _modlib_path=modlib_path),
  File "/usr/lib64/python3.9/runpy.py", line 225, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib64/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_infra.osbuild.create_blueprint_payload_86zomdq9/ansible_infra.osbuild.create_blueprint_payload.zip/ansible_collections/infra/osbuild/plugins/modules/create_blueprint.py", line 204, in <module>
  File "/tmp/ansible_infra.osbuild.create_blueprint_payload_86zomdq9/ansible_infra.osbuild.create_blueprint_payload.zip/ansible_collections/infra/osbuild/plugins/modules/create_blueprint.py", line 180, in main
AttributeError: 'str' object has no attribute 'items'