From 0fb91190b7e5b5c18f4c96f9c01a4ae51436504a Mon Sep 17 00:00:00 2001
From: Jason DeTiberus <jdetiber@redhat.com>
Date: Wed, 21 Dec 2016 15:50:29 -0500
Subject: remove old Ops tooling

---
 playbooks/adhoc/noc/create_host.yml             | 58 ------------------------
 playbooks/adhoc/noc/create_maintenance.yml      | 37 ---------------
 playbooks/adhoc/noc/get_zabbix_problems.yml     | 43 ------------------
 playbooks/adhoc/zabbix_setup/clean_zabbix.yml   | 60 -------------------------
 playbooks/adhoc/zabbix_setup/filter_plugins     |  1 -
 playbooks/adhoc/zabbix_setup/oo-clean-zaio.yml  |  7 ---
 playbooks/adhoc/zabbix_setup/oo-config-zaio.yml | 19 --------
 playbooks/adhoc/zabbix_setup/roles              |  1 -
 8 files changed, 226 deletions(-)
 delete mode 100644 playbooks/adhoc/noc/create_host.yml
 delete mode 100644 playbooks/adhoc/noc/create_maintenance.yml
 delete mode 100644 playbooks/adhoc/noc/get_zabbix_problems.yml
 delete mode 100644 playbooks/adhoc/zabbix_setup/clean_zabbix.yml
 delete mode 120000 playbooks/adhoc/zabbix_setup/filter_plugins
 delete mode 100755 playbooks/adhoc/zabbix_setup/oo-clean-zaio.yml
 delete mode 100755 playbooks/adhoc/zabbix_setup/oo-config-zaio.yml
 delete mode 120000 playbooks/adhoc/zabbix_setup/roles

(limited to 'playbooks')

diff --git a/playbooks/adhoc/noc/create_host.yml b/playbooks/adhoc/noc/create_host.yml
deleted file mode 100644
index 318396bcc..000000000
--- a/playbooks/adhoc/noc/create_host.yml
+++ /dev/null
@@ -1,58 +0,0 @@
----
-- name: 'Create a host object in zabbix'
-  hosts: localhost
-  connection: local
-  become: no
-  gather_facts: no
-  roles:
-    - os_zabbix
-  post_tasks:
-
-    - zbxapi:
-        server: https://noc2.ops.rhcloud.com/zabbix/api_jsonrpc.php
-        zbx_class: Template
-        state: list
-        params:
-          host: ctr_test_kwoodson
-          filter:
-            host:
-              - ctr_kwoodson_test_tmpl
-
-      register: tmpl_results
-
-    - debug: var=tmpl_results
-
-#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 host object in zabbix'
-  hosts: localhost
-  connection: local
-  become: no
-  gather_facts: no
-  roles:
-    - os_zabbix
-  post_tasks:
-
-    - zbxapi:
-        server: https://noc2.ops.rhcloud.com/zabbix/api_jsonrpc.php
-        zbx_class: Host
-        state: absent
-        params:
-          host: ctr_test_kwoodson
-          interfaces:
-            - type: 1
-              main: 1
-              useip: 1
-              ip: 127.0.0.1
-              dns: ""
-              port: 10050
-          groups:
-            - groupid: 1
-          templates: "{{ tmpl_results.results | oo_collect('templateid') | oo_build_zabbix_list_dict('templateid') }}"
-          output: extend
-          filter:
-            host:
-              - ctr_test_kwoodson
-
-      register: host_results
-
-    - debug: var=host_results
diff --git a/playbooks/adhoc/noc/create_maintenance.yml b/playbooks/adhoc/noc/create_maintenance.yml
deleted file mode 100644
index b694aea1b..000000000
--- a/playbooks/adhoc/noc/create_maintenance.yml
+++ /dev/null
@@ -1,37 +0,0 @@
----
-#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
-  connection: local
-  become: no
-  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
deleted file mode 100644
index 32fc7ce68..000000000
--- a/playbooks/adhoc/noc/get_zabbix_problems.yml
+++ /dev/null
@@ -1,43 +0,0 @@
----
-- name: 'Get current hosts who have triggers that are alerting by trigger description'
-  hosts: localhost
-  connection: local
-  become: no
-  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
-        state: list
-        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/zabbix_setup/clean_zabbix.yml b/playbooks/adhoc/zabbix_setup/clean_zabbix.yml
deleted file mode 100644
index 955f990b7..000000000
--- a/playbooks/adhoc/zabbix_setup/clean_zabbix.yml
+++ /dev/null
@@ -1,60 +0,0 @@
----
-- hosts: localhost
-  gather_facts: no
-  connection: local
-  become: no
-  vars:
-    g_server: http://localhost:8080/zabbix/api_jsonrpc.php
-    g_user: ''
-    g_password: ''
-
-  roles:
-  - lib_zabbix
-
-  post_tasks:
-  - name: CLEAN List template for heartbeat
-    zbx_template:
-      zbx_server: "{{ g_server }}"
-      zbx_user: "{{ g_user }}"
-      zbx_password: "{{ g_password }}"
-      state: list
-      name: 'Template Heartbeat'
-    register: templ_heartbeat
-
-  - name: CLEAN List template app zabbix server
-    zbx_template:
-      zbx_server: "{{ g_server }}"
-      zbx_user: "{{ g_user }}"
-      zbx_password: "{{ g_password }}"
-      state: list
-      name: 'Template App Zabbix Server'
-    register: templ_zabbix_server
-
-  - name: CLEAN List template app zabbix server
-    zbx_template:
-      zbx_server: "{{ g_server }}"
-      zbx_user: "{{ g_user }}"
-      zbx_password: "{{ g_password }}"
-      state: list
-      name: 'Template App Zabbix Agent'
-    register: templ_zabbix_agent
-
-  - name: CLEAN List all templates
-    zbx_template:
-      zbx_server: "{{ g_server }}"
-      zbx_user: "{{ g_user }}"
-      zbx_password: "{{ g_password }}"
-      state: list
-    register: templates
-
-  - debug: var=templ_heartbeat.results
-
-  - name: Remove templates if heartbeat template is missing
-    zbx_template:
-      zbx_server: "{{ g_server }}"
-      zbx_user: "{{ g_user }}"
-      zbx_password: "{{ g_password }}"
-      name: "{{ item }}"
-      state: absent
-    with_items: "{{ templates.results | difference(templ_zabbix_agent.results) | difference(templ_zabbix_server.results) | oo_collect('host') }}"
-    when: templ_heartbeat.results | length == 0
diff --git a/playbooks/adhoc/zabbix_setup/filter_plugins b/playbooks/adhoc/zabbix_setup/filter_plugins
deleted file mode 120000
index b0b7a3414..000000000
--- a/playbooks/adhoc/zabbix_setup/filter_plugins
+++ /dev/null
@@ -1 +0,0 @@
-../../../filter_plugins/
\ No newline at end of file
diff --git a/playbooks/adhoc/zabbix_setup/oo-clean-zaio.yml b/playbooks/adhoc/zabbix_setup/oo-clean-zaio.yml
deleted file mode 100755
index 0fe65b338..000000000
--- a/playbooks/adhoc/zabbix_setup/oo-clean-zaio.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env ansible-playbook
----
-- include: clean_zabbix.yml
-  vars:
-    g_server: http://localhost/zabbix/api_jsonrpc.php
-    g_user: Admin
-    g_password: zabbix
diff --git a/playbooks/adhoc/zabbix_setup/oo-config-zaio.yml b/playbooks/adhoc/zabbix_setup/oo-config-zaio.yml
deleted file mode 100755
index 0d5e01878..000000000
--- a/playbooks/adhoc/zabbix_setup/oo-config-zaio.yml
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/ansible-playbook
----
-- hosts: localhost
-  gather_facts: no
-  connection: local
-  become: no
-  vars:
-    g_server: http://localhost/zabbix/api_jsonrpc.php
-    g_user: Admin
-    g_password: zabbix
-    g_zbx_scriptrunner_user: scriptrunner
-    g_zbx_scriptrunner_bastion_host: specialhost.example.com
-  roles:
-  - role: os_zabbix
-    ozb_server: "{{ g_server }}"
-    ozb_user: "{{ g_user }}"
-    ozb_password: "{{ g_password }}"
-    ozb_scriptrunner_user: "{{ g_zbx_scriptrunner_user }}"
-    ozb_scriptrunner_bastion_host: "{{ g_zbx_scriptrunner_bastion_host }}"
diff --git a/playbooks/adhoc/zabbix_setup/roles b/playbooks/adhoc/zabbix_setup/roles
deleted file mode 120000
index 20c4c58cf..000000000
--- a/playbooks/adhoc/zabbix_setup/roles
+++ /dev/null
@@ -1 +0,0 @@
-../../../roles
\ No newline at end of file
-- 
cgit v1.2.3


From 9b3852263ca7b1f399d3ac453cfe93ed64078205 Mon Sep 17 00:00:00 2001
From: Jason DeTiberus <jdetiber@redhat.com>
Date: Wed, 21 Dec 2016 15:54:38 -0500
Subject: remove duplicate filter name and oo_pdb

---
 .../filter_plugins/grow_docker_vg_filters.py       | 29 ++++++++++++++++
 .../grow_docker_vg/filter_plugins/oo_filters.py    | 40 ----------------------
 2 files changed, 29 insertions(+), 40 deletions(-)
 create mode 100644 playbooks/adhoc/grow_docker_vg/filter_plugins/grow_docker_vg_filters.py
 delete mode 100644 playbooks/adhoc/grow_docker_vg/filter_plugins/oo_filters.py

(limited to 'playbooks')

diff --git a/playbooks/adhoc/grow_docker_vg/filter_plugins/grow_docker_vg_filters.py b/playbooks/adhoc/grow_docker_vg/filter_plugins/grow_docker_vg_filters.py
new file mode 100644
index 000000000..daff68fbe
--- /dev/null
+++ b/playbooks/adhoc/grow_docker_vg/filter_plugins/grow_docker_vg_filters.py
@@ -0,0 +1,29 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+# vim: expandtab:tabstop=4:shiftwidth=4
+'''
+Custom filters for use in openshift-ansible
+'''
+
+
+class FilterModule(object):
+    ''' Custom ansible filters '''
+
+    @staticmethod
+    def translate_volume_name(volumes, target_volume):
+        '''
+            This filter matches a device string /dev/sdX to /dev/xvdX
+            It will then return the AWS volume ID
+        '''
+        for vol in volumes:
+            translated_name = vol["attachment_set"]["device"].replace("/dev/sd", "/dev/xvd")
+            if target_volume.startswith(translated_name):
+                return vol["id"]
+
+        return None
+
+    def filters(self):
+        ''' returns a mapping of filters to methods '''
+        return {
+            "translate_volume_name": self.translate_volume_name,
+        }
diff --git a/playbooks/adhoc/grow_docker_vg/filter_plugins/oo_filters.py b/playbooks/adhoc/grow_docker_vg/filter_plugins/oo_filters.py
deleted file mode 100644
index c19274e06..000000000
--- a/playbooks/adhoc/grow_docker_vg/filter_plugins/oo_filters.py
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-# vim: expandtab:tabstop=4:shiftwidth=4
-'''
-Custom filters for use in openshift-ansible
-'''
-
-import pdb
-
-
-class FilterModule(object):
-    ''' Custom ansible filters '''
-
-    @staticmethod
-    def oo_pdb(arg):
-        ''' This pops you into a pdb instance where arg is the data passed in
-            from the filter.
-            Ex: "{{ hostvars | oo_pdb }}"
-        '''
-        pdb.set_trace()
-        return arg
-
-    @staticmethod
-    def translate_volume_name(volumes, target_volume):
-        '''
-            This filter matches a device string /dev/sdX to /dev/xvdX
-            It will then return the AWS volume ID
-        '''
-        for vol in volumes:
-            translated_name = vol["attachment_set"]["device"].replace("/dev/sd", "/dev/xvd")
-            if target_volume.startswith(translated_name):
-                return vol["id"]
-
-        return None
-
-    def filters(self):
-        ''' returns a mapping of filters to methods '''
-        return {
-            "translate_volume_name": self.translate_volume_name,
-        }
-- 
cgit v1.2.3