File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ - name : Ensure a Ceph host has entered host maintenance
3
+ gather_facts : true
4
+ hosts : ceph
5
+ become : true
6
+ tasks :
7
+ - name : Check if host can enter maintenance mode
8
+ import_role :
9
+ name : stackhpc.cephadm.commands
10
+ vars :
11
+ cephadm_commands :
12
+ - " orch host ok-to-stop {{ ansible_facts.nodename }}"
13
+
14
+ - block :
15
+ - name : Extract full name of active Ceph manager
16
+ ansible.builtin.set_fact :
17
+ active_ceph_mgr : " {{ cephadm_commands_result.results[0].stderr | split | last | replace(\" '\" ,'') }}"
18
+
19
+ - name : Ensure active manager has been switched to another node
20
+ import_role :
21
+ name : stackhpc.cephadm.commands
22
+ vars :
23
+ cephadm_commands :
24
+ - " mgr fail {{ active_ceph_mgr }}"
25
+ when : ' "Cannot stop active Mgr daemon" in cephadm_commands_result.results[0].stderr'
26
+
27
+ - name : Ensure host is in maintenance mode
28
+ import_role :
29
+ name : stackhpc.cephadm.commands
30
+ vars :
31
+ cephadm_commands :
32
+ - " orch host maintenance enter {{ ansible_facts.nodename }}"
Original file line number Diff line number Diff line change
1
+ ---
2
+ - name : Ensure a Ceph host has exited host maintenance
3
+ gather_facts : true
4
+ hosts : ceph
5
+ become : true
6
+ tasks :
7
+ - import_role :
8
+ name : stackhpc.cephadm.commands
9
+ vars :
10
+ cephadm_commands :
11
+ - " orch host maintenance exit {{ ansible_facts.nodename }}"
You can’t perform that action at this time.
0 commit comments