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
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

Comment