ansible-collections / community.zabbix

Zabbix Ansible modules
http://galaxy.ansible.com/community/zabbix
Other
322 stars 284 forks source link

Invalid parameter "/output": value must be "extend". Zabbix 6.2 #729

Closed maximko closed 2 years ago

maximko commented 2 years ago
SUMMARY

Can't add a host to Zabbix 6.2

ISSUE TYPE
COMPONENT NAME

community.zabbix.zabbix_host

ANSIBLE VERSION
ansible [core 2.13.1]
  config file = /Users/maxi/.ansible.cfg
  configured module search path = ['/Users/maxi/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/6.0.0/libexec/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/maxi/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.10.5 (main, Jun 23 2022, 17:18:49) [Clang 12.0.0 (clang-1200.0.32.29)]
  jinja version = 3.1.2
  libyaml = True
CONFIGURATION
OS / ENVIRONMENT / Zabbix Version

Zabbix 6.2 community.zabbix 1.7.0

STEPS TO REPRODUCE
    - name: add host to zabbix
      local_action:
        module: community.zabbix.zabbix_host
        server_url: "{{ zbx_url }}"
        login_user: "{{ zbx_user }}"
        login_password: "{{ zbx_pass }}"
        host_name: "{{ DATACENTER }}.{{ ansible_nodename }}"
        visible_name: "{{ ansible_nodename }} {{ DATACENTER }}"
        host_groups:
          - Linux servers
        link_templates:
          - SSH Service
          - ICMP Ping
          - Linux by Zabbix agent
          - MD Soft RAID
          - SMART by Zabbix agent 2
        status: enabled
        state: present
        interfaces:
          - type: 1
            main: 1
            useip: 1
            ip: "{{ ansible_default_ipv4.address|default(ansible_all_ipv4_addresses[0]) }}"
            dns: ""
            port: "10050"
        validate_certs: no
EXPECTED RESULTS
ACTUAL RESULTS
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: zabbix_api.ZabbixAPIException: ('Error -32602: Invalid params., Invalid parameter "/output": value must be "extend". while sending {"jsonrpc": "2.0", "method": "hostgroup.get", "params": {"output": "groupid", "filter": {"name": ["Linux servers"]}}, "auth": "c63ef324724dbdc6103ffb59486d2edc", "id": 8}', -32602)
lzadjsf commented 2 years ago

Seems I fixed it. Working on adding my fix into repo.

maximko commented 2 years ago

Can confirm that PR #730 has fixed the issue. Thank you.

lzadjsf commented 2 years ago

Thank you for testing and feedback.