---
- name: Create host groups
  community.zabbix.zabbix_host:
    host_name: "{{ inventory_hostname }}"
    host_groups: "{{ item['hostgroup']}}"
    link_templates: "{{ item['template'] }}"
    force: false
  with_items: "{{ zabbix_templates }}"
  tags:
    - zabbix_add_hosts_to_hostgroups
