Hi all,
I run the following playbook to add a new template to an existing host but without success.
The playbook:
- name: Set variables
set_fact:
zabbix_api_token: 60460362b83e4407f76863c40c60f082c375d0ddccdd220108c246f0efc26e2e
ansible_network_os: community.zabbix.zabbix
ansible_connection: httpapi
ansible_httpapi_port: 443
ansible_httpapi_use_ssl: true
ansible_httpapi_validate_certs: true
ansible_host: zabbix.server.ch
ansible_zabbix_url_path: monitoring
- name: Set API token
set_fact:
ansible_zabbix_auth_key: "{{ zabbix_api_token }}"
- name: Add template UNIFR RedHat to '{{ var_hosts }}'
community.zabbix.zabbix_host:
host_name: "{{ var_hosts }}"
link_templates:
- "UNIFR RedHat"
delegate_to: localhost`
My error :
"msg": "connection error occurred: REST API returned {'code': -32602, 'message': 'Invalid params.', 'data': 'Incorrect arguments passed to function.'} when sending {\"jsonrpc\": \"2.0\", \"method\": \"host.update\", \"id\": \"8a7590a9-dfd8-4eda-8ea9-14a7e3f51744\", \"params\": {\"hostid\": \"10667\", \"groups\": [{\"groupid\": \"2\"}], \"status\": 0, \"monitored_by\": 0, \"interfaces\": [{\"main\": 1, \"useip\": 1, \"ip\": \"134.21.83.154\", \"dns\": \"\", \"port\": \"10050\", \"interfaceid\": \"97\", \"hostid\": \"10667\", \"type\": 1, \"available\": \"1\", \"error\": \"\", \"errors_from\": \"0\", \"disable_until\": \"0\", \"details\": {\"version\": 2, \"bulk\": 1, \"community\": \"\", \"securityname\": \"\", \"contextname\": \"\", \"securitylevel\": 0, \"authprotocol\": 0, \"authpassphrase\": \"\", \"privprotocol\": 0, \"privpassphrase\": \"\"}}]}, \"auth\": \"60460362b83e4407f76863c40c60f082c375d0ddccdd220108c246f0efc26e2e\"}",
What is wrong ?
I need help.
Regards
Olivier