-
Notifications
You must be signed in to change notification settings - Fork 75
/
default.sls
101 lines (81 loc) · 2.27 KB
/
default.sls
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
include:
- .common
{% set master = salt['master.minion']() %}
{% if salt['saltutil.runner']('cephprocesses.mon') == True %}
#warning_before:
# salt.state:
# - tgt: {{ salt['pillar.get']('master_minion') }}
# - sls: ceph.warning.noout
# - failhard: True
{% for host in salt.saltutil.runner('orderednodes.unique', cluster='ceph') %}
starting {{ host }}:
salt.runner:
- name: minions.message
- content: "Processing host {{ host }}"
wait until the cluster has recovered before processing {{ host }}:
salt.state:
- tgt: {{ master }}
- sls: ceph.wait
- failhard: True
check if all processes are still running after processing {{ host }}:
salt.state:
- tgt: '{{ salt['pillar.get']('deepsea_minions') }}'
- tgt_type: compound
- sls: ceph.processes
- failhard: True
unset noout {{ host }}:
salt.state:
- sls: ceph.noout.unset
- tgt: {{ master }}
- failhard: True
updating {{ host }}:
salt.state:
- tgt: {{ host }}
- tgt_type: compound
- sls: ceph.updates
- failhard: True
set noout {{ host }}:
salt.state:
- sls: ceph.noout.set
- tgt: {{ master }}
- failhard: True
finished {{ host }}:
salt.runner:
- name: minions.message
- content: "Finished host {{ host }}"
{% endfor %}
unset noout after final iteration:
salt.state:
- sls: ceph.noout.unset
- tgt: {{ master }}
- failhard: True
starting remaining minions:
salt.runner:
- name: minions.message
- content: "Processing minions without roles"
updating minions without roles:
salt.state:
- tgt: I@cluster:ceph
- tgt_type: compound
- sls: ceph.updates
- failhard: True
finishing remaining minions:
salt.runner:
- name: minions.message
- content: "Finished minions without roles"
#warning_after:
# salt.state:
# - tgt: {{ salt['pillar.get']('master_minion') }}
# - sls: ceph.warning.noout
# - failhard: True
# Here needs to be 100% definitive check that the cluster is not up yet.
# the parent if conditional can be False if one of the mons is down.
# but even if all are down, this is no indication of rebooting/updateing
# all nodes at once
{% else %}
updates:
salt.state:
- tgt: '{{ salt['pillar.get']('deepsea_minions') }}'
- tgt_type: compound
- sls: ceph.updates
{% endif %}