summaryrefslogtreecommitdiffstats
path: root/playbooks/adhoc/zabbix_setup/create_template.yml
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2015-07-24 10:52:29 -0400
committerKenny Woodson <kwoodson@redhat.com>2015-07-24 11:13:04 -0400
commit2a6fc886cc080ec1344d9ad4767f0fcde7ba3442 (patch)
tree85a5dc0e17c0d0c0a3d231ec808633ae05fdea7e /playbooks/adhoc/zabbix_setup/create_template.yml
parent97f96b71ff8abc2ccf38e745e124c68b91a71146 (diff)
downloadopenshift-2a6fc886cc080ec1344d9ad4767f0fcde7ba3442.tar.gz
openshift-2a6fc886cc080ec1344d9ad4767f0fcde7ba3442.tar.bz2
openshift-2a6fc886cc080ec1344d9ad4767f0fcde7ba3442.tar.xz
openshift-2a6fc886cc080ec1344d9ad4767f0fcde7ba3442.zip
Adding initial zabbix setup
Diffstat (limited to 'playbooks/adhoc/zabbix_setup/create_template.yml')
-rw-r--r--playbooks/adhoc/zabbix_setup/create_template.yml59
1 files changed, 59 insertions, 0 deletions
diff --git a/playbooks/adhoc/zabbix_setup/create_template.yml b/playbooks/adhoc/zabbix_setup/create_template.yml
new file mode 100644
index 000000000..07724d5b7
--- /dev/null
+++ b/playbooks/adhoc/zabbix_setup/create_template.yml
@@ -0,0 +1,59 @@
+---
+- debug: var=ctp_template
+
+- name: Create Template
+ zbxapi:
+ server: "{{ ctp_zserver }}"
+ user: "{{ ctp_zuser }}"
+ password: "{{ ctp_zpassword }}"
+ zbx_class: Template
+ state: present
+ params: "{{ ctp_template.params }}"
+ register: ctp_created_templates
+
+- debug: var=ctp_created_templates
+
+#- name: Create Application
+# zbxapi:
+# server: "{{ ctp_zserver }}"
+# user: "{{ ctp_zuser }}"
+# password: "{{ ctp_zpassword }}"
+# zbx_class: Application
+# state: present
+# params:
+# name: "{{ ctp_template.application.name}}"
+# hostid: "{{ ctp_created_templates.results[0].templateid }}"
+# search:
+# name: "{{ ctp_template.application.name}}"
+# register: ctp_created_application
+
+- debug: var=ctp_created_application
+
+- name: Create Items
+ zbxapi:
+ server: "{{ ctp_zserver }}"
+ user: "{{ ctp_zuser }}"
+ password: "{{ ctp_zpassword }}"
+ zbx_class: Item
+ state: present
+ params: "{{ item | oo_set_zbx_item_hostid(ctp_created_templates.results) }}"
+ with_items: ctp_template.zitems
+ register: ctp_created_items
+
+- debug: var=ctp_created_items
+
+- name: Create Triggers
+ zbxapi:
+ server: "{{ ctp_zserver }}"
+ user: "{{ ctp_zuser }}"
+ password: "{{ ctp_zpassword }}"
+ zbx_class: Trigger
+ state: present
+ params: "{{ item }}"
+ with_items: ctp_template.ztriggers
+ register: ctp_created_triggers
+ when: ctp_template.ztriggers is defined
+
+- debug: var=ctp_created_triggers
+
+