blob: 6a5922f893a4abb1a0b0c50970c3480a60d71073 [file] [log] [blame]
Tatyana Leontovichb0b68d92018-01-11 13:27:08 +02001{% from 'virtual-mcp-pike-dvr-ceph-rgw/underlay.yaml' import HOSTNAME_CFG01 with context %}
Oleksii Butenkofa5f0672018-04-20 14:43:14 +03002{% from 'virtual-mcp-pike-dvr-ceph-rgw/underlay.yaml' import LAB_CONFIG_NAME with context %}
3{% from 'virtual-mcp-pike-dvr-ceph-rgw/underlay.yaml' import DOMAIN_NAME with context %}
4{% import 'shared-salt.yaml' as SHARED with context %}
Tatyana Leontovich56005da2017-12-11 13:16:51 +02005
6# Install ceph mons
7- description: Update grains
8 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
9 -C 'I@ceph:common' state.sls salt.minion.grains
10 node_name: {{ HOSTNAME_CFG01 }}
11 retry: {count: 1, delay: 10}
12 skip_fail: false
13
14- description: Generate keyrings
15 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
16 -C 'I@ceph:mon:keyring:mon or I@ceph:common:keyring:admin' state.sls ceph.mon
17 node_name: {{ HOSTNAME_CFG01 }}
18 retry: {count: 1, delay: 10}
19 skip_fail: false
20
21- description: Sync grains on ceph mon nodes
22 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
23 -C 'I@ceph:mon' saltutil.sync_grains
24 node_name: {{ HOSTNAME_CFG01 }}
25 retry: {count: 1, delay: 10}
26 skip_fail: false
27
28- description: Update mine on ceph mons
29 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
30 -C 'I@ceph:mon:keyring:mon or I@ceph:common:keyring:admin' mine.update
31 node_name: {{ HOSTNAME_CFG01 }}
32 retry: {count: 1, delay: 10}
33 skip_fail: false
34
35- description: Install ceph mon
36 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
37 -C 'I@ceph:mon' state.sls ceph.mon
38 node_name: {{ HOSTNAME_CFG01 }}
39 retry: {count: 1, delay: 5}
40 skip_fail: false
41
42- description: Install ceph mgr if defined(needed only for Luminious)
43 cmd: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +020044 if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:mgr' match.pillar 'ceph:mgr' ; then
45 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:mgr' state.sls ceph.mgr
Tatyana Leontovich56005da2017-12-11 13:16:51 +020046 fi
47 node_name: {{ HOSTNAME_CFG01 }}
48 retry: {count: 2, delay: 5}
49 skip_fail: false
50
51- description: Install ceph osd
52 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
53 -C 'I@ceph:osd' state.sls ceph.osd
54 node_name: {{ HOSTNAME_CFG01 }}
55 retry: {count: 1, delay: 5}
56 skip_fail: false
57
58- description: Sync grains
59 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
60 -C 'I@ceph:osd' saltutil.sync_grains
61 node_name: {{ HOSTNAME_CFG01 }}
62 retry: {count: 1, delay: 5}
63 skip_fail: false
64
65- description: Install ceph osd nodes
66 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
67 -C 'I@ceph:osd' state.sls ceph.osd.custom
68 node_name: {{ HOSTNAME_CFG01 }}
69 retry: {count: 1, delay: 5}
70 skip_fail: true
71
72- description: Sync grains
73 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
74 -C 'I@ceph:osd' saltutil.sync_grains
75 node_name: {{ HOSTNAME_CFG01 }}
76 retry: {count: 1, delay: 5}
77 skip_fail: false
78
79- description: Update mine on ceph osd
80 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
81 -C 'I@ceph:osd' mine.update
82 node_name: {{ HOSTNAME_CFG01 }}
83 retry: {count: 1, delay: 10}
84 skip_fail: false
85
86- description: Setup pools, keyrings and maybe crush
87 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
88 -C 'I@ceph:setup' state.sls ceph.setup
89 node_name: {{ HOSTNAME_CFG01 }}
90 retry: {count: 1, delay: 10}
91 skip_fail: false
92
93- description: Install ceph clinet
94 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
95 -C 'I@ceph:setup' state.sls ceph.setup
96 node_name: {{ HOSTNAME_CFG01 }}
97 retry: {count: 1, delay: 10}
98 skip_fail: false
99
100- description: Install radosgw if exists
101 cmd: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200102 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' saltutil.sync_grains;
103 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' state.sls ceph.radosgw;
104 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@keystone:client' state.sls keystone.client;
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200105 node_name: {{ HOSTNAME_CFG01 }}
106 retry: {count: 2, delay: 5}
107 skip_fail: false
108
109- description: Install ceph clinet
110 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
111 -C 'I@ceph:setup' state.sls ceph.setup
112 node_name: {{ HOSTNAME_CFG01 }}
113 retry: {count: 1, delay: 10}
114 skip_fail: false
115
Dennis Dmitriev5bcbdc52018-03-23 18:05:10 +0200116{%- for ssh in config.underlay.ssh %}
117 {%- set salt_roles = [] %}
118 {%- for role in ssh['roles'] %}
119 {%- if role in config.salt_deploy.salt_roles %}
120 {%- set _ = salt_roles.append(role) %}
121 {%- endif %}
122 {%- endfor %}
123
124 {%- if salt_roles %}
Tatyana Leontovich3fc6a092018-01-23 13:41:49 +0200125- description: Restart salt-minion as workaround of PROD-16970
126 cmd: |
127 service salt-minion restart; # For case if salt-minion was already installed
128 node_name: {{ ssh['node_name'] }}
129 retry: {count: 1, delay: 1}
130 skip_fail: false
Dennis Dmitriev5bcbdc52018-03-23 18:05:10 +0200131 {%- endif %}
132{%- endfor %}
Tatyana Leontovich3fc6a092018-01-23 13:41:49 +0200133
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200134- description: Connect ceph to glance
135 cmd: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200136 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;
137 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 +0200138 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 +0200139 node_name: {{ HOSTNAME_CFG01 }}
140 retry: {count: 2, delay: 5}
141 skip_fail: false
142
143- description: Connect ceph to cinder and nova
144 cmd: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200145 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;
146 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' state.sls ceph.common,ceph.setup.keyring;
147 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' saltutil.sync_grains;
148 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 +0200149 node_name: {{ HOSTNAME_CFG01 }}
150 retry: {count: 2, delay: 5}
151 skip_fail: false
152
153- description: Restart cinder volume
154 cmd: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200155 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@cinder:controller' service.restart cinder-volume;
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200156 node_name: {{ HOSTNAME_CFG01 }}
157 retry: {count: 2, delay: 5}
158 skip_fail: false
159
160- description: Restart nova-compute
161 cmd: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200162 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@nova:compute' service.restart nova-compute;
Tatyana Leontovich56005da2017-12-11 13:16:51 +0200163 node_name: {{ HOSTNAME_CFG01 }}
164 retry: {count: 2, delay: 5}
165 skip_fail: false
166
Oleksii Butenkofa5f0672018-04-20 14:43:14 +0300167{{ SHARED.RUN_NEW_TEMPEST() }}