blob: 5f2a4ae93a5e0935c875002fdd9038abad01f1e2 [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
7{% import 'shared-backup-restore.yaml' as BACKUP with context %}
8
9# 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: |
47 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
49 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: |
105 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;
108 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
119{%- 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 %}
128- 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
134 {%- endif %}
135{%- endfor %}
136
137- description: Connect ceph to glance
138 cmd: |
139 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;
141 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@glance:server' service.restart glance-registry;
142 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: |
148 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;
152 node_name: {{ HOSTNAME_CFG01 }}
153 retry: {count: 2, delay: 5}
154 skip_fail: false
155
156- description: Restart cinder volume
157 cmd: |
158 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@cinder:controller' service.restart cinder-volume;
159 node_name: {{ HOSTNAME_CFG01 }}
160 retry: {count: 2, delay: 5}
161 skip_fail: false
162
163- description: Restart nova-compute
164 cmd: |
165 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@nova:compute' service.restart nova-compute;
166 node_name: {{ HOSTNAME_CFG01 }}
167 retry: {count: 2, delay: 5}
168 skip_fail: false
169
170{{ BACKUP.MACRO_BACKUP_CEPH() }}
171{{ SHARED.INSTALL_DOCKER_ON_GTW() }}