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