F5Networks / f5-ansible-f5os

Collection for managing F5OS based devices
2 stars 1 forks source link

f5os_lldp_config fails to set system-name #11

Open MVogel91 opened 1 week ago

MVogel91 commented 1 week ago
COMPONENT NAME

f5os_lldp_config

Environment

ANSIBLE VERSION
ansible [core 2.17.1]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.10/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.1.4
  libyaml = True
F5OS VERSION
1.5.2-21056
CONFIGURATION
OS / ENVIRONMENT

N/A

SUMMARY

Running f5os_lldp_config requires the system config to already have a system name set in LLDP. If the name is not set, the module fails. If the system-name pre-exists, the module runs fine.

STEPS TO REPRODUCE

Have a blank F5OS system with LLDP system-name not set. Run a playbook.

    - name: Set LLDP
      f5os_lldp_config:
        system_name: "{{ inventory_hostname }}"
        enabled: true
EXPECTED RESULTS

Enables LLDP and sets the system name.

ACTUAL RESULTS
The full traceback is:
Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-local-46775i6oqwvh/ansible-tmp-1719219843.769013-4915-218168108677903/AnsiballZ_f5os_lldp_config.py", line 107, in <module>
    _ansiballz_main()
  File "/root/.ansible/tmp/ansible-local-46775i6oqwvh/ansible-tmp-1719219843.769013-4915-218168108677903/AnsiballZ_f5os_lldp_config.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/root/.ansible/tmp/ansible-local-46775i6oqwvh/ansible-tmp-1719219843.769013-4915-218168108677903/AnsiballZ_f5os_lldp_config.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.f5networks.f5os.plugins.modules.f5os_lldp_config', init_globals=dict(_module_fqn='ansible_collections.f5networks.f5os.plugins.modules.f5os_lldp_config', _modlib_path=modlib_path),
  File "/usr/lib/python3.10/runpy.py", line 224, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_f5os_lldp_config_payload_wt_ke_ah/ansible_f5os_lldp_config_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/f5os_lldp_config.py", line 726, in <module>
  File "/tmp/ansible_f5os_lldp_config_payload_wt_ke_ah/ansible_f5os_lldp_config_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/f5os_lldp_config.py", line 719, in main
  File "/tmp/ansible_f5os_lldp_config_payload_wt_ke_ah/ansible_f5os_lldp_config_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/f5os_lldp_config.py", line 450, in exec_module
  File "/tmp/ansible_f5os_lldp_config_payload_wt_ke_ah/ansible_f5os_lldp_config_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/f5os_lldp_config.py", line 463, in present
  File "/tmp/ansible_f5os_lldp_config_payload_wt_ke_ah/ansible_f5os_lldp_config_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/f5os_lldp_config.py", line 637, in exists
KeyError: 'system-name'
fatal: [10.170.9.37]: FAILED! => {
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-local-46775i6oqwvh/ansible-tmp-1719219843.769013-4915-218168108677903/AnsiballZ_f5os_lldp_config.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-local-46775i6oqwvh/ansible-tmp-1719219843.769013-4915-218168108677903/AnsiballZ_f5os_lldp_config.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-local-46775i6oqwvh/ansible-tmp-1719219843.769013-4915-218168108677903/AnsiballZ_f5os_lldp_config.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.f5networks.f5os.plugins.modules.f5os_lldp_config', init_globals=dict(_module_fqn='ansible_collections.f5networks.f5os.plugins.modules.f5os_lldp_config', _modlib_path=modlib_path),\n  File \"/usr/lib/python3.10/runpy.py\", line 224, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib/python3.10/runpy.py\", line 96, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_f5os_lldp_config_payload_wt_ke_ah/ansible_f5os_lldp_config_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/f5os_lldp_config.py\", line 726, in <module>\n  File \"/tmp/ansible_f5os_lldp_config_payload_wt_ke_ah/ansible_f5os_lldp_config_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/f5os_lldp_config.py\", line 719, in main\n  File \"/tmp/ansible_f5os_lldp_config_payload_wt_ke_ah/ansible_f5os_lldp_config_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/f5os_lldp_config.py\", line 450, in exec_module\n  File \"/tmp/ansible_f5os_lldp_config_payload_wt_ke_ah/ansible_f5os_lldp_config_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/f5os_lldp_config.py\", line 463, in present\n  File \"/tmp/ansible_f5os_lldp_config_payload_wt_ke_ah/ansible_f5os_lldp_config_payload.zip/ansible_collections/f5networks/f5os/plugins/modules/f5os_lldp_config.py\", line 637, in exists\nKeyError: 'system-name'\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}
pgouband commented 1 week ago

Hi,

Thanks for reporting. Added to the backlog and internal tracking ID for this request is: INFRAANO-1604.