summaryrefslogtreecommitdiffstats
path: root/roles/openshift_metrics/tasks
diff options
context:
space:
mode:
authorJeff Cantrill <jcantrill@users.noreply.github.com>2016-12-14 14:36:28 -0500
committerJeff Cantrill <jcantril@redhat.com>2017-01-17 11:45:04 -0500
commitee931f90dbab01596bd90fa8007ac49de5178a17 (patch)
treee4230477b1748e76d5adfb123703ae5e5e16aade /roles/openshift_metrics/tasks
parentb6ce0464142403785a7ba8eae664286082f4d30e (diff)
downloadopenshift-ee931f90dbab01596bd90fa8007ac49de5178a17.tar.gz
openshift-ee931f90dbab01596bd90fa8007ac49de5178a17.tar.bz2
openshift-ee931f90dbab01596bd90fa8007ac49de5178a17.tar.xz
openshift-ee931f90dbab01596bd90fa8007ac49de5178a17.zip
Add tasks to uninstall metrics (#7)
Diffstat (limited to 'roles/openshift_metrics/tasks')
-rw-r--r--roles/openshift_metrics/tasks/install_metrics.yaml24
-rw-r--r--roles/openshift_metrics/tasks/install_support.yaml5
-rw-r--r--roles/openshift_metrics/tasks/main.yaml27
-rw-r--r--roles/openshift_metrics/tasks/uninstall_metrics.yaml (renamed from roles/openshift_metrics/tasks/cleanup.yaml)0
4 files changed, 32 insertions, 24 deletions
diff --git a/roles/openshift_metrics/tasks/install_metrics.yaml b/roles/openshift_metrics/tasks/install_metrics.yaml
index 5d95fa112..db023e6a2 100644
--- a/roles/openshift_metrics/tasks/install_metrics.yaml
+++ b/roles/openshift_metrics/tasks/install_metrics.yaml
@@ -1,17 +1,9 @@
---
-# This is the base configuration for installing the other components
-- name: Create temp directory for doing work in
- command: mktemp -td openshift-metrics-ansible-XXXXXX
- register: mktemp
- changed_when: False
-
-- debug: msg="Created temp dir {{mktemp.stdout}}"
-
-- name: Create temp directory for all our templates
- file: path={{mktemp.stdout}}/templates state=directory mode=0755
- changed_when: False
-
-- include: generate_certificates.yaml
-- include: generate_serviceaccounts.yaml
-- include: generate_services.yaml
-- include: generate_rolebindings.yaml
+- name: Install Metrics
+ include: "{{ role_path }}/tasks/install_{{ include_file }}.yaml"
+ with_items:
+ - support
+ - heapster
+ - hawkular
+ loop_control:
+ loop_var: include_file
diff --git a/roles/openshift_metrics/tasks/install_support.yaml b/roles/openshift_metrics/tasks/install_support.yaml
new file mode 100644
index 000000000..b0e4bec80
--- /dev/null
+++ b/roles/openshift_metrics/tasks/install_support.yaml
@@ -0,0 +1,5 @@
+---
+- include: generate_certificates.yaml
+- include: generate_serviceaccounts.yaml
+- include: generate_services.yaml
+- include: generate_rolebindings.yaml
diff --git a/roles/openshift_metrics/tasks/main.yaml b/roles/openshift_metrics/tasks/main.yaml
index 79aae1e0b..adedd4069 100644
--- a/roles/openshift_metrics/tasks/main.yaml
+++ b/roles/openshift_metrics/tasks/main.yaml
@@ -2,20 +2,31 @@
- name: check that hawkular_metrics_hostname is set
fail: msg='the openshift_metrics_hawkular_metrics_hostname variable is required'
when: "{{ openshift_metrics_hawkular_metrics_hostname is not defined }}"
+
- name: check the value of openshift_metrics_hawkular_cassandra_storage_type
fail:
msg: >
openshift_metrics_hawkular_cassandra_storage_type ({{ openshift_metrics_hawkular_cassandra_storage_type }})
is invalid, must be one of: emptydir, pv, dynamic
when: openshift_metrics_hawkular_cassandra_storage_type not in openshift_metrics_hawkular_cassandra_storage_types
-- name: Install Metrics
- include: "{{ role_path }}/tasks/install_{{ include_file }}.yaml"
- with_items:
- - metrics
- - heapster
- - hawkular
- loop_control:
- loop_var: include_file
+
+- name: Create temp directory for doing work in
+ command: mktemp -td openshift-metrics-ansible-XXXXXX
+ register: mktemp
+ changed_when: False
+
+- debug: msg="Created temp dir {{mktemp.stdout}}"
+
+- name: Create temp directory for all our templates
+ file: path={{mktemp.stdout}}/templates state=directory mode=0755
+ changed_when: False
+
+- include: "{{role_path}}/tasks/install_metrics.yaml"
+ when: openshift_metrics_install_metrics | default(false) | bool
+
+- include: "{{role_path}}/tasks/uninstall_metrics.yaml"
+ when: not openshift_metrics_install_metrics | default(false) | bool
+
- name: create objects
command: >
{{ openshift.common.client_binary }} -n '{{ openshift_metrics_project }}'
diff --git a/roles/openshift_metrics/tasks/cleanup.yaml b/roles/openshift_metrics/tasks/uninstall_metrics.yaml
index a29faef31..a29faef31 100644
--- a/roles/openshift_metrics/tasks/cleanup.yaml
+++ b/roles/openshift_metrics/tasks/uninstall_metrics.yaml