diff options
author | Troy Dawson <tdawson@redhat.com> | 2015-04-16 16:19:02 -0500 |
---|---|---|
committer | Troy Dawson <tdawson@redhat.com> | 2015-04-16 16:19:02 -0500 |
commit | 7f7b582a7bc239e69c147b98c8c2512050f12851 (patch) | |
tree | f0701e3ce7a42761e9dfb59218057a46e48a901b /playbooks/adhoc | |
parent | db9cf8ef4f030f30391e021f360fe0c3db1dce74 (diff) | |
parent | 0722304b2f9c94a2f70054e0a3c7feceaedb195c (diff) | |
download | openshift-7f7b582a7bc239e69c147b98c8c2512050f12851.tar.gz openshift-7f7b582a7bc239e69c147b98c8c2512050f12851.tar.bz2 openshift-7f7b582a7bc239e69c147b98c8c2512050f12851.tar.xz openshift-7f7b582a7bc239e69c147b98c8c2512050f12851.zip |
Merge pull request #158 from openshift/master
Merge master into INT for first v3 INT deploy
Diffstat (limited to 'playbooks/adhoc')
l--------- | playbooks/adhoc/noc/filter_plugins | 1 | ||||
-rw-r--r-- | playbooks/adhoc/noc/get_zabbix_problems.yml | 41 | ||||
l--------- | playbooks/adhoc/noc/roles | 1 |
3 files changed, 43 insertions, 0 deletions
diff --git a/playbooks/adhoc/noc/filter_plugins b/playbooks/adhoc/noc/filter_plugins new file mode 120000 index 000000000..99a95e4ca --- /dev/null +++ b/playbooks/adhoc/noc/filter_plugins @@ -0,0 +1 @@ +../../../filter_plugins
\ No newline at end of file diff --git a/playbooks/adhoc/noc/get_zabbix_problems.yml b/playbooks/adhoc/noc/get_zabbix_problems.yml new file mode 100644 index 000000000..02bffc1d2 --- /dev/null +++ b/playbooks/adhoc/noc/get_zabbix_problems.yml @@ -0,0 +1,41 @@ +--- +- name: 'Get current hosts who have triggers that are alerting by trigger description' + hosts: localhost + gather_facts: no + roles: + - os_zabbix + post_tasks: + - assert: + that: oo_desc is defined + + - zbxapi: + server: https://noc2.ops.rhcloud.com/zabbix/api_jsonrpc.php + zbx_class: Trigger + action: get + params: + only_true: true + output: extend + selectHosts: extend + searchWildCardsEnabled: 1 + search: + description: "{{ oo_desc }}" + register: problems + + - debug: var=problems + + - set_fact: + problem_hosts: "{{ problems.results | oo_collect(attribute='hosts') | oo_flatten | oo_collect(attribute='host') | difference(['aggregates']) }}" + + - debug: var=problem_hosts + + - add_host: + name: "{{ item }}" + groups: problem_hosts_group + with_items: problem_hosts + +- name: "Run on problem hosts" + hosts: problem_hosts_group + gather_facts: no + tasks: + - command: "{{ oo_cmd }}" + when: oo_cmd is defined diff --git a/playbooks/adhoc/noc/roles b/playbooks/adhoc/noc/roles new file mode 120000 index 000000000..20c4c58cf --- /dev/null +++ b/playbooks/adhoc/noc/roles @@ -0,0 +1 @@ +../../../roles
\ No newline at end of file |