---
- name: Create host groups
  # set task level variables as we change ansible_connection plugin here
  community.zabbix.zabbix_group:
    state: present
    host_groups: "{{ item['hostgroup'] }}"
  with_items: "{{ zabbix_templates }}" # Hostgroups specific to an ansible group can be overridden in inventory/group_vars/group_name
  tags:
    - zabbix_hostgroups
