-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcluster.yml
75 lines (70 loc) · 2.27 KB
/
cluster.yml
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
67
68
69
70
71
72
73
74
75
---
- name: Check cluster status in a noncontainerized environment
hosts: "{{ test.monitor.nodes }}"
tasks:
- name: collect Ceph cluster status
shell: "ceph status --cluster {{test.cluster.name}} --format json"
become: true
register: cluster_status
run_once: yes
tags:
- sanity
- non-containerized
# TODO: Add tasks for logging success/failure for noncontainerized health check (ceph2)
- name: Check cluster status in a containerized environment
hosts: "{{ test.monitor.nodes }}"
tasks:
- name: collect Ceph cluster status
shell: "{{test.ceph.reg.provider}} exec ceph-mon-`hostname -s` ceph --cluster {{test.cluster.name}} --status --format json"
become: true
register: cluster_status
run_once: yes
tags:
- sanity
- containerized
- name: cluster health check for ceph 3 - failed
lineinfile:
path: "{{ test.output.file }}"
line: "check ceph monitors health = failed"
when: ((cluster_status.stdout|from_json).health.status != "HEALTH_OK")
delegate_to: undercloud-0
run_once: yes
tags:
- cluster
- sanity
- ceph-3
- name: cluster health check for ceph 3 - passed
lineinfile:
path: "{{ test.output.file }}"
line: "check ceph monitors health = passed"
when: ((cluster_status.stdout|from_json).health.status == "HEALTH_OK")
delegate_to: undercloud-0
run_once: yes
tags:
- cluster
- sanity
- ceph-3
- name: cluster health check for ceph 4 - failed
register: health_check
lineinfile:
path: "{{ test.output.file }}"
line: "check ceph monitors health = failed"
when: ((cluster_status.stdout|from_json).health.status != "HEALTH_OK")
delegate_to: undercloud-0
run_once: yes
tags:
- cluster
- sanity
- ceph-4
- name: cluster health check for ceph 4 - passed
register: health_check
lineinfile:
path: "{{ test.output.file }}"
line: "check ceph monitors health = passed"
when: ((cluster_status.stdout|from_json).health.status == "HEALTH_OK")
delegate_to: undercloud-0
run_once: yes
tags:
- cluster
- sanity
- ceph-4