blob: e55c9f8d2fa2702849c491eb0b410617c200a453 [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 %}
Tatyana Leontovich7a869a72018-04-20 17:20:00 +03002{% from 'virtual-mcp-pike-dvr-ceph-rgw/underlay.yaml' import HOSTNAME_GTW01 with context %}
Oleksii Butenkofa5f0672018-04-20 14:43:14 +03003{% from 'virtual-mcp-pike-dvr-ceph-rgw/underlay.yaml' import LAB_CONFIG_NAME with context %}
4{% from 'virtual-mcp-pike-dvr-ceph-rgw/underlay.yaml' import DOMAIN_NAME with context %}
5{% import 'shared-salt.yaml' as SHARED with context %}
Tatyana Leontovich56005da2017-12-11 13:16:51 +02006
Tatyana Leontovich26756912018-06-06 20:11:05 +03007{% import 'shared-backup-restore.yaml' as BACKUP with context %}
8
Tatyana Leontovich56005da2017-12-11 13:16:51 +02009# Install ceph mons
10- description: Update grains
11 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
12 -C 'I@ceph:common' state.sls salt.minion.grains
13 node_name: {{ HOSTNAME_CFG01 }}
14 retry: {count: 1, delay: 10}
15 skip_fail: false
16
17- description: Generate keyrings
18 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
19 -C 'I@ceph:mon:keyring:mon or I@ceph:common:keyring:admin' state.sls ceph.mon
20 node_name: {{ HOSTNAME_CFG01 }}
21 retry: {count: 1, delay: 10}
22 skip_fail: false
23
24- description: Sync grains on ceph mon nodes
25 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
26 -C 'I@ceph:mon' saltutil.sync_grains
27 node_name: {{ HOSTNAME_CFG01 }}
28 retry: {count: 1, delay: 10}
29 skip_fail: false
30
31- description: Update mine on ceph mons
32 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
33 -C 'I@ceph:mon:keyring:mon or I@ceph:common:keyring:admin' mine.update
34 node_name: {{ HOSTNAME_CFG01 }}
35 retry: {count: 1, delay: 10}
36 skip_fail: false
37
38- description: Install ceph mon
39 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
40 -C 'I@ceph:mon' state.sls ceph.mon
41 node_name: {{ HOSTNAME_CFG01 }}
42 retry: {count: 1, delay: 5}
43 skip_fail: false
44
45- description: Install ceph mgr if defined(needed only for Luminious)
46 cmd: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +020047 if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:mgr' match.pillar 'ceph:mgr' ; then
48 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:mgr' state.sls ceph.mgr
Tatyana Leontovich56005da2017-12-11 13:16:51 +020049 fi
50 node_name: {{ HOSTNAME_CFG01 }}
51 retry: {count: 2, delay: 5}
52 skip_fail: false
53
54- description: Install ceph osd
55 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
56 -C 'I@ceph:osd' state.sls ceph.osd
57 node_name: {{ HOSTNAME_CFG01 }}
58 retry: {count: 1, delay: 5}
59 skip_fail: false
60
61- description: Sync grains
62 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
63 -C 'I@ceph:osd' saltutil.sync_grains
64 node_name: {{ HOSTNAME_CFG01 }}
65 retry: {count: 1, delay: 5}
66 skip_fail: false
67
68- description: Install ceph osd nodes
69 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
70 -C 'I@ceph:osd' state.sls ceph.osd.custom
71 node_name: {{ HOSTNAME_CFG01 }}
72 retry: {count: 1, delay: 5}
73 skip_fail: true
74
75- description: Sync grains
76 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
77 -C 'I@ceph:osd' saltutil.sync_grains
78 node_name: {{ HOSTNAME_CFG01 }}
79 retry: {count: 1, delay: 5}
80 skip_fail: false
81
82- description: Update mine on ceph osd
83 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
84 -C 'I@ceph:osd' mine.update
85 node_name: {{ HOSTNAME_CFG01 }}
86 retry: {count: 1, delay: 10}
87 skip_fail: false
88
89- description: Setup pools, keyrings and maybe crush
90 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
91 -C 'I@ceph:setup' state.sls ceph.setup
92 node_name: {{ HOSTNAME_CFG01 }}
93 retry: {count: 1, delay: 10}
94 skip_fail: false
95
96- description: Install ceph clinet
97 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
98 -C 'I@ceph:setup' state.sls ceph.setup
99 node_name: {{ HOSTNAME_CFG01 }}
100 retry: {count: 1, delay: 10}
101 skip_fail: false
102
103- description: Install radosgw if exists
104 cmd: |
Dennis Dmitriev281221b2018-02-13 16:40:48 +0200105 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' saltutil.sync_grains;
106 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:radosgw' state.sls ceph.radosgw;
107 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@keystone:client' state.sls keystone.client;
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
169
Tatyana Leontovich26756912018-06-06 20:11:05 +0300170{{ BACKUP.MACRO_BACKUP_CEPH() }}
Oleksii Butenko5cd0a162018-06-14 18:18:10 +0300171{{ SHARED.INSTALL_DOCKER_ON_GTW() }}