Closed
Description
SUMMARY
Since Zabbix 6.4, the user property used in this module is removed. Now there is an issue when trying to login :
ISSUE TYPE
- Bug Report
COMPONENT NAME
zabbix_host
ANSIBLE VERSION
ansible 2.9.27
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.6.8 (default, Mar 25 2022, 11:15:52) [GCC 8.5.0 20210514 (Red Hat 8.5.0-10)]
STEPS TO REPRODUCE
Add an host via zabbix_host module.
- name: zabbix
hosts: localhost
connection: local
gather_facts: false
vars:
ansible_user: "xxxxxxxxx"
ansible_httpapi_pass: "yyyyyyyy"
ansible_host: SERVER-HOSTNAME
ansible_network_os: community.zabbix.zabbix
ansible_connection: httpapi
ansible_httpapi_port: 443
ansible_httpapi_use_ssl: true
ansible_httpapi_validate_certs: false
tasks:
- name: Add host to zabbix
community.zabbix.zabbix_host:
server_url: "ZABSERVER"
host_name: "MYSERVER"
host_groups: "WIN SERVER"
proxy: "ZABBIXPROXY"
interfaces:
- useip: 1
type: agent
dns: "MYSERVER"
ip: "192.168.0.1"
main: 1
tags:
- tag: WIN
EXPECTED RESULTS
Module zabbix_host add or modify an host
ACTUAL RESULTS
The module fail with this error :
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.module_utils.connection.ConnectionError: REST API returned {'code': -32602, 'message': 'Invalid params.', 'data': 'Invalid parameter "/": unexpected parameter "user".'} when sending {"jsonrpc": "2.0", "method": "user.login", "id": "XXXXXXXXXXXXXX", "params": {"user": null, "password": null}}
fatal: [localhost -> localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/ansible/.ansible/tmp/ansible-local-27554422c334m5s/ansible-tmp-1678218980.5616581-2755466-123084964497634/AnsiballZ_zabbix_host.py\", line 102, in <module>\n _ansiballz_main()\n File \"/home/ansible/.ansible/tmp/ansible-local-27554422c334m5s/ansible-tmp-1678218980.5616581-2755466-123084964497634/AnsiballZ_zabbix_host.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/ansible/.ansible/tmp/ansible-local-27554422c334m5s/ansible-tmp-1678218980.5616581-2755466-123084964497634/AnsiballZ_zabbix_host.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible_collections.community.zabbix.plugins.modules.zabbix_host', init_globals=None, run_name='__main__', alter_sys=True)\n File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n return _run_module_code(code, init_globals, run_name,
mod_spec)\n File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n mod_name, mod_spec, pkg_name, script_name)\n File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_community.zabbix.zabbix_host_payload_v2f5gr2f/ansible_community.zabbix.zabbix_host_payload.zip/ansible_collections/community/zabbix/plugins/modules/zabbix_host.py\", line 1289,
in <module>\n File \"/tmp/ansible_community.zabbix.zabbix_host_payload_v2f5gr2f/ansible_community.zabbix.zabbix_host_payload.zip/ansible_collections/community/zabbix/plugins/modules/zabbix_host.py\", line 1083,
in main\n File \"/tmp/ansible_community.zabbix.zabbix_host_payload_v2f5gr2f/ansible_community.zabbix.zabbix_host_payload.zip/ansible_collections/community/zabbix/plugins/module_utils/base.py\", line 33, in __init__\n File \"/tmp/ansible_community.zabbix.zabbix_host_payload_v2f5gr2f/ansible_community.zabbix.zabbix_host_payload.zip/ansible_collections/community/zabbix/plugins/module_utils/api_request.py\", line 53, in api_version\n File \"/tmp/ansible_community.zabbix.zabbix_host_payload_v2f5gr2f/ansible_community.zabbix.zabbix_host_payload.zip/ansible/module_utils/connection.py\", line 190, in __rpc__\nansible.module_utils.connection.ConnectionError: REST API returned {'code': -32602, 'message': 'Invalid params.', 'data': 'Invalid parameter \"/\": unexpected parameter \"user\".'} when sending {\"jsonrpc\": \"2.0\", \"method\": \"user.login\", \"id\": \"c82ee920-9286-4e77-9f60-4cfb719c535f\", \"params\": {\"user\": null, \"password\": null}}\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
Metadata
Metadata
Assignees
Labels
No labels