# Task failed during zabbix host group creation

**URL:** <https://forum.ansible.com/t/task-failed-during-zabbix-host-group-creation/43301>\
**Category:** Get Help\
**Tags:** zabbix\
**Created:** [June 11, 2025, 12:54pm UTC](https://forum.ansible.com/t/task-failed-during-zabbix-host-group-creation/43301 "2025-06-11T12:54:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eugene\_dev](https://avatars.discourse-cdn.com/v4/letter/e/e274bd/32.png) [@eugene\_dev](https://forum.ansible.com/u/eugene_dev)\
**Post date:** [June 11, 2025, 12:54pm UTC](https://forum.ansible.com/t/task-failed-during-zabbix-host-group-creation/43301/1 "2025-06-11T12:54:21Z")

</div>

Zabbix server version 7.2.3  
community.zabbix version 3.2.0

ansible tasks :

```auto
    - name: Set api configuration facts
      ansible.builtin.set_fact:
        ansible_network_os: community.zabbix.zabbix
        ansible_connection: httpapi
        ansible_httpapi_port: 80
        ansible_zabbix_url_path: ''
        ansible_host: "{{ zabbix_api_host }}"
        ansible_user: "{{ zabbix_api_user }}"

    - name: Create host groups
      community.zabbix.zabbix_group:
        host_group: "{{ item}}"
        state: present
      loop: "{{ host_group_names }}"

```

Error:  
`msg: "connection error occurred: REST API returned {'code': -32600, 'message': 'Invalid request.', 'data': 'Invalid parameter \"/\": unexpected parameter \"auth\".'} when sending {\"jsonrpc\": \"2.0\", \"method\": \"hostgroup.get\", \"id\": \"84d64475-e439-47fa-8266-7a071c64033e\", \"params\": {\"output\": \"extend\", \"filter\": {\"name\": [\"group_name\"]}}, \"auth\": \"auth_token\"}"`

---

<div class="post-metadata">

**Author:** ![markuman](https://avatars.discourse-cdn.com/v4/letter/m/7bcc69/32.png) [@markuman](https://forum.ansible.com/u/markuman)\
**Post date:** [June 12, 2025, 3:52am UTC](https://forum.ansible.com/t/task-failed-during-zabbix-host-group-creation/43301/2 "2025-06-12T03:52:33Z")

</div>

`host_group` is not a parameter. [community.zabbix.zabbix\_group module – Create/delete Zabbix host groups — Ansible Community Documentation](https://docs.ansible.com/ansible/latest/collections/community/zabbix/zabbix_group_module.html)  
It’s `host_groups` (plural). And there is no need for a loop. Just put an entire list in the parameter.

```yml
    - name: Create host groups
      community.zabbix.zabbix_group:
        state: present
        host_groups: "{{ host_group_names }}"

```

---

<div class="post-metadata">

**Author:** ![eugene\_dev](https://avatars.discourse-cdn.com/v4/letter/e/e274bd/32.png) [@eugene\_dev](https://forum.ansible.com/u/eugene_dev)\
**Post date:** [June 12, 2025, 9:19am UTC](https://forum.ansible.com/t/task-failed-during-zabbix-host-group-creation/43301/3 "2025-06-12T09:19:26Z")

</div>

nice try, but this approach returns the same error:` 'data': 'Invalid parameter \"/\": unexpected parameter \"auth\"` since `host_groups` parameter has alias of `host_group`.

---

<div class="post-metadata">

**Author:** ![eugene\_dev](https://avatars.discourse-cdn.com/v4/letter/e/e274bd/32.png) [@eugene\_dev](https://forum.ansible.com/u/eugene_dev)\
**Post date:** [June 12, 2025, 10:09am UTC](https://forum.ansible.com/t/task-failed-during-zabbix-host-group-creation/43301/4 "2025-06-12T10:09:03Z")

</div>

Fixed, solution is to upgrade community.zabbix collection to newer version, in my case its 4.0

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [July 12, 2025, 10:09am UTC](https://forum.ansible.com/t/task-failed-during-zabbix-host-group-creation/43301/5 "2025-07-12T10:09:51Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
