blob: d4bafdc30c74e68cca32537f9bcc27c5a05b20b8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
---
- 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: 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
- name: Copy the admin client config(s)
command: >
cp {{ openshift.common.config_base}}/master/admin.kubeconfig {{ mktemp.stdout }}/admin.kubeconfig
changed_when: False
check_mode: no
tags: metrics_init
- 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 }}
--config={{ mktemp.stdout }}/admin.kubeconfig
apply -f {{ item }}
with_fileglob:
- "{{ mktemp.stdout }}/templates/*.yaml"
|