From d39837b2be8ce6abfa8c69d7cc83f04c6130ccd5 Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Tue, 1 Sep 2015 10:22:22 -0400 Subject: Fix for zbx applications --- roles/lib_zabbix/tasks/create_template.yml | 32 ++++++++++-------------------- 1 file changed, 11 insertions(+), 21 deletions(-) (limited to 'roles/lib_zabbix/tasks') diff --git a/roles/lib_zabbix/tasks/create_template.yml b/roles/lib_zabbix/tasks/create_template.yml index 444fd0a14..630d5dd70 100644 --- a/roles/lib_zabbix/tasks/create_template.yml +++ b/roles/lib_zabbix/tasks/create_template.yml @@ -1,6 +1,4 @@ --- -- debug: var=template - - name: Template Create Template zbx_template: zbx_server: "{{ server }}" @@ -9,28 +7,20 @@ name: "{{ template.name }}" register: created_template -- debug: var=created_template - set_fact: lzbx_applications: "{{ template.zitems | oo_select_keys_from_list(['applications']) | oo_flatten | unique }}" -- debug: var=lzbx_applications - -# -# twiest: This is commented out because it doesn't work correctly -# -#- name: Create Application -# zbx_application: -# zbx_server: "{{ server }}" -# zbx_user: "{{ user }}" -# zbx_password: "{{ password }}" -# name: "{{ item }}" -# template_name: "{{ template.name }}" -# with_items: lzbx_applications -# register: created_application -# when: template.zitems is defined - -#- debug: var=created_application +- name: Create Application + zbx_application: + zbx_server: "{{ server }}" + zbx_user: "{{ user }}" + zbx_password: "{{ password }}" + name: "{{ item }}" + template_name: "{{ template.name }}" + with_items: lzbx_applications + register: created_application + when: template.zitems is defined - name: Create Items zbx_item: @@ -41,7 +31,7 @@ name: "{{ item.name | default(item.key, true) }}" value_type: "{{ item.value_type | default('int') }}" template_name: "{{ template.name }}" -# applications: "{{ item.applications }}" + applications: "{{ item.applications }}" with_items: template.zitems register: created_items when: template.zitems is defined -- cgit v1.2.3