Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User Module: TypeError 'user_dn' #111

Closed
KiLLuuuhh opened this issue Apr 24, 2024 · 0 comments · Fixed by #112
Closed

User Module: TypeError 'user_dn' #111

KiLLuuuhh opened this issue Apr 24, 2024 · 0 comments · Fixed by #112
Assignees
Labels
bug Something isn't working

Comments

@KiLLuuuhh
Copy link
Contributor

Describe the bug
While trying the version 1.1.0 of the Ansible Collection, we ran into the following issue:

TASK [opnsense_manage : Get api key] *********************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TypeError: __init__() got an unexpected keyword argument 'user_dn'
fatal: [HOSTNAME]: FAILED! => changed=false 
  module_stderr: |-
    Traceback (most recent call last):
      File "<stdin>", line 107, in <module>
      File "<stdin>", line 99, in _ansiballz_main
      File "<stdin>", line 47, in invoke_module
      File "/usr/local/lib/python3.9/runpy.py", line 225, in run_module
        return _run_module_code(code, init_globals, run_name, mod_spec)
      File "/usr/local/lib/python3.9/runpy.py", line 97, in _run_module_code
        _run_code(code, mod_globals, init_globals,
      File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "/tmp/ansible_puzzle.opnsense.system_access_users_payload_lkxxt140/ansible_puzzle.opnsense.system_access_users_payload.zip/ansible_collections/puzzle/opnsense/plugins/modules/system_access_users.py", line 268, in <module>
      File "/tmp/ansible_puzzle.opnsense.system_access_users_payload_lkxxt140/ansible_puzzle.opnsense.system_access_users_payload.zip/ansible_collections/puzzle/opnsense/plugins/modules/system_access_users.py", line 227, in main
      File "/tmp/ansible_puzzle.opnsense.system_access_users_payload_lkxxt140/ansible_puzzle.opnsense.system_access_users_payload.zip/ansible_collections/puzzle/opnsense/plugins/module_utils/system_access_users_utils.py", line 576, in __init__
      File "/tmp/ansible_puzzle.opnsense.system_access_users_payload_lkxxt140/ansible_puzzle.opnsense.system_access_users_payload.zip/ansible_collections/puzzle/opnsense/plugins/module_utils/system_access_users_utils.py", line 612, in _load_users
      File "/tmp/ansible_puzzle.opnsense.system_access_users_payload_lkxxt140/ansible_puzzle.opnsense.system_access_users_payload.zip/ansible_collections/puzzle/opnsense/plugins/module_utils/system_access_users_utils.py", line 612, in <listcomp>
      File "/tmp/ansible_puzzle.opnsense.system_access_users_payload_lkxxt140/ansible_puzzle.opnsense.system_access_users_payload.zip/ansible_collections/puzzle/opnsense/plugins/module_utils/system_access_users_utils.py", line 523, in from_xml
    TypeError: __init__() got an unexpected keyword argument 'user_dn'
  module_stdout: ''
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1

It seems that the argument user_dn isn't handled in the system_access_users module.

To Reproduce
Steps to reproduce the behavior:

  1. Create Playbook entry like:
- name: Get api key
  puzzle.opnsense.system_access_users:
    username: example_user
    password: "{{ ansible_password }}"
    apikeys: ""
  register: root_api_keys
  1. run play against an OPNsense Instance
  2. see error as described above

Expected behavior
The argument user_dn and other unkown arguments are expected and handled by the system_access_users module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants