Tatyana Leontovich | c447b12 | 2018-02-22 12:30:42 +0200 | [diff] [blame] | 1 | {% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | {% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import HOSTNAME_CTL01 with context %} |
| 3 | {% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import HOSTNAME_CTL02 with context %} |
| 4 | {% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import HOSTNAME_CTL03 with context %} |
| 5 | {% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import HOSTNAME_GTW01 with context %} |
Oleksii Butenko | c05c9f6 | 2018-04-19 19:00:02 +0300 | [diff] [blame] | 6 | {% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import LAB_CONFIG_NAME with context %} |
| 7 | {% from 'virtual-mcp-pike-dvr-ssl/underlay.yaml' import DOMAIN_NAME with context %} |
Tatyana Leontovich | c447b12 | 2018-02-22 12:30:42 +0200 | [diff] [blame] | 8 | {% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %} |
| 9 | {% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %} |
Tatyana Leontovich | c447b12 | 2018-02-22 12:30:42 +0200 | [diff] [blame] | 10 | {% set OVERRIDE_POLICY = os_env('OVERRIDE_POLICY', '') %} |
Oleksii Butenko | c05c9f6 | 2018-04-19 19:00:02 +0300 | [diff] [blame] | 11 | {% import 'shared-salt.yaml' as SHARED with context %} |
| 12 | |
Tatyana Leontovich | c447b12 | 2018-02-22 12:30:42 +0200 | [diff] [blame] | 13 | |
| 14 | # Install OpenStack control services |
| 15 | |
| 16 | {%- if OVERRIDE_POLICY != '' %} |
| 17 | - description: Upload policy override |
| 18 | upload: |
| 19 | local_path: {{ config.salt_deploy.templates_dir }}{{ LAB_CONFIG_NAME }}/ |
| 20 | local_filename: overrides-policy.yml |
| 21 | remote_path: /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/ |
| 22 | node_name: {{ HOSTNAME_CFG01 }} |
| 23 | |
| 24 | - description: Create custom cluster control class |
| 25 | 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 |
| 26 | node_name: {{ HOSTNAME_CFG01 }} |
| 27 | |
| 28 | - description: Rename control classes |
| 29 | 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 && |
| 30 | 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 && |
| 31 | salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.sync_all && |
| 32 | salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar |
| 33 | node_name: {{ HOSTNAME_CFG01 }} |
| 34 | {%- endif %} |
| 35 | |
| 36 | - description: Nginx |
| 37 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 38 | -C 'I@nginx:server' state.sls salt.minion |
| 39 | node_name: {{ HOSTNAME_CFG01 }} |
| 40 | retry: {count: 1, delay: 5} |
| 41 | skip_fail: true |
| 42 | |
| 43 | - description: Deploy nginx proxy |
| 44 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 45 | -C 'I@nginx:server' state.sls nginx |
| 46 | node_name: {{ HOSTNAME_CFG01 }} |
| 47 | retry: {count: 1, delay: 5} |
| 48 | skip_fail: true |
| 49 | |
| 50 | - description: Install glance on all controllers |
| 51 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 52 | -C 'I@glance:server' state.sls glance -b 1 |
| 53 | node_name: {{ HOSTNAME_CFG01 }} |
| 54 | retry: {count: 1, delay: 5} |
| 55 | skip_fail: false |
| 56 | |
| 57 | - description: Install keystone service (note that different fernet keys are created on different nodes) |
| 58 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 59 | -C 'I@keystone:server' state.sls keystone.server -b 1 |
| 60 | node_name: {{ HOSTNAME_CFG01 }} |
| 61 | retry: {count: 2, delay: 15} |
| 62 | skip_fail: false |
| 63 | |
| 64 | - description: Restart apache due to PROD-10477 |
| 65 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl restart apache2" |
| 66 | node_name: {{ HOSTNAME_CFG01 }} |
| 67 | retry: {count: 1, delay: 15} |
| 68 | skip_fail: false |
| 69 | |
| 70 | - description: Check apache status to PROD-10477 |
| 71 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl status apache2" |
| 72 | node_name: {{ HOSTNAME_CFG01 }} |
| 73 | retry: {count: 1, delay: 15} |
| 74 | skip_fail: false |
| 75 | |
| 76 | - description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users) |
| 77 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 78 | -C 'I@glance:server' state.sls glusterfs.client |
| 79 | node_name: {{ HOSTNAME_CFG01 }} |
| 80 | retry: {count: 1, delay: 5} |
| 81 | skip_fail: false |
| 82 | |
| 83 | - description: Update fernet keys for keystone server on the mounted glusterfs volume |
| 84 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 85 | -C 'I@keystone:server' state.sls keystone.server -b 1 |
| 86 | node_name: {{ HOSTNAME_CFG01 }} |
| 87 | retry: {count: 1, delay: 5} |
| 88 | skip_fail: false |
| 89 | |
| 90 | - description: Populate keystone services/tenants/admins |
| 91 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 92 | -C 'I@keystone:client' state.sls keystone.client |
| 93 | node_name: {{ HOSTNAME_CFG01 }} |
| 94 | retry: {count: 2, delay: 5} |
| 95 | skip_fail: false |
| 96 | |
| 97 | - description: Check keystone service-list |
| 98 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 99 | -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list' |
| 100 | node_name: {{ HOSTNAME_CFG01 }} |
| 101 | retry: {count: 1, delay: 5} |
| 102 | skip_fail: false |
| 103 | |
| 104 | - description: Check glance image-list |
| 105 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 106 | -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list' |
| 107 | node_name: {{ HOSTNAME_CFG01 }} |
| 108 | retry: {count: 1, delay: 5} |
| 109 | skip_fail: false |
| 110 | |
| 111 | |
| 112 | - description: Install nova on all controllers |
| 113 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 114 | -C 'I@nova:controller' state.sls nova -b 1 |
| 115 | node_name: {{ HOSTNAME_CFG01 }} |
| 116 | retry: {count: 2, delay: 5} |
| 117 | skip_fail: false |
| 118 | |
| 119 | - description: Check nova service-list |
| 120 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 121 | -C 'I@keystone:server' cmd.run '. /root/keystonerc; nova --debug service-list' |
| 122 | node_name: {{ HOSTNAME_CFG01 }} |
| 123 | retry: {count: 3, delay: 5} |
| 124 | skip_fail: false |
| 125 | |
| 126 | |
| 127 | - description: Install cinder |
| 128 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 129 | -C 'I@cinder:controller' state.sls cinder -b 1 |
| 130 | node_name: {{ HOSTNAME_CFG01 }} |
| 131 | retry: {count: 1, delay: 5} |
| 132 | skip_fail: false |
| 133 | |
| 134 | - description: Check cinder list |
| 135 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 136 | -C 'I@keystone:server' cmd.run '. /root/keystonerc; cinder list' |
| 137 | node_name: {{ HOSTNAME_CFG01 }} |
| 138 | retry: {count: 1, delay: 5} |
| 139 | skip_fail: false |
| 140 | |
| 141 | |
| 142 | - description: Install neutron service |
| 143 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 144 | -C 'I@neutron:server' state.sls neutron -b 1 |
| 145 | node_name: {{ HOSTNAME_CFG01 }} |
| 146 | retry: {count: 1, delay: 5} |
| 147 | skip_fail: false |
| 148 | |
| 149 | - description: Install neutron on gtw node |
| 150 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 151 | -C 'I@neutron:gateway' state.sls neutron |
| 152 | node_name: {{ HOSTNAME_CFG01 }} |
| 153 | retry: {count: 1, delay: 5} |
| 154 | skip_fail: false |
| 155 | |
| 156 | # isntall designate |
| 157 | - description: Install powerdns |
| 158 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 159 | -C 'I@powerdns:server' state.sls powerdns.server |
| 160 | node_name: {{ HOSTNAME_CFG01 }} |
| 161 | retry: {count: 1, delay: 5} |
| 162 | skip_fail: false |
| 163 | |
| 164 | - description: Install designate |
| 165 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 166 | -C 'I@designate:server' state.sls designate -b 1 |
| 167 | node_name: {{ HOSTNAME_CFG01 }} |
| 168 | retry: {count: 5, delay: 10} |
| 169 | skip_fail: false |
| 170 | |
| 171 | - description: Check neutron agent-list |
| 172 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 173 | -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list' |
| 174 | node_name: {{ HOSTNAME_CFG01 }} |
| 175 | retry: {count: 1, delay: 5} |
| 176 | skip_fail: false |
| 177 | |
| 178 | - description: Install heat service |
| 179 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 180 | -C 'I@heat:server' state.sls heat -b 1 |
| 181 | node_name: {{ HOSTNAME_CFG01 }} |
| 182 | retry: {count: 1, delay: 5} |
| 183 | skip_fail: false |
| 184 | |
| 185 | - description: Check heat service |
| 186 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 187 | -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list' |
| 188 | node_name: {{ HOSTNAME_CFG01 }} |
| 189 | retry: {count: 5, delay: 10} |
| 190 | skip_fail: false |
| 191 | |
| 192 | |
| 193 | - description: Deploy horizon dashboard |
| 194 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 195 | -C 'I@horizon:server' state.sls horizon |
| 196 | node_name: {{ HOSTNAME_CFG01 }} |
| 197 | retry: {count: 1, delay: 5} |
| 198 | skip_fail: true |
| 199 | |
| 200 | # Install compute node |
| 201 | |
| 202 | - description: Apply formulas for compute node |
| 203 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 204 | node_name: {{ HOSTNAME_CFG01 }} |
| 205 | retry: {count: 1, delay: 5} |
| 206 | skip_fail: true |
| 207 | |
| 208 | - description: Re-apply(as in doc) formulas for compute node |
| 209 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 210 | node_name: {{ HOSTNAME_CFG01 }} |
| 211 | retry: {count: 1, delay: 5} |
| 212 | skip_fail: false |
| 213 | |
| 214 | - description: Check IP on computes |
| 215 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run |
| 216 | 'ip a' |
| 217 | node_name: {{ HOSTNAME_CFG01 }} |
| 218 | retry: {count: 10, delay: 30} |
| 219 | skip_fail: false |
| 220 | |
Tatyana Leontovich | c447b12 | 2018-02-22 12:30:42 +0200 | [diff] [blame] | 221 | - description: Create net04_external |
| 222 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 223 | '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat' |
| 224 | node_name: {{ HOSTNAME_CFG01 }} |
| 225 | retry: {count: 1, delay: 30} |
| 226 | skip_fail: false |
| 227 | |
| 228 | - description: Create subnet_external |
| 229 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 230 | '. /root/keystonercv3; neutron subnet-create net04_ext {{ IPV4_NET_EXTERNAL_PREFIX }}.0/24 --name net04_ext__subnet --disable-dhcp --allocation-pool start={{ IPV4_NET_EXTERNAL_PREFIX }}.150,end={{ IPV4_NET_EXTERNAL_PREFIX }}.180 --gateway {{ IPV4_NET_EXTERNAL_PREFIX }}.1' |
| 231 | node_name: {{ HOSTNAME_CFG01 }} |
| 232 | retry: {count: 1, delay: 30} |
| 233 | skip_fail: false |
| 234 | |
| 235 | - description: Create net04 |
| 236 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 237 | '. /root/keystonercv3; neutron net-create net04' |
| 238 | node_name: {{ HOSTNAME_CFG01 }} |
| 239 | retry: {count: 1, delay: 30} |
| 240 | skip_fail: false |
| 241 | |
| 242 | - description: Create subnet_net04 |
| 243 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 244 | '. /root/keystonercv3; neutron subnet-create net04 {{ IPV4_NET_TENANT_PREFIX }}.0/24 --name net04__subnet --allocation-pool start={{ IPV4_NET_TENANT_PREFIX }}.120,end={{ IPV4_NET_TENANT_PREFIX }}.240' |
| 245 | node_name: {{ HOSTNAME_CFG01 }} |
| 246 | retry: {count: 1, delay: 30} |
| 247 | skip_fail: false |
| 248 | |
| 249 | - description: Create router |
| 250 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 251 | '. /root/keystonercv3; neutron router-create net04_router01' |
| 252 | node_name: {{ HOSTNAME_CFG01 }} |
| 253 | retry: {count: 1, delay: 30} |
| 254 | skip_fail: false |
| 255 | |
| 256 | - description: Set geteway |
| 257 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 258 | '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext' |
| 259 | node_name: {{ HOSTNAME_CFG01 }} |
| 260 | retry: {count: 1, delay: 30} |
| 261 | skip_fail: false |
| 262 | |
| 263 | - description: Add interface |
| 264 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 265 | '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet' |
| 266 | node_name: {{ HOSTNAME_CFG01 }} |
| 267 | retry: {count: 1, delay: 30} |
| 268 | skip_fail: false |
| 269 | |
Tatyana Leontovich | c447b12 | 2018-02-22 12:30:42 +0200 | [diff] [blame] | 270 | - description: sync time |
| 271 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run |
| 272 | 'service ntp stop; ntpd -gq; service ntp start' |
| 273 | node_name: {{ HOSTNAME_CFG01 }} |
| 274 | retry: {count: 1, delay: 30} |
| 275 | skip_fail: false |
| 276 | |
Tatyana Leontovich | c447b12 | 2018-02-22 12:30:42 +0200 | [diff] [blame] | 277 | - description: Install docker.io on gtw |
| 278 | cmd: salt-call cmd.run 'apt-get install docker.io -y' |
| 279 | node_name: {{ HOSTNAME_GTW01 }} |
| 280 | retry: {count: 1, delay: 30} |
| 281 | skip_fail: false |
| 282 | |
Tatyana Leontovich | d6bcbc9 | 2018-03-23 15:02:28 +0200 | [diff] [blame] | 283 | - description: Enable forward policy |
| 284 | cmd: iptables --policy FORWARD ACCEPT |
| 285 | node_name: {{ HOSTNAME_GTW01 }} |
| 286 | retry: {count: 1, delay: 30} |
| 287 | skip_fail: false |
| 288 | |
sgudz | 3fd4454 | 2018-04-02 11:45:49 +0300 | [diff] [blame] | 289 | - description: Install manila-api on first node |
| 290 | cmd: | |
| 291 | salt -C 'I@manila:api and *01*' state.sls manila.api; |
| 292 | node_name: {{ HOSTNAME_CFG01 }} |
| 293 | retry: {count: 1, delay: 5} |
| 294 | skip_fail: false |
| 295 | |
| 296 | - description: Install manila-api on other nodes |
| 297 | cmd: | |
| 298 | salt -C 'I@manila:api and not *01*' state.sls manila.api; |
| 299 | node_name: {{ HOSTNAME_CFG01 }} |
| 300 | retry: {count: 1, delay: 5} |
| 301 | skip_fail: false |
| 302 | |
| 303 | - description: Install manila-scheduler |
| 304 | cmd: | |
| 305 | salt -C 'I@manila:scheduler' state.sls manila.scheduler; |
| 306 | node_name: {{ HOSTNAME_CFG01 }} |
| 307 | retry: {count: 1, delay: 5} |
| 308 | skip_fail: false |
| 309 | |
| 310 | - description: Install manila-share |
| 311 | cmd: | |
| 312 | salt -C 'I@manila:share' state.sls manila.share; |
| 313 | node_name: {{ HOSTNAME_CFG01 }} |
| 314 | retry: {count: 1, delay: 5} |
| 315 | skip_fail: false |
| 316 | |
Tatyana Leontovich | 3cc1c13 | 2018-04-03 00:41:17 +0300 | [diff] [blame] | 317 | - description: WR https://mirantis.jira.com/browse/PROD-19012 |
| 318 | cmd: | |
Tatyana Leontovich | 1618a2a | 2018-04-03 10:19:25 +0300 | [diff] [blame] | 319 | salt 'ctl*' cmd.run 'systemctl restart apache2' |
Tatyana Leontovich | 3cc1c13 | 2018-04-03 00:41:17 +0300 | [diff] [blame] | 320 | node_name: {{ HOSTNAME_CFG01 }} |
| 321 | retry: {count: 1, delay: 5} |
| 322 | skip_fail: false |
| 323 | |
sgudz | 3fd4454 | 2018-04-02 11:45:49 +0300 | [diff] [blame] | 324 | - description: Check manila-services |
| 325 | cmd: | |
| 326 | salt 'ctl01*' cmd.run '. /root/keystonercv3; manila service-list' |
| 327 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | 1618a2a | 2018-04-03 10:19:25 +0300 | [diff] [blame] | 328 | retry: {count: 3, delay: 15} |
sgudz | 3fd4454 | 2018-04-02 11:45:49 +0300 | [diff] [blame] | 329 | skip_fail: false |
| 330 | |
| 331 | - description: Create manila type |
| 332 | cmd: | |
sgudz | 1d65840 | 2018-04-06 11:59:48 +0300 | [diff] [blame] | 333 | salt 'ctl01*' cmd.run '. /root/keystonercv3; manila type-create default false --create_share_from_snapshot_support true --revert_to_snapshot_support true --mount_snapshot_support true --snapshot_support true --is_public true' |
sgudz | 3fd4454 | 2018-04-02 11:45:49 +0300 | [diff] [blame] | 334 | node_name: {{ HOSTNAME_CFG01 }} |
Oleksii Butenko | a947bc0 | 2018-05-22 11:40:48 +0300 | [diff] [blame] | 335 | retry: {count: 1, delay: 5} |
sgudz | 3fd4454 | 2018-04-02 11:45:49 +0300 | [diff] [blame] | 336 | skip_fail: false |
| 337 | |
| 338 | - description: Create CIFS and NFS share and check it status |
| 339 | cmd: | |
| 340 | salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create CIFS 1 --share-type=default'; |
| 341 | salt 'ctl01*' cmd.run '. /root/keystonercv3; manila create NFS 1 --share-type=default'; |
| 342 | sleep 5; |
| 343 | salt 'ctl01*' cmd.run '. /root/keystonercv3; manila list'; |
| 344 | node_name: {{ HOSTNAME_CFG01 }} |
Oleksii Butenko | a561a8a | 2018-05-08 15:12:26 +0300 | [diff] [blame] | 345 | retry: {count: 3, delay: 5} |
sgudz | 3fd4454 | 2018-04-02 11:45:49 +0300 | [diff] [blame] | 346 | skip_fail: false |