summaryrefslogtreecommitdiffstats
path: root/playbooks
diff options
context:
space:
mode:
authorKenny Woodson <kwoodson@redhat.com>2015-06-30 22:23:03 -0400
committerKenny Woodson <kwoodson@redhat.com>2015-06-30 22:23:03 -0400
commit5fe2016d158d00729ba16b3ef3cc130cecd93620 (patch)
treecff5cd5fb72994d42ad73b8e2ed4d5082fccca6a /playbooks
parent06a1cf34750bd43fd4d3dd8fda0c4bb1cbefa059 (diff)
downloadopenshift-5fe2016d158d00729ba16b3ef3cc130cecd93620.tar.gz
openshift-5fe2016d158d00729ba16b3ef3cc130cecd93620.tar.bz2
openshift-5fe2016d158d00729ba16b3ef3cc130cecd93620.tar.xz
openshift-5fe2016d158d00729ba16b3ef3cc130cecd93620.zip
Updates to ans module examples
Diffstat (limited to 'playbooks')
-rw-r--r--playbooks/adhoc/noc/create_maintenance.yml36
-rw-r--r--playbooks/adhoc/noc/get_zabbix_problems.yml2
2 files changed, 37 insertions, 1 deletions
diff --git a/playbooks/adhoc/noc/create_maintenance.yml b/playbooks/adhoc/noc/create_maintenance.yml
new file mode 100644
index 000000000..c0ec57ce1
--- /dev/null
+++ b/playbooks/adhoc/noc/create_maintenance.yml
@@ -0,0 +1,36 @@
+---
+#ansible-playbook -e 'oo_desc=kwoodson test' -e 'oo_name=kwoodson test name' -e 'oo_start=1435715357' -e 'oo_stop=1435718985' -e 'oo_hostids=11549' create_maintenance.yml
+- name: 'Create a maintenace object in zabbix'
+ hosts: localhost
+ gather_facts: no
+ roles:
+ - os_zabbix
+ vars:
+ oo_hostids: ''
+ oo_groupids: ''
+ post_tasks:
+ - assert:
+ that: oo_desc is defined
+
+ - zbxapi:
+ server: https://noc2.ops.rhcloud.com/zabbix/api_jsonrpc.php
+ zbx_class: Maintenance
+ state: present
+ params:
+ name: "{{ oo_name }}"
+ description: "{{ oo_desc }}"
+ active_since: "{{ oo_start }}"
+ active_till: "{{ oo_stop }}"
+ maintenance_type: "0"
+ output: extend
+ hostids: "{{ oo_hostids.split(',') | default([]) }}"
+#groupids: "{{ oo_groupids.split(',') | default([]) }}"
+ timeperiods:
+ - start_time: "{{ oo_start }}"
+ period: "{{ oo_stop }}"
+ selectTimeperiods: extend
+
+ register: maintenance
+
+ - debug: var=maintenance
+
diff --git a/playbooks/adhoc/noc/get_zabbix_problems.yml b/playbooks/adhoc/noc/get_zabbix_problems.yml
index 02bffc1d2..4b94fa228 100644
--- a/playbooks/adhoc/noc/get_zabbix_problems.yml
+++ b/playbooks/adhoc/noc/get_zabbix_problems.yml
@@ -11,7 +11,7 @@
- zbxapi:
server: https://noc2.ops.rhcloud.com/zabbix/api_jsonrpc.php
zbx_class: Trigger
- action: get
+ state: list
params:
only_true: true
output: extend