You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The environment variables for host, username, and password are set. I get the following error:
TASK [Create lab] ************************************************************** An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'user' fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/<redacted>/.ansible/tmp/ansible-tmp-1729872399.4116898-239694-106795014035904/AnsiballZ_cml_lab.py\", line 107, in <module>\n _ansiballz_main()\n File \"/home/<redacted>/.ansible/tmp/ansible-tmp-1729872399.4116898-239694-106795014035904/AnsiballZ_cml_lab.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/<redacted>/.ansible/tmp/ansible-tmp-1729872399.4116898-239694-106795014035904/AnsiballZ_cml_lab.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.cisco.cml.plugins.modules.cml_lab', init_globals=dict(_module_fqn='ansible_collections.cisco.cml.plugins.modules.cml_lab', _modlib_path=modlib_path),\n File \"<frozen runpy>\", line 226, in run_module\n File \"<frozen runpy>\", line 98, in _run_module_code\n File \"<frozen runpy>\", line 88, in _run_code\n File \"/tmp/ansible_cisco.cml.cml_lab_payload_xkju8_gw/ansible_cisco.cml.cml_lab_payload.zip/ansible_collections/cisco/cml/plugins/modules/cml_lab.py\", line 196, in <module>\n File \"/tmp/ansible_cisco.cml.cml_lab_payload_xkju8_gw/ansible_cisco.cml.cml_lab_payload.zip/ansible_collections/cisco/cml/plugins/modules/cml_lab.py\", line 192, in main\n File \"/tmp/ansible_cisco.cml.cml_lab_payload_xkju8_gw/ansible_cisco.cml.cml_lab_payload.zip/ansible_collections/cisco/cml/plugins/modules/cml_lab.py\", line 130, in run_module\n File \"/tmp/ansible_cisco.cml.cml_lab_payload_xkju8_gw/ansible_cisco.cml.cml_lab_payload.zip/ansible_collections/cisco/cml/plugins/module_utils/cml_utils.py\", line 42, in __init__\nKeyError: 'user'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
If I use the 'user' argument to the module along with the environment variable, there is no longer an error, but there is a warning that both 'username' and 'user' are set, so it appears to be an underlying flaw in the Ansible module spec/params handling that is allowing it to work when the alias is used, but is not typing the alias in the params call back to the underlying 'username' value and fallback settings.
The text was updated successfully, but these errors were encountered:
There seems to be a disagreement between the module spec and the cmlModule init function in plugins/module_utils/cml_utils.py.
Using python 3.11.10 and Ansible-core 2.17.4.
When I go to create a lab using this task:
The environment variables for host, username, and password are set. I get the following error:
TASK [Create lab] ************************************************************** An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'user' fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/<redacted>/.ansible/tmp/ansible-tmp-1729872399.4116898-239694-106795014035904/AnsiballZ_cml_lab.py\", line 107, in <module>\n _ansiballz_main()\n File \"/home/<redacted>/.ansible/tmp/ansible-tmp-1729872399.4116898-239694-106795014035904/AnsiballZ_cml_lab.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/<redacted>/.ansible/tmp/ansible-tmp-1729872399.4116898-239694-106795014035904/AnsiballZ_cml_lab.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.cisco.cml.plugins.modules.cml_lab', init_globals=dict(_module_fqn='ansible_collections.cisco.cml.plugins.modules.cml_lab', _modlib_path=modlib_path),\n File \"<frozen runpy>\", line 226, in run_module\n File \"<frozen runpy>\", line 98, in _run_module_code\n File \"<frozen runpy>\", line 88, in _run_code\n File \"/tmp/ansible_cisco.cml.cml_lab_payload_xkju8_gw/ansible_cisco.cml.cml_lab_payload.zip/ansible_collections/cisco/cml/plugins/modules/cml_lab.py\", line 196, in <module>\n File \"/tmp/ansible_cisco.cml.cml_lab_payload_xkju8_gw/ansible_cisco.cml.cml_lab_payload.zip/ansible_collections/cisco/cml/plugins/modules/cml_lab.py\", line 192, in main\n File \"/tmp/ansible_cisco.cml.cml_lab_payload_xkju8_gw/ansible_cisco.cml.cml_lab_payload.zip/ansible_collections/cisco/cml/plugins/modules/cml_lab.py\", line 130, in run_module\n File \"/tmp/ansible_cisco.cml.cml_lab_payload_xkju8_gw/ansible_cisco.cml.cml_lab_payload.zip/ansible_collections/cisco/cml/plugins/module_utils/cml_utils.py\", line 42, in __init__\nKeyError: 'user'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
This looks to be a disagreement between
ansible-cml/plugins/module_utils/cml_utils.py
Line 42 in 716c622
ansible-cml/plugins/module_utils/cml_utils.py
Line 19 in 716c622
If I use the 'user' argument to the module along with the environment variable, there is no longer an error, but there is a warning that both 'username' and 'user' are set, so it appears to be an underlying flaw in the Ansible module spec/params handling that is allowing it to work when the alias is used, but is not typing the alias in the params call back to the underlying 'username' value and fallback settings.
The text was updated successfully, but these errors were encountered: