summaryrefslogtreecommitdiffstats
path: root/roles/openshift_metrics/tasks/start_metrics.yaml
blob: 899251727422732c0138e78667bc6ee7170917e7 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
---
- command: >
    {{openshift_client_binary}}
    --config={{mktemp.stdout}}/admin.kubeconfig
    get rc
    -l metrics-infra=hawkular-cassandra
    -o name
    -n {{openshift_metrics_project}}
  register: metrics_cassandra_rc
  changed_when: no

- name: Start Hawkular Cassandra
  oc_scale:
    kind: rc
    name: "{{object.split('/')[1]}}"
    kubeconfig: "{{mktemp.stdout}}/admin.kubeconfig"
    namespace: "{{openshift_metrics_project}}"
    replicas: 1
  with_items: "{{metrics_cassandra_rc.stdout_lines}}"
  loop_control:
    loop_var: object
  when: metrics_cassandra_rc is defined
  changed_when: metrics_cassandra_rc | length > 0

- command: >
    {{openshift_client_binary}}
    --config={{mktemp.stdout}}/admin.kubeconfig
    get rc
    -l metrics-infra=hawkular-metrics
    -o name
    -n {{openshift_metrics_project}}
  register: metrics_metrics_rc
  changed_when: no

- name: Start Hawkular Metrics
  oc_scale:
    kind: rc
    name: "{{object.split('/')[1]}}"
    kubeconfig: "{{mktemp.stdout}}/admin.kubeconfig"
    namespace: "{{openshift_metrics_project}}"
    replicas: "{{openshift_metrics_hawkular_replicas}}"
  with_items: "{{metrics_metrics_rc.stdout_lines}}"
  loop_control:
    loop_var: object
  changed_when: metrics_metrics_rc | length > 0

- command: >
    {{openshift_client_binary}}
    --config={{mktemp.stdout}}/admin.kubeconfig
    get rc
    -l metrics-infra=heapster
    -o name
    -n {{openshift_metrics_project}}
  register: metrics_heapster_rc
  changed_when: no

- name: Start Heapster
  oc_scale:
    kind: rc
    name: "{{object.split('/')[1]}}"
    kubeconfig: "{{mktemp.stdout}}/admin.kubeconfig"
    namespace: "{{openshift_metrics_project}}"
    replicas: 1
  with_items: "{{metrics_heapster_rc.stdout_lines}}"
  loop_control:
    loop_var: object