Ad Widget

Collapse

Error module ansible zabbix useradd: 'userid' exception.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • david_zab
    Junior Member
    • Nov 2023
    • 10

    #1

    Error module ansible zabbix useradd: 'userid' exception.

    Hi all and thanks in advance

    Until I update my Zabbix cluster server 7.0.6 to 7.0.10, I have an error when I try to add/modify user with module ansible zabbix 3.2.0:

    KeyError: 'userid' exception.

    I find solution on Internet and it seems to have a changment on zabbix 7.0.9 who don't return any userid when we try to add/modify user.
    I try on my DEV host to modify this file "community/zabbix/plugins/modules/zabbix_user.py" near line 479:

    Before fix:

    if "user_medias" in existing_data and existing_data["user_medias"]:
    for user_media in existing_data["user_medias"]:
    for del_key in ["mediaid", "userid"]:
    del user_media[del_key]


    After fix:

    if "user_medias" in existing_data and existing_data["user_medias"]:
    for user_media in existing_data["user_medias"]:
    if "userid" in user_media:
    del user_media["user_id"]

    for del_key in ["mediaid"]: #Remove user_id
    del user_media[del_key]

    And it seems to be OK​, I can add user with ansible. But I don't know if this can break anything...

    Do you know this problem and is a patch planned?



    Have a good day

    Best regards


    ------
    Zabbix Server 7.0.10
    Postgresql 14
    Rocky 8
    python 3.11
    Ansible 9.1.0 core 2.16.2
    module zabbix_community: 3.2.0


  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    As long as I know, ansible community modules for Zabbix are not maintained by Zabbix...
    It would make more sense to ask from there.. https://github.com/ansible-collectio....zabbix/issues

    Comment

    • david_zab
      Junior Member
      • Nov 2023
      • 10

      #3
      Hi and thank you for your response, I don't know that, ok I try to post on github
      Have a good day

      Comment

      Working...