Tatyana Leontovich | d34f410 | 2018-04-03 17:49:24 +0300 | [diff] [blame] | 1 | {% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | {% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL01 with context %} |
| 3 | {% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL02 with context %} |
| 4 | {% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_CTL03 with context %} |
| 5 | {% from 'virtual-offline-pike-ovs-dpdk/underlay.yaml' import HOSTNAME_GTW01 with context %} |
| 6 | {% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %} |
| 7 | {% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %} |
| 8 | {% set REPOSITORY_SUITE = os_env('REPOSITORY_SUITE', 'testing') %} |
| 9 | {% set DOCKER_LOCAL_REPO = os_env('DOCKER_LOCAL_REPO', 'deb [arch=amd64] http://mirror.mcp.mirantis.local.test/ubuntu-xenial/docker/ ' + REPOSITORY_SUITE + ' stable') %} |
| 10 | # Install OpenStack control services |
| 11 | |
| 12 | - description: Install glance on all controllers |
| 13 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 14 | -C 'I@glance:server' state.sls glance -b 1 |
| 15 | node_name: {{ HOSTNAME_CFG01 }} |
| 16 | retry: {count: 1, delay: 5} |
| 17 | skip_fail: false |
| 18 | |
| 19 | - description: Install keystone service (note that different fernet keys are created on different nodes) |
| 20 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 21 | -C 'I@keystone:server' state.sls keystone.server -b 1 |
| 22 | node_name: {{ HOSTNAME_CFG01 }} |
| 23 | retry: {count: 2, delay: 15} |
| 24 | skip_fail: false |
| 25 | |
| 26 | - description: Restart apache due to PROD-10477 |
| 27 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl restart apache2" |
| 28 | node_name: {{ HOSTNAME_CFG01 }} |
| 29 | retry: {count: 1, delay: 15} |
| 30 | skip_fail: false |
| 31 | |
| 32 | - description: Check apache status to PROD-10477 |
| 33 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl status apache2" |
| 34 | node_name: {{ HOSTNAME_CFG01 }} |
| 35 | retry: {count: 1, delay: 15} |
| 36 | skip_fail: false |
| 37 | |
| 38 | - description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users) |
| 39 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 40 | -C 'I@glance:server' state.sls glusterfs.client |
| 41 | node_name: {{ HOSTNAME_CFG01 }} |
| 42 | retry: {count: 1, delay: 5} |
| 43 | skip_fail: false |
| 44 | |
| 45 | - description: Update fernet keys for keystone server on the mounted glusterfs volume |
| 46 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 47 | -C 'I@keystone:server' state.sls keystone.server -b 1 |
| 48 | node_name: {{ HOSTNAME_CFG01 }} |
| 49 | retry: {count: 1, delay: 5} |
| 50 | skip_fail: false |
| 51 | |
| 52 | - description: Populate keystone services/tenants/admins |
| 53 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 54 | -C 'I@keystone:client' state.sls keystone.client |
| 55 | node_name: {{ HOSTNAME_CFG01 }} |
| 56 | retry: {count: 2, delay: 5} |
| 57 | skip_fail: false |
| 58 | |
| 59 | - description: Check keystone service-list |
| 60 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 61 | -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack service list' |
| 62 | node_name: {{ HOSTNAME_CFG01 }} |
| 63 | retry: {count: 1, delay: 5} |
| 64 | skip_fail: false |
| 65 | |
| 66 | - description: Check glance image-list |
| 67 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 68 | -C 'I@keystone:server' cmd.run '. /root/keystonercv3; glance image-list' |
| 69 | node_name: {{ HOSTNAME_CFG01 }} |
| 70 | retry: {count: 1, delay: 5} |
| 71 | skip_fail: false |
| 72 | |
| 73 | |
| 74 | - description: Install nova on all controllers |
| 75 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 76 | -C 'I@nova:controller' state.sls nova -b 1 |
| 77 | node_name: {{ HOSTNAME_CFG01 }} |
| 78 | retry: {count: 2, delay: 5} |
| 79 | skip_fail: false |
| 80 | |
| 81 | - description: Check nova service-list |
| 82 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 83 | -C 'I@keystone:server' cmd.run '. /root/keystonercv3; nova --debug service-list' |
| 84 | node_name: {{ HOSTNAME_CFG01 }} |
| 85 | retry: {count: 3, delay: 5} |
| 86 | skip_fail: false |
| 87 | |
| 88 | |
| 89 | - description: Install cinder |
| 90 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 91 | -C 'I@cinder:controller' state.sls cinder -b 1 |
| 92 | node_name: {{ HOSTNAME_CFG01 }} |
| 93 | retry: {count: 2, delay: 5} |
| 94 | skip_fail: false |
| 95 | |
| 96 | - description: Check cinder list |
| 97 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 98 | -C 'I@keystone:server' cmd.run '. /root/keystonercv3; cinder list' |
| 99 | node_name: {{ HOSTNAME_CFG01 }} |
| 100 | retry: {count: 1, delay: 5} |
| 101 | skip_fail: false |
| 102 | |
| 103 | |
| 104 | - description: Install neutron service |
| 105 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 106 | -C 'I@neutron:server' state.sls neutron -b 1 |
| 107 | node_name: {{ HOSTNAME_CFG01 }} |
| 108 | retry: {count: 1, delay: 5} |
| 109 | skip_fail: false |
| 110 | |
| 111 | - description: Install neutron on gtw node |
| 112 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 113 | -C 'I@neutron:gateway' state.sls neutron |
| 114 | node_name: {{ HOSTNAME_CFG01 }} |
| 115 | retry: {count: 1, delay: 5} |
| 116 | skip_fail: false |
| 117 | |
| 118 | - description: Install bind if pillars 'bind:server' exists on any server |
| 119 | cmd: | |
| 120 | if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@bind:server' match.pillar 'bind:server' ; then |
| 121 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@bind:server' state.sls bind; |
| 122 | salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@designate:server' state.sls designate -b 1 |
| 123 | fi |
| 124 | node_name: {{ HOSTNAME_CFG01 }} |
| 125 | retry: {count: 1, delay: 10} |
| 126 | skip_fail: false |
| 127 | |
| 128 | - description: Check neutron agent-list |
| 129 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 130 | -C 'I@keystone:server' cmd.run '. /root/keystonercv3; neutron agent-list' |
| 131 | node_name: {{ HOSTNAME_CFG01 }} |
| 132 | retry: {count: 1, delay: 5} |
| 133 | skip_fail: false |
| 134 | |
| 135 | |
| 136 | - description: Install heat service |
| 137 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 138 | -C 'I@heat:server' state.sls heat -b 1 |
| 139 | node_name: {{ HOSTNAME_CFG01 }} |
| 140 | retry: {count: 1, delay: 5} |
| 141 | skip_fail: false |
| 142 | |
| 143 | - description: Check heat service |
| 144 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 145 | -C 'I@keystone:server' cmd.run '. /root/keystonercv3; openstack orchestration resource type list' |
| 146 | node_name: {{ HOSTNAME_CFG01 }} |
| 147 | retry: {count: 5, delay: 10} |
| 148 | skip_fail: false |
| 149 | |
| 150 | |
| 151 | - description: Deploy horizon dashboard |
| 152 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 153 | -C 'I@horizon:server' state.sls horizon |
| 154 | node_name: {{ HOSTNAME_CFG01 }} |
| 155 | retry: {count: 1, delay: 5} |
| 156 | skip_fail: true |
| 157 | |
| 158 | - description: Deploy nginx proxy |
| 159 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 160 | -C 'I@nginx:server' state.sls nginx |
| 161 | node_name: {{ HOSTNAME_CFG01 }} |
| 162 | retry: {count: 1, delay: 5} |
| 163 | skip_fail: true |
| 164 | |
| 165 | |
| 166 | # Install compute node |
| 167 | |
| 168 | - description: Apply formulas for compute node |
| 169 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 170 | node_name: {{ HOSTNAME_CFG01 }} |
| 171 | retry: {count: 1, delay: 5} |
| 172 | skip_fail: true |
| 173 | |
| 174 | - description: Re-apply(as in doc) formulas for compute node |
| 175 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 176 | node_name: {{ HOSTNAME_CFG01 }} |
| 177 | retry: {count: 1, delay: 5} |
| 178 | skip_fail: false |
| 179 | |
| 180 | - description: Check IP on computes |
| 181 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run |
| 182 | 'ip a' |
| 183 | node_name: {{ HOSTNAME_CFG01 }} |
| 184 | retry: {count: 10, delay: 30} |
| 185 | skip_fail: false |
| 186 | |
| 187 | |
| 188 | # Upload cirros image |
| 189 | # Configure cinder-volume salt-call |
| 190 | - description: Set disks 01 |
| 191 | cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb' |
| 192 | node_name: {{ HOSTNAME_CTL01 }} |
| 193 | retry: {count: 1, delay: 30} |
| 194 | skip_fail: false |
| 195 | |
| 196 | - description: Set disks 02 |
| 197 | cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb' |
| 198 | node_name: {{ HOSTNAME_CTL02 }} |
| 199 | retry: {count: 1, delay: 30} |
| 200 | skip_fail: false |
| 201 | |
| 202 | - description: Set disks 03 |
| 203 | cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb' |
| 204 | node_name: {{ HOSTNAME_CTL03 }} |
| 205 | retry: {count: 1, delay: 30} |
| 206 | skip_fail: false |
| 207 | |
| 208 | - description: Create partitions 01 |
| 209 | cmd: salt-call cmd.run 'pvcreate /dev/vdb1' |
| 210 | node_name: {{ HOSTNAME_CTL01 }} |
| 211 | retry: {count: 1, delay: 30} |
| 212 | skip_fail: false |
| 213 | |
| 214 | - description: Create partitions 02 |
| 215 | cmd: salt-call cmd.run 'pvcreate /dev/vdb1' |
| 216 | node_name: {{ HOSTNAME_CTL02 }} |
| 217 | retry: {count: 1, delay: 30} |
| 218 | skip_fail: false |
| 219 | |
| 220 | - description: Create partitions 03 |
| 221 | cmd: salt-call cmd.run 'pvcreate /dev/vdb1' |
| 222 | node_name: {{ HOSTNAME_CTL03 }} |
| 223 | retry: {count: 1, delay: 30} |
| 224 | skip_fail: false |
| 225 | |
| 226 | - description: create volume_group |
| 227 | cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1' |
| 228 | node_name: {{ HOSTNAME_CFG01 }} |
| 229 | retry: {count: 1, delay: 30} |
| 230 | skip_fail: false |
| 231 | |
| 232 | - description: Install cinder-volume |
| 233 | cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y' |
| 234 | node_name: {{ HOSTNAME_CFG01 }} |
| 235 | retry: {count: 1, delay: 30} |
| 236 | skip_fail: false |
| 237 | |
| 238 | - description: Install crudini |
| 239 | cmd: salt "ctl*" cmd.run 'apt-get install crudini -y' |
| 240 | node_name: {{ HOSTNAME_CFG01 }} |
| 241 | retry: {count: 1, delay: 30} |
| 242 | skip_fail: false |
| 243 | |
| 244 | - description: Temporary WR set enabled backends value 01 |
| 245 | cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm' |
| 246 | node_name: {{ HOSTNAME_CTL01 }} |
| 247 | retry: {count: 1, delay: 30} |
| 248 | skip_fail: false |
| 249 | |
| 250 | - description: Temporary WR set enabled backends value 02 |
| 251 | cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm' |
| 252 | node_name: {{ HOSTNAME_CTL02 }} |
| 253 | retry: {count: 1, delay: 30} |
| 254 | skip_fail: false |
| 255 | |
| 256 | - description: Temporary WR set enabled backends value 03 |
| 257 | cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm' |
| 258 | node_name: {{ HOSTNAME_CTL03 }} |
| 259 | retry: {count: 1, delay: 30} |
| 260 | skip_fail: false |
| 261 | |
| 262 | - description: Restart cinder volume |
| 263 | cmd: | |
| 264 | salt -C 'I@cinder:controller' service.restart cinder-volume; |
| 265 | node_name: {{ HOSTNAME_CFG01 }} |
| 266 | retry: {count: 2, delay: 5} |
| 267 | skip_fail: false |
| 268 | |
| 269 | - description: Upload cirros image on ctl01 |
| 270 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 271 | 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img' |
| 272 | node_name: {{ HOSTNAME_CFG01 }} |
| 273 | retry: {count: 2, delay: 30} |
| 274 | skip_fail: false |
| 275 | |
| 276 | - description: Create net04_external |
| 277 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 278 | '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat' |
| 279 | node_name: {{ HOSTNAME_CFG01 }} |
| 280 | retry: {count: 1, delay: 30} |
| 281 | skip_fail: false |
| 282 | |
| 283 | - description: Create subnet_external |
| 284 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 285 | '. /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' |
| 286 | node_name: {{ HOSTNAME_CFG01 }} |
| 287 | retry: {count: 1, delay: 30} |
| 288 | skip_fail: false |
| 289 | |
| 290 | - description: Create net04 |
| 291 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 292 | '. /root/keystonercv3; neutron net-create net04' |
| 293 | node_name: {{ HOSTNAME_CFG01 }} |
| 294 | retry: {count: 1, delay: 30} |
| 295 | skip_fail: false |
| 296 | |
| 297 | - description: Create subnet_net04 |
| 298 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 299 | '. /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' |
| 300 | node_name: {{ HOSTNAME_CFG01 }} |
| 301 | retry: {count: 1, delay: 30} |
| 302 | skip_fail: false |
| 303 | |
| 304 | - description: Create router |
| 305 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 306 | '. /root/keystonercv3; neutron router-create net04_router01' |
| 307 | node_name: {{ HOSTNAME_CFG01 }} |
| 308 | retry: {count: 1, delay: 30} |
| 309 | skip_fail: false |
| 310 | |
| 311 | - description: Set geteway |
| 312 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 313 | '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext' |
| 314 | node_name: {{ HOSTNAME_CFG01 }} |
| 315 | retry: {count: 1, delay: 30} |
| 316 | skip_fail: false |
| 317 | |
| 318 | - description: Add interface |
| 319 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 320 | '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet' |
| 321 | node_name: {{ HOSTNAME_CFG01 }} |
| 322 | retry: {count: 1, delay: 30} |
| 323 | skip_fail: false |
| 324 | |
| 325 | - description: sync time |
| 326 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run |
| 327 | 'service ntp stop; ntpd -gq; service ntp start' |
| 328 | node_name: {{ HOSTNAME_CFG01 }} |
| 329 | retry: {count: 1, delay: 30} |
| 330 | skip_fail: false |
| 331 | |
| 332 | - description: Enable local docker repo |
| 333 | cmd: | |
| 334 | set -e; |
| 335 | echo "{{ DOCKER_LOCAL_REPO }}" > /etc/apt/sources.list.d/mcp_docker.list; |
| 336 | apt-get clean; apt-get update; |
| 337 | node_name: {{ HOSTNAME_GTW01 }} |
| 338 | retry: {count: 1, delay: 30} |
| 339 | skip_fail: false |
| 340 | |
| 341 | - description: Install docker-ce on gtw |
| 342 | cmd: salt-call cmd.run 'apt-get install docker-ce -y' |
| 343 | node_name: {{ HOSTNAME_GTW01 }} |
| 344 | retry: {count: 1, delay: 30} |
| 345 | skip_fail: false |
| 346 | |
| 347 | - description: Enable forward policy on gtw |
| 348 | cmd: | |
| 349 | set -e; |
| 350 | iptables --policy FORWARD ACCEPT; |
| 351 | node_name: {{ HOSTNAME_GTW01 }} |
| 352 | retry: {count: 1, delay: 30} |
| 353 | skip_fail: false |
| 354 | |
| 355 | - description: create rc file on cfg |
| 356 | cmd: scp ctl01:/root/keystonercv3 /root |
| 357 | node_name: {{ HOSTNAME_CFG01 }} |
| 358 | retry: {count: 1, delay: 30} |
| 359 | skip_fail: false |
| 360 | |
| 361 | - description: Copy rc file |
| 362 | cmd: scp /root/keystonercv3 gtw01:/root |
| 363 | node_name: {{ HOSTNAME_CFG01 }} |
| 364 | retry: {count: 1, delay: 30} |
| 365 | skip_fail: false |