ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 1 | {# Collection of common macroses shared across openstack services #} |
| 2 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 3 | {%- macro MACRO_INSTALL_KEYSTONE(USE_ORCHESTRATE=true) %} |
| 4 | {%- if USE_ORCHESTRATE %} |
| 5 | - description: | |
Oleksii Butenko | e0fc5f2 | 2018-09-25 14:29:42 +0300 | [diff] [blame] | 6 | Execute salt orchestration state to configure all needed |
ibumarskov | 330bc12 | 2018-08-23 13:02:04 +0400 | [diff] [blame] | 7 | prerequisites like creating SSH public key ant etc. |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 8 | Workaround for PROD-22488, use for PROD-22535. |
ibumarskov | 330bc12 | 2018-08-23 13:02:04 +0400 | [diff] [blame] | 9 | cmd: salt-run state.orchestrate keystone.orchestrate.deploy |
| 10 | node_name: {{ HOSTNAME_CFG01 }} |
| 11 | retry: {count: 1, delay: 5} |
| 12 | skip_fail: false |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 13 | {%- endif %} |
ibumarskov | 330bc12 | 2018-08-23 13:02:04 +0400 | [diff] [blame] | 14 | |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 15 | - description: Install keystone service on primary node |
| 16 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 17 | -C 'I@keystone:server and *01*' state.sls keystone.server |
| 18 | node_name: {{ HOSTNAME_CFG01 }} |
| 19 | retry: {count: 2, delay: 15} |
| 20 | skip_fail: false |
| 21 | |
| 22 | - description: Install keystone service on other nodes |
| 23 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 24 | -C 'I@keystone:server' state.sls keystone.server |
| 25 | node_name: {{ HOSTNAME_CFG01 }} |
| 26 | retry: {count: 2, delay: 15} |
| 27 | skip_fail: false |
| 28 | |
| 29 | - description: Restart apache due to PROD-10477 |
| 30 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' |
ibumarskov | 1b85e89 | 2018-08-30 11:54:47 +0400 | [diff] [blame] | 31 | cmd.run "service apache2 restart" |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 32 | node_name: {{ HOSTNAME_CFG01 }} |
| 33 | retry: {count: 1, delay: 15} |
| 34 | skip_fail: false |
| 35 | |
| 36 | - description: Check apache status to PROD-10477 |
| 37 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' |
ibumarskov | 1b85e89 | 2018-08-30 11:54:47 +0400 | [diff] [blame] | 38 | cmd.run "service apache2 status" |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 39 | node_name: {{ HOSTNAME_CFG01 }} |
| 40 | retry: {count: 1, delay: 15} |
| 41 | skip_fail: false |
| 42 | |
| 43 | - description: Populate keystone services/tenants/admins |
| 44 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 45 | -C 'I@keystone:client' state.sls keystone.client |
| 46 | node_name: {{ HOSTNAME_CFG01 }} |
| 47 | retry: {count: 2, delay: 5} |
| 48 | skip_fail: false |
| 49 | |
| 50 | - description: Check keystone service-list |
| 51 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Oleksii Butenko | 8b49a76 | 2018-09-18 11:46:35 +0300 | [diff] [blame] | 52 | -C "I@keystone:server" cmd.run ". /root/keystonercv3; |
| 53 | openstack service list" |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 54 | node_name: {{ HOSTNAME_CFG01 }} |
| 55 | retry: {count: 1, delay: 5} |
| 56 | skip_fail: false |
| 57 | {%- endmacro %} |
| 58 | |
| 59 | {%- macro MACRO_INSTALL_GLANCE() %} |
| 60 | - description: Install glance service on primary node |
| 61 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 62 | -C 'I@glance:server and *01*' state.sls glance.server |
| 63 | node_name: {{ HOSTNAME_CFG01 }} |
| 64 | retry: {count: 1, delay: 5} |
| 65 | skip_fail: false |
| 66 | |
| 67 | - description: Install glance service on other nodes |
| 68 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 69 | -C 'I@glance:server' state.sls glance.server |
| 70 | node_name: {{ HOSTNAME_CFG01 }} |
| 71 | retry: {count: 1, delay: 5} |
| 72 | skip_fail: false |
| 73 | |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 74 | - description: Check glance image-list |
| 75 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Oleksii Butenko | 8b49a76 | 2018-09-18 11:46:35 +0300 | [diff] [blame] | 76 | -C "I@keystone:server" cmd.run ". /root/keystonercv3; |
| 77 | openstack image list" |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 78 | node_name: {{ HOSTNAME_CFG01 }} |
Dennis Dmitriev | b1cd346 | 2018-12-11 18:56:41 +0200 | [diff] [blame] | 79 | retry: {count: 5, delay: 15} |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 80 | skip_fail: false |
| 81 | {%- endmacro %} |
| 82 | |
| 83 | {%- macro MACRO_INSTALL_NOVA() %} |
Tatyana Leontovich | 114953d | 2018-11-01 15:45:26 +0200 | [diff] [blame] | 84 | |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 85 | - description: Install nova service on primary node |
| 86 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 87 | -C "I@nova:controller and *01*" state.sls nova.controller |
| 88 | node_name: {{ HOSTNAME_CFG01 }} |
| 89 | retry: {count: 1, delay: 5} |
| 90 | skip_fail: false |
| 91 | |
| 92 | - description: Install nova service on other nodes |
| 93 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 94 | -C "I@nova:controller" state.sls nova.controller |
| 95 | node_name: {{ HOSTNAME_CFG01 }} |
| 96 | retry: {count: 1, delay: 5} |
| 97 | skip_fail: false |
| 98 | |
| 99 | - description: Check nova service-list |
| 100 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Oleksii Butenko | 8b49a76 | 2018-09-18 11:46:35 +0300 | [diff] [blame] | 101 | -C "I@keystone:server" cmd.run ". /root/keystonercv3; |
| 102 | openstack compute service list" |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 103 | node_name: {{ HOSTNAME_CFG01 }} |
| 104 | retry: {count: 1, delay: 5} |
| 105 | skip_fail: false |
| 106 | |
| 107 | - description: Check nova list |
| 108 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Oleksii Butenko | 8b49a76 | 2018-09-18 11:46:35 +0300 | [diff] [blame] | 109 | -C "I@keystone:server" cmd.run ". /root/keystonercv3; |
| 110 | openstack server list" |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 111 | node_name: {{ HOSTNAME_CFG01 }} |
| 112 | retry: {count: 1, delay: 5} |
| 113 | skip_fail: false |
Tatyana Leontovich | b4c519d | 2018-10-31 13:44:45 +0200 | [diff] [blame] | 114 | |
| 115 | - description: Create nova resources |
Tatyana Leontovich | a5b8d60 | 2018-10-31 16:34:31 +0200 | [diff] [blame] | 116 | cmd: | |
Tatyana Leontovich | d3b17e7 | 2018-11-01 13:34:54 +0200 | [diff] [blame] | 117 | if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@nova:client' match.pillar 'nova:client' ; then |
Tatyana Leontovich | a5b8d60 | 2018-10-31 16:34:31 +0200 | [diff] [blame] | 118 | salt --hard-crash --state-output=mixed --state-verbose=False -C "I@nova:client" state.sls nova.client |
| 119 | fi |
Tatyana Leontovich | b4c519d | 2018-10-31 13:44:45 +0200 | [diff] [blame] | 120 | node_name: {{ HOSTNAME_CFG01 }} |
| 121 | retry: {count: 1, delay: 5} |
| 122 | skip_fail: false |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 123 | {%- endmacro %} |
| 124 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 125 | {%- macro MACRO_INSTALL_CINDER(INSTALL_VOLUME=false) %} |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 126 | - description: Install cinder on primary node |
| 127 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 128 | -C "I@cinder:controller and *01*" state.sls cinder |
| 129 | node_name: {{ HOSTNAME_CFG01 }} |
| 130 | retry: {count: 1, delay: 5} |
| 131 | skip_fail: false |
| 132 | |
| 133 | - description: Install cinder on other nodes |
| 134 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 135 | -C "I@cinder:controller" state.sls cinder |
| 136 | node_name: {{ HOSTNAME_CFG01 }} |
| 137 | retry: {count: 1, delay: 5} |
| 138 | skip_fail: false |
| 139 | |
| 140 | - description: Check cinder list |
| 141 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Oleksii Butenko | 8b49a76 | 2018-09-18 11:46:35 +0300 | [diff] [blame] | 142 | -C "I@keystone:server" cmd.run ". /root/keystonercv3; |
| 143 | openstack volume list" |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 144 | node_name: {{ HOSTNAME_CFG01 }} |
| 145 | retry: {count: 1, delay: 5} |
| 146 | skip_fail: false |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 147 | |
| 148 | {%- if INSTALL_VOLUME %} |
Oleksii Butenko | bf9ad0a | 2018-11-06 10:36:36 +0200 | [diff] [blame] | 149 | - description: Install cinder volume, PROD-24485 set retry 2 |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 150 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 151 | -C 'I@cinder:volume' state.sls cinder |
| 152 | node_name: {{ HOSTNAME_CFG01 }} |
Oleksii Butenko | bf9ad0a | 2018-11-06 10:36:36 +0200 | [diff] [blame] | 153 | retry: {count: 2, delay: 5} |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 154 | skip_fail: false |
| 155 | {%- endif %} |
| 156 | |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 157 | {%- endmacro %} |
| 158 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 159 | {%- macro MACRO_INSTALL_NEUTRON(INSTALL_GATEWAY=true) %} |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 160 | - description: Install neutron service on primary node |
| 161 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 162 | -C "I@neutron:server and *01*" state.sls neutron.server |
| 163 | node_name: {{ HOSTNAME_CFG01 }} |
| 164 | retry: {count: 1, delay: 5} |
| 165 | skip_fail: false |
| 166 | |
| 167 | - description: Install neutron service on other nodes |
| 168 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 169 | -C "I@neutron:server" state.sls neutron.server |
| 170 | node_name: {{ HOSTNAME_CFG01 }} |
| 171 | retry: {count: 1, delay: 5} |
| 172 | skip_fail: false |
| 173 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 174 | {%- if INSTALL_GATEWAY %} |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 175 | - description: Install neutron on gtw node |
| 176 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 177 | -C 'I@neutron:gateway' state.sls neutron |
| 178 | node_name: {{ HOSTNAME_CFG01 }} |
| 179 | retry: {count: 1, delay: 5} |
| 180 | skip_fail: false |
| 181 | |
| 182 | - description: Check neutron agent-list |
| 183 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Oleksii Butenko | 16f8691 | 2018-09-20 11:47:00 +0300 | [diff] [blame] | 184 | -C 'I@keystone:server' cmd.run '. /root/keystonercv3; neutron agent-list' |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 185 | node_name: {{ HOSTNAME_CFG01 }} |
| 186 | retry: {count: 1, delay: 5} |
| 187 | skip_fail: false |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 188 | {%- endif %} |
| 189 | |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 190 | {%- endmacro %} |
| 191 | |
| 192 | {%- macro MACRO_INSTALL_HEAT() %} |
| 193 | - description: Install heat service on primary node |
| 194 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 195 | -C "I@heat:server and *01*" state.sls heat.server |
| 196 | node_name: {{ HOSTNAME_CFG01 }} |
| 197 | retry: {count: 1, delay: 5} |
| 198 | skip_fail: false |
| 199 | |
| 200 | - description: Install heat service on other nodes |
| 201 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 202 | -C "I@heat:server" state.sls heat.server |
| 203 | node_name: {{ HOSTNAME_CFG01 }} |
| 204 | retry: {count: 1, delay: 5} |
| 205 | skip_fail: false |
| 206 | |
| 207 | - description: Check heat service |
| 208 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Oleksii Butenko | 8b49a76 | 2018-09-18 11:46:35 +0300 | [diff] [blame] | 209 | -C 'I@keystone:server' cmd.run '. /root/keystonercv3; |
| 210 | openstack orchestration resource type list' |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 211 | node_name: {{ HOSTNAME_CFG01 }} |
| 212 | retry: {count: 5, delay: 10} |
| 213 | skip_fail: false |
| 214 | {%- endmacro %} |
| 215 | |
| 216 | {%- macro MACRO_INSTALL_HORIZON() %} |
| 217 | - description: Deploy horizon dashboard |
| 218 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 219 | -C 'I@horizon:server' state.sls horizon |
| 220 | node_name: {{ HOSTNAME_CFG01 }} |
| 221 | retry: {count: 1, delay: 5} |
| 222 | skip_fail: true |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 223 | {%- endmacro %} |
| 224 | |
Oleksii Butenko | 81d8a7f | 2018-09-26 16:09:27 +0300 | [diff] [blame] | 225 | {%- macro MACRO_INSTALL_DESIGNATE(INSTALL_POWERDNS=false, INSTALL_BIND=false) %} |
Oleksii Butenko | e0fc5f2 | 2018-09-25 14:29:42 +0300 | [diff] [blame] | 226 | {%- if INSTALL_POWERDNS %} |
| 227 | - description: Install powerdns |
| 228 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 229 | -C 'I@powerdns:server' state.sls powerdns.server |
| 230 | node_name: {{ HOSTNAME_CFG01 }} |
| 231 | retry: {count: 1, delay: 5} |
| 232 | skip_fail: false |
| 233 | {%- endif %} |
| 234 | |
Oleksii Butenko | 81d8a7f | 2018-09-26 16:09:27 +0300 | [diff] [blame] | 235 | {%- if INSTALL_BIND %} |
| 236 | - description: Install bind |
| 237 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 238 | -C 'I@bind:server' state.sls bind |
| 239 | node_name: {{ HOSTNAME_CFG01 }} |
| 240 | retry: {count: 1, delay: 5} |
| 241 | skip_fail: false |
| 242 | {%- endif %} |
| 243 | |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 244 | - description: Install designate on primary node |
| 245 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 246 | -C "I@designate:server and *01*" state.sls designate.server |
| 247 | node_name: {{ HOSTNAME_CFG01 }} |
| 248 | retry: {count: 5, delay: 10} |
| 249 | skip_fail: false |
| 250 | |
| 251 | - description: Install designate on other nodes |
| 252 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 253 | -C "I@designate:server" state.sls designate |
| 254 | node_name: {{ HOSTNAME_CFG01 }} |
| 255 | retry: {count: 5, delay: 10} |
| 256 | skip_fail: false |
| 257 | {%- endmacro %} |
| 258 | |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 259 | {%- macro MACRO_INSTALL_BARBICAN() %} |
obutenko | f009ed4 | 2018-11-12 14:50:51 +0200 | [diff] [blame] | 260 | |
| 261 | - description: Install barbican server |
| 262 | cmd: | |
obutenko | bc4f4b2 | 2018-11-13 15:36:51 +0200 | [diff] [blame] | 263 | salt -C 'I@barbican:server:role:primary' state.sls barbican.server; |
| 264 | salt -C 'I@barbican:server' state.sls barbican.server; |
obutenko | f009ed4 | 2018-11-12 14:50:51 +0200 | [diff] [blame] | 265 | node_name: {{ HOSTNAME_CFG01 }} |
| 266 | retry: {count: 1, delay: 5} |
| 267 | skip_fail: false |
| 268 | |
| 269 | {%- endmacro %} |
| 270 | |
| 271 | {%- macro MACRO_INSTALL_DOGTAG() %} |
| 272 | |
| 273 | - description: Install dogtag server |
| 274 | cmd: | |
| 275 | salt -C 'I@dogtag:server:role:master' state.sls dogtag.server; |
| 276 | salt -C 'I@dogtag:server' state.sls dogtag.server; |
| 277 | node_name: {{ HOSTNAME_CFG01 }} |
| 278 | retry: {count: 1, delay: 5} |
| 279 | skip_fail: false |
| 280 | |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 281 | {%- endmacro %} |
| 282 | |
| 283 | {%- macro MACRO_INSTALL_IRONIC() %} |
| 284 | # TO DO |
| 285 | {%- endmacro %} |
| 286 | |
| 287 | {%- macro MACRO_INSTALL_MANILA() %} |
Oleksii Butenko | f57d1ff | 2018-09-28 17:59:45 +0300 | [diff] [blame] | 288 | - description: Install manila-api on first node |
| 289 | cmd: | |
| 290 | salt -C 'I@manila:api and *01*' state.sls manila.api; |
| 291 | node_name: {{ HOSTNAME_CFG01 }} |
| 292 | retry: {count: 1, delay: 5} |
| 293 | skip_fail: false |
| 294 | |
Oleksii Butenko | f57d1ff | 2018-09-28 17:59:45 +0300 | [diff] [blame] | 295 | - description: Install manila-scheduler |
| 296 | cmd: | |
| 297 | salt -C 'I@manila:scheduler' state.sls manila.scheduler; |
| 298 | node_name: {{ HOSTNAME_CFG01 }} |
| 299 | retry: {count: 1, delay: 5} |
| 300 | skip_fail: false |
| 301 | |
| 302 | - description: Install manila-share |
| 303 | cmd: | |
| 304 | salt -C 'I@manila:share' state.sls manila.share; |
| 305 | node_name: {{ HOSTNAME_CFG01 }} |
| 306 | retry: {count: 1, delay: 5} |
| 307 | skip_fail: false |
| 308 | |
Oleksii Butenko | f57d1ff | 2018-09-28 17:59:45 +0300 | [diff] [blame] | 309 | - description: Check manila-services |
| 310 | cmd: | |
| 311 | salt 'ctl01*' cmd.run '. /root/keystonercv3; manila service-list' |
| 312 | node_name: {{ HOSTNAME_CFG01 }} |
| 313 | retry: {count: 3, delay: 15} |
| 314 | skip_fail: false |
| 315 | |
| 316 | - description: Create manila type |
| 317 | cmd: | |
Oleksii Butenko | 4077242 | 2018-10-01 16:52:49 +0300 | [diff] [blame] | 318 | salt -C "I@manila:client" state.sls manila.client |
Oleksii Butenko | f57d1ff | 2018-09-28 17:59:45 +0300 | [diff] [blame] | 319 | node_name: {{ HOSTNAME_CFG01 }} |
| 320 | retry: {count: 1, delay: 5} |
| 321 | skip_fail: false |
| 322 | |
| 323 | - description: Create CIFS and NFS share and check it status |
| 324 | cmd: | |
| 325 | salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create CIFS 1 --share-type=default'; |
| 326 | salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create NFS 1 --share-type=default'; |
| 327 | sleep 5; |
| 328 | salt 'ctl01*' cmd.run '. /root/keystonercv3; manila list'; |
| 329 | node_name: {{ HOSTNAME_CFG01 }} |
| 330 | retry: {count: 1, delay: 5} |
| 331 | skip_fail: false |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 332 | {%- endmacro %} |
| 333 | |
| 334 | {%- macro MACRO_INSTALL_OCTAVIA_API() %} |
Tatyana Leontovich | 56a7241 | 2018-11-05 14:11:41 +0200 | [diff] [blame] | 335 | |
| 336 | - description: Execute glance client to upload octavia image |
| 337 | cmd: salt -C 'I@glance:client' state.sls glance.client |
| 338 | node_name: {{ HOSTNAME_CFG01 }} |
| 339 | retry: {count: 1, delay: 5} |
| 340 | skip_fail: false |
| 341 | |
Tatyana Leontovich | da703b9 | 2018-11-06 22:31:40 +0200 | [diff] [blame] | 342 | - description: Execute neutron client to create octavia resources |
| 343 | cmd: salt -C 'I@neutron:client' state.sls neutron.client |
| 344 | node_name: {{ HOSTNAME_CFG01 }} |
| 345 | retry: {count: 1, delay: 5} |
| 346 | skip_fail: false |
| 347 | |
Tatyana Leontovich | 931892e | 2018-10-18 14:27:12 +0300 | [diff] [blame] | 348 | - description: Install octavia api service on primary node |
| 349 | cmd: salt -C 'I@octavia:api:role:primary' state.sls octavia.api |
| 350 | node_name: {{ HOSTNAME_CFG01 }} |
| 351 | retry: {count: 1, delay: 5} |
| 352 | skip_fail: false |
| 353 | |
| 354 | - description: Install octavia api service |
| 355 | cmd: salt -C 'I@octavia:api' state.sls octavia.api |
| 356 | node_name: {{ HOSTNAME_CFG01 }} |
| 357 | retry: {count: 1, delay: 5} |
| 358 | skip_fail: false |
| 359 | |
| 360 | {%- endmacro %} |
| 361 | |
| 362 | {%- macro MACRO_INSTALL_OCTAVIA_MANAGER() %} |
| 363 | - description: Update mine |
| 364 | cmd: salt -C 'I@neutron:client' mine.update && sleep 60 |
| 365 | node_name: {{ HOSTNAME_CFG01 }} |
| 366 | retry: {count: 1, delay: 5} |
| 367 | skip_fail: false |
| 368 | |
| 369 | - description: Install octavia manager |
| 370 | cmd: salt -C 'I@octavia:manager' state.sls octavia.manager |
| 371 | node_name: {{ HOSTNAME_CFG01 }} |
| 372 | retry: {count: 1, delay: 5} |
| 373 | skip_fail: false |
| 374 | |
| 375 | - description: Execute octavia ca |
| 376 | cmd: salt -C 'I@octavia:manager' state.sls salt.minion.ca |
| 377 | node_name: {{ HOSTNAME_CFG01 }} |
| 378 | retry: {count: 1, delay: 5} |
| 379 | skip_fail: false |
| 380 | |
| 381 | - description: Execute octavia cert |
| 382 | cmd: salt -C 'I@octavia:manager' state.sls salt.minion.cert |
| 383 | node_name: {{ HOSTNAME_CFG01 }} |
| 384 | retry: {count: 1, delay: 5} |
| 385 | skip_fail: false |
| 386 | |
| 387 | - description: Execute octavia client |
| 388 | cmd: salt -C 'I@octavia:client' state.sls octavia.client |
| 389 | node_name: {{ HOSTNAME_CFG01 }} |
| 390 | retry: {count: 1, delay: 5} |
| 391 | skip_fail: false |
| 392 | |
ibumarskov | b521006 | 2018-08-22 16:18:15 +0400 | [diff] [blame] | 393 | {%- endmacro %} |
| 394 | |
Oleksii Butenko | de0c5ee | 2018-09-24 15:29:45 +0300 | [diff] [blame] | 395 | {%- macro MACRO_INSTALL_COMPUTE(CELL_MAPPING=false) %} |
Oleksii Butenko | 20947f2 | 2018-08-29 15:48:21 +0300 | [diff] [blame] | 396 | # Install compute node |
| 397 | - description: Apply formulas for compute node |
| 398 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 399 | node_name: {{ HOSTNAME_CFG01 }} |
| 400 | retry: {count: 1, delay: 5} |
| 401 | skip_fail: true |
| 402 | |
| 403 | - description: Re-apply(as in doc) formulas for compute node |
| 404 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 405 | node_name: {{ HOSTNAME_CFG01 }} |
| 406 | retry: {count: 1, delay: 5} |
| 407 | skip_fail: false |
| 408 | |
| 409 | - description: Check IP on computes |
| 410 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run |
| 411 | 'ip a' |
| 412 | node_name: {{ HOSTNAME_CFG01 }} |
| 413 | retry: {count: 10, delay: 30} |
| 414 | skip_fail: false |
Oleksii Butenko | de0c5ee | 2018-09-24 15:29:45 +0300 | [diff] [blame] | 415 | |
| 416 | {%- if CELL_MAPPING %} |
| 417 | - description: Re-run nova for map cell mapping |
| 418 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 419 | -C "I@nova:controller and *01*" state.sls nova.controller |
| 420 | node_name: {{ HOSTNAME_CFG01 }} |
| 421 | retry: {count: 1, delay: 5} |
| 422 | skip_fail: false |
| 423 | {%- endif %} |
Oleksii Butenko | 48f9a7b | 2018-10-11 14:04:45 +0300 | [diff] [blame] | 424 | {%- endmacro %} |
Oleksii Butenko | de0c5ee | 2018-09-24 15:29:45 +0300 | [diff] [blame] | 425 | |
Oleksii Butenko | 48f9a7b | 2018-10-11 14:04:45 +0300 | [diff] [blame] | 426 | {%- macro MACRO_INSTALL_REDIS() %} |
| 427 | - description: Install redis service |
| 428 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@redis:cluster:role:master' state.sls redis && |
| 429 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@redis:server' state.sls redis |
| 430 | node_name: {{ HOSTNAME_CFG01 }} |
| 431 | retry: {count: 1, delay: 5} |
| 432 | skip_fail: false |
| 433 | {%- endmacro %} |
| 434 | |
| 435 | {%- macro MACRO_INSTALL_GNOCCHI() %} |
| 436 | - description: Install gnocchi server |
| 437 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:server and *01*' state.sls gnocchi.server && |
| 438 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:server' state.sls gnocchi.server |
| 439 | node_name: {{ HOSTNAME_CFG01 }} |
| 440 | retry: {count: 1, delay: 5} |
| 441 | skip_fail: false |
| 442 | |
| 443 | - description: Setup gnocchi client |
| 444 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:client and *01*' state.sls gnocchi.client && |
| 445 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@gnocchi:client' state.sls gnocchi.client |
| 446 | node_name: {{ HOSTNAME_CFG01 }} |
| 447 | retry: {count: 1, delay: 5} |
| 448 | skip_fail: false |
| 449 | {%- endmacro %} |
| 450 | |
| 451 | {%- macro MACRO_INSTALL_PANKO() %} |
| 452 | - description: Install panko server |
| 453 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@panko:server and *01*' state.sls panko && |
| 454 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@panko:server' state.sls panko |
| 455 | node_name: {{ HOSTNAME_CFG01 }} |
| 456 | retry: {count: 1, delay: 5} |
| 457 | skip_fail: false |
| 458 | {%- endmacro %} |
| 459 | |
| 460 | {%- macro MACRO_INSTALL_CEILOMETER() %} |
| 461 | - description: Install ceilometer server on first node |
| 462 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceilometer:server and *01*' state.sls ceilometer |
| 463 | node_name: {{ HOSTNAME_CFG01 }} |
| 464 | retry: {count: 2, delay: 5} |
| 465 | skip_fail: false |
| 466 | |
| 467 | - description: Install ceilometer server on other nodes |
| 468 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceilometer:server' state.sls ceilometer |
| 469 | node_name: {{ HOSTNAME_CFG01 }} |
| 470 | retry: {count: 2, delay: 5} |
| 471 | skip_fail: false |
| 472 | {%- endmacro %} |
| 473 | |
| 474 | {%- macro MACRO_INSTALL_AODH() %} |
| 475 | - description: Install aodh server |
| 476 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@aodh:server and *01*' state.sls aodh && |
| 477 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@aodh:server' state.sls aodh |
| 478 | node_name: {{ HOSTNAME_CFG01 }} |
| 479 | retry: {count: 1, delay: 5} |
| 480 | skip_fail: false |
Oleksii Butenko | 20947f2 | 2018-08-29 15:48:21 +0300 | [diff] [blame] | 481 | {%- endmacro %} |
Oleksii Butenko | ffc0922 | 2018-09-21 12:37:16 +0300 | [diff] [blame] | 482 | |
| 483 | {%- macro OVERRIDE_POLICY() %} |
| 484 | - description: Upload policy override |
| 485 | upload: |
| 486 | local_path: {{ config.salt_deploy.templates_dir }}{{ LAB_CONFIG_NAME }}/ |
| 487 | local_filename: overrides-policy.yml |
| 488 | remote_path: /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/ |
| 489 | node_name: {{ HOSTNAME_CFG01 }} |
| 490 | |
| 491 | - description: Create custom cluster control class |
| 492 | cmd: echo -e "classes:\n- cluster.{{ LAB_CONFIG_NAME }}.openstack.control_orig\n$(cat /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml)" > /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml |
| 493 | node_name: {{ HOSTNAME_CFG01 }} |
| 494 | |
| 495 | - description: Rename control classes |
| 496 | cmd: mv /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control_orig.yml && |
| 497 | ln -s /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/overrides-policy.yml /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml && |
| 498 | salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all && |
| 499 | salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar |
| 500 | node_name: {{ HOSTNAME_CFG01 }} |
Oleksii Butenko | c07e406 | 2018-10-29 12:04:42 +0200 | [diff] [blame] | 501 | {%- endmacro %} |