blob: 887d5eb97ebb34bd01b5500c19b93a21914981fd [file] [log] [blame]
Tatyana Leontovichb0b68d92018-01-11 13:27:08 +02001{% from 'virtual-mcp-pike-ovs-ceph/underlay.yaml' import HOSTNAME_CFG01 with context %}
Tatyana Leontovich7a869a72018-04-20 17:20:00 +03002{% from 'virtual-mcp-pike-ovs-ceph/underlay.yaml' import HOSTNAME_GTW01 with context %}
Oleksii Butenkofa5f0672018-04-20 14:43:14 +03003{% from 'virtual-mcp-pike-ovs-ceph/underlay.yaml' import LAB_CONFIG_NAME with context %}
4{% from 'virtual-mcp-pike-ovs-ceph/underlay.yaml' import DOMAIN_NAME with context %}
5{% import 'shared-salt.yaml' as SHARED with context %}
Tatyana Leontovich56005da2017-12-11 13:16:51 +02006
7# 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: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +020045 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
Tatyana Leontovich56005da2017-12-11 13:16:51 +020047 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: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200103 if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' match.pillar 'ceph:radosgw' ; then
104 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' saltutil.sync_grains;
105 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' state.sls ceph.radosgw;
106 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@keystone:client' state.sls keystone.client;
Tatyana Leontovichb0b68d92018-01-11 13:27:08 +0200107 fi
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200108 node_name: {{ HOSTNAME_CFG01 }}
109 retry: {count: 2, delay: 5}
110 skip_fail: false
111
112- description: Install ceph clinet
113 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
114 -C 'I@ceph:setup' state.sls ceph.setup
115 node_name: {{ HOSTNAME_CFG01 }}
116 retry: {count: 1, delay: 10}
117 skip_fail: false
118
Dennis Dmitriev5bcbdc52018-03-23 18:05:10 +0200119{%- for ssh in config.underlay.ssh %}
120 {%- set salt_roles = [] %}
121 {%- for role in ssh['roles'] %}
122 {%- if role in config.salt_deploy.salt_roles %}
123 {%- set _ = salt_roles.append(role) %}
124 {%- endif %}
125 {%- endfor %}
126
127 {%- if salt_roles %}
Tatyana Leontovich3fc6a092018-01-23 13:41:49 +0200128- description: Restart salt-minion as workaround of PROD-16970
129 cmd: |
130 service salt-minion restart; # For case if salt-minion was already installed
131 node_name: {{ ssh['node_name'] }}
132 retry: {count: 1, delay: 1}
133 skip_fail: false
Dennis Dmitriev5bcbdc52018-03-23 18:05:10 +0200134 {%- endif %}
135{%- endfor %}
Tatyana Leontovich3fc6a092018-01-23 13:41:49 +0200136
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200137- description: Connect ceph to glance
138 cmd: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200139 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;
140 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@glance:server' service.restart glance-api;
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200141 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@glance:server' service.restart glance-registry;
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200142 node_name: {{ HOSTNAME_CFG01 }}
143 retry: {count: 2, delay: 5}
144 skip_fail: false
145
146- description: Connect ceph to cinder and nova
147 cmd: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200148 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;
149 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' state.sls ceph.common,ceph.setup.keyring;
150 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' saltutil.sync_grains;
151 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' state.sls nova;
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200152 node_name: {{ HOSTNAME_CFG01 }}
153 retry: {count: 2, delay: 5}
154 skip_fail: false
155
156- description: Restart cinder volume
157 cmd: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200158 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@cinder:controller' service.restart cinder-volume;
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200159 node_name: {{ HOSTNAME_CFG01 }}
160 retry: {count: 2, delay: 5}
161 skip_fail: false
162
163- description: Restart nova-compute
164 cmd: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200165 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@nova:compute' service.restart nova-compute;
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200166 node_name: {{ HOSTNAME_CFG01 }}
167 retry: {count: 2, delay: 5}
168 skip_fail: false
Oleksii Butenko5cd0a162018-06-14 18:18:10 +0300169