blob: 7b9df3ae3f70724b3783a2e1aad9b8df2384ada2 [file] [log] [blame]
Oleksii Butenkoba680de2018-08-23 14:15:19 +03001{% from 'cookied-mcp-pike-dvr-ceph/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-mcp-pike-dvr-ceph/underlay.yaml' import HOSTNAME_GTW01 with context %}
3{% from 'cookied-mcp-pike-dvr-ceph/underlay.yaml' import LAB_CONFIG_NAME with context %}
4{% from 'cookied-mcp-pike-dvr-ceph/underlay.yaml' import DOMAIN_NAME with context %}
5{% import 'shared-salt.yaml' as SHARED with context %}
6
Oleksii Butenkoba680de2018-08-23 14:15:19 +03007# Install ceph mons
8- description: Update grains
9 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
10 -C 'I@ceph:common' state.sls salt.minion.grains
11 node_name: {{ HOSTNAME_CFG01 }}
12 retry: {count: 1, delay: 10}
13 skip_fail: false
14
15- description: Generate keyrings
16 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
17 -C 'I@ceph:mon:keyring:mon or I@ceph:common:keyring:admin' state.sls ceph.mon
18 node_name: {{ HOSTNAME_CFG01 }}
19 retry: {count: 1, delay: 10}
20 skip_fail: false
21
22- description: Sync grains on ceph mon nodes
23 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
24 -C 'I@ceph:mon' saltutil.sync_grains
25 node_name: {{ HOSTNAME_CFG01 }}
26 retry: {count: 1, delay: 10}
27 skip_fail: false
28
29- description: Update mine on ceph mons
30 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
31 -C 'I@ceph:mon:keyring:mon or I@ceph:common:keyring:admin' mine.update
32 node_name: {{ HOSTNAME_CFG01 }}
33 retry: {count: 1, delay: 10}
34 skip_fail: false
35
36- description: Install ceph mon
37 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
38 -C 'I@ceph:mon' state.sls ceph.mon
39 node_name: {{ HOSTNAME_CFG01 }}
40 retry: {count: 1, delay: 5}
41 skip_fail: false
42
43- description: Install ceph mgr if defined(needed only for Luminious)
44 cmd: |
45 if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:mgr' match.pillar 'ceph:mgr' ; then
46 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:mgr' state.sls ceph.mgr
47 fi
48 node_name: {{ HOSTNAME_CFG01 }}
49 retry: {count: 2, delay: 5}
50 skip_fail: false
51
52- description: Install ceph osd
53 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
54 -C 'I@ceph:osd' state.sls ceph.osd
55 node_name: {{ HOSTNAME_CFG01 }}
56 retry: {count: 1, delay: 5}
57 skip_fail: false
58
59- description: Sync grains
60 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
61 -C 'I@ceph:osd' saltutil.sync_grains
62 node_name: {{ HOSTNAME_CFG01 }}
63 retry: {count: 1, delay: 5}
64 skip_fail: false
65
66- description: Install ceph osd nodes
67 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
68 -C 'I@ceph:osd' state.sls ceph.osd.custom
69 node_name: {{ HOSTNAME_CFG01 }}
70 retry: {count: 1, delay: 5}
71 skip_fail: true
72
73- description: Sync grains
74 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
75 -C 'I@ceph:osd' saltutil.sync_grains
76 node_name: {{ HOSTNAME_CFG01 }}
77 retry: {count: 1, delay: 5}
78 skip_fail: false
79
80- description: Update mine on ceph osd
81 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
82 -C 'I@ceph:osd' mine.update
83 node_name: {{ HOSTNAME_CFG01 }}
84 retry: {count: 1, delay: 10}
85 skip_fail: false
86
87- description: Setup pools, keyrings and maybe crush
88 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
89 -C 'I@ceph:setup' state.sls ceph.setup
90 node_name: {{ HOSTNAME_CFG01 }}
91 retry: {count: 1, delay: 10}
92 skip_fail: false
93
94- description: Install ceph clinet
95 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
96 -C 'I@ceph:setup' state.sls ceph.setup
97 node_name: {{ HOSTNAME_CFG01 }}
98 retry: {count: 1, delay: 10}
99 skip_fail: false
100
101- description: Install radosgw if exists
102 cmd: |
103 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' saltutil.sync_grains;
104 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' state.sls ceph.radosgw;
105 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@keystone:client' state.sls keystone.client;
106 node_name: {{ HOSTNAME_CFG01 }}
107 retry: {count: 2, delay: 5}
108 skip_fail: false
109
110- description: Install ceph clinet
111 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
112 -C 'I@ceph:setup' state.sls ceph.setup
113 node_name: {{ HOSTNAME_CFG01 }}
114 retry: {count: 1, delay: 10}
115 skip_fail: false
116
117{%- for ssh in config.underlay.ssh %}
118 {%- set salt_roles = [] %}
119 {%- for role in ssh['roles'] %}
120 {%- if role in config.salt_deploy.salt_roles %}
121 {%- set _ = salt_roles.append(role) %}
122 {%- endif %}
123 {%- endfor %}
124
125 {%- if salt_roles %}
126- description: Restart salt-minion as workaround of PROD-16970
127 cmd: |
128 service salt-minion restart; # For case if salt-minion was already installed
129 node_name: {{ ssh['node_name'] }}
130 retry: {count: 1, delay: 1}
131 skip_fail: false
132 {%- endif %}
133{%- endfor %}
134
135- description: Connect ceph to glance
136 cmd: |
137 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@glance:server' state.sls ceph.common,ceph.setup.keyring,glance;
138 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@glance:server' service.restart glance-api;
139 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@glance:server' service.restart glance-registry;
140 node_name: {{ HOSTNAME_CFG01 }}
141 retry: {count: 2, delay: 5}
142 skip_fail: false
143
144- description: Connect ceph to cinder and nova
145 cmd: |
146 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@cinder:controller' state.sls ceph.common,ceph.setup.keyring,cinder;
147 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' state.sls ceph.common,ceph.setup.keyring;
148 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' saltutil.sync_grains;
149 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' state.sls nova;
150 node_name: {{ HOSTNAME_CFG01 }}
151 retry: {count: 2, delay: 5}
152 skip_fail: false
153
154- description: Restart cinder volume
155 cmd: |
156 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@cinder:controller' service.restart cinder-volume;
157 node_name: {{ HOSTNAME_CFG01 }}
158 retry: {count: 2, delay: 5}
159 skip_fail: false
160
161- description: Restart nova-compute
162 cmd: |
163 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@nova:compute' service.restart nova-compute;
164 node_name: {{ HOSTNAME_CFG01 }}
165 retry: {count: 2, delay: 5}
166 skip_fail: false
167
Oleksii Butenkoba680de2018-08-23 14:15:19 +0300168{{ SHARED.INSTALL_DOCKER_ON_GTW() }}