zabbix: add hosts to hostgroup prior to template creation
move linking to template to separate task Signed-off-by: David Kirwan <davidkirwanirl@gmail.com>
This commit is contained in:
parent
f340a11c88
commit
2f566d3c9a
3 changed files with 17 additions and 3 deletions
|
@ -3,7 +3,7 @@
|
|||
community.zabbix.zabbix_host:
|
||||
host_name: "{{ inventory_hostname }}"
|
||||
host_groups: "{{ item['hostgroup']}}"
|
||||
link_templates: "{{ item['template'] }}"
|
||||
# link_templates: "{{ item['template'] }}"
|
||||
force: false
|
||||
with_items: "{{ zabbix_templates }}"
|
||||
tags:
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
- name: Add templates to hosts
|
||||
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_templates_to_hosts
|
|
@ -16,10 +16,14 @@
|
|||
tags:
|
||||
- zabbix_hostgroups
|
||||
|
||||
- include_tasks: add_hosts_to_hostgroups.yml
|
||||
tags:
|
||||
- zabbix_add_hosts_to_hostgroups
|
||||
|
||||
- include_tasks: templates.yml
|
||||
tags:
|
||||
- zabbix_templates
|
||||
|
||||
- include_tasks: add_hosts_to_hostgroups.yml
|
||||
- include_tasks: add_templates_to_hosts.yml
|
||||
tags:
|
||||
- zabbix_add_hosts_to_hostgroups
|
||||
- zabbix_add_templates_to_hosts
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue