summaryrefslogtreecommitdiffstats
path: root/roles/lib_zabbix
diff options
context:
space:
mode:
Diffstat (limited to 'roles/lib_zabbix')
-rw-r--r--roles/lib_zabbix/tasks/create_template.yml9
1 files changed, 6 insertions, 3 deletions
diff --git a/roles/lib_zabbix/tasks/create_template.yml b/roles/lib_zabbix/tasks/create_template.yml
index 62259b680..41381e76c 100644
--- a/roles/lib_zabbix/tasks/create_template.yml
+++ b/roles/lib_zabbix/tasks/create_template.yml
@@ -9,7 +9,8 @@
- set_fact:
- lzbx_applications: "{{ template.zitems | oo_select_keys_from_list(['applications']) | oo_flatten | unique }}"
+ lzbx_item_applications: "{{ template.zitems | default([], True) | oo_select_keys_from_list(['applications']) | oo_flatten | unique }}"
+ lzbx_itemprototype_applications: "{{ template.zitemprototypes | default([], True) | oo_select_keys_from_list(['applications']) | oo_flatten | unique }}"
- name: Create Application
zbx_application:
@@ -18,9 +19,11 @@
zbx_password: "{{ password }}"
name: "{{ item }}"
template_name: "{{ template.name }}"
- with_items: lzbx_applications
+ with_items:
+ - "{{ lzbx_item_applications }}"
+ - "{{ lzbx_itemprototype_applications }}"
register: created_application
- when: template.zitems is defined
+ when: template.zitems is defined or template.zitemprototypes is defined
- name: Create Items
zbx_item: