Dennis Dmitriev | ab83ea4 | 2017-05-12 16:52:45 +0300 | [diff] [blame] | 1 | {% from 'virtual-mcp-ocata-dvr/underlay.yaml' import HOSTNAME_CFG01 with context %} |
Oleksandr Ivashchenko | a95a72b | 2017-06-06 15:55:59 +0300 | [diff] [blame^] | 2 | {% from 'virtual-mcp-ocata-dvr/salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %} |
| 3 | {% from 'virtual-mcp-ocata-dvr/salt.yaml' import IPV4_NET_TENANT_PREFIX with context %} |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 4 | |
| 5 | # Install OpenStack control services |
| 6 | |
Dennis Dmitriev | 4ab889c | 2017-04-27 14:11:04 +0300 | [diff] [blame] | 7 | - description: Install glance on all controllers |
| 8 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 9 | -C 'I@glance:server' state.sls glance -b 1 |
| 10 | node_name: {{ HOSTNAME_CFG01 }} |
| 11 | retry: {count: 1, delay: 5} |
| 12 | skip_fail: false |
| 13 | |
| 14 | - description: Install keystone service (note that different fernet keys are created on different nodes) |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 15 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 16 | -C 'I@keystone:server' state.sls keystone.server -b 1 |
| 17 | node_name: {{ HOSTNAME_CFG01 }} |
Tatyana Leontovich | d4f1fd3 | 2017-04-21 13:31:44 +0300 | [diff] [blame] | 18 | retry: {count: 2, delay: 15} |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 19 | skip_fail: false |
| 20 | |
Tatyana Leontovich | fa7ae4d | 2017-04-25 13:46:14 +0300 | [diff] [blame] | 21 | - description: Restart apache due to PROD-10477 |
| 22 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl restart apache2" |
| 23 | node_name: {{ HOSTNAME_CFG01 }} |
| 24 | retry: {count: 1, delay: 15} |
| 25 | skip_fail: false |
| 26 | |
| 27 | - description: Check apache status to PROD-10477 |
| 28 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run "systemctl status apache2" |
| 29 | node_name: {{ HOSTNAME_CFG01 }} |
| 30 | retry: {count: 1, delay: 15} |
| 31 | skip_fail: false |
| 32 | |
Dennis Dmitriev | 4ab889c | 2017-04-27 14:11:04 +0300 | [diff] [blame] | 33 | - description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users) |
| 34 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 35 | -C 'I@glance:server' state.sls glusterfs.client |
| 36 | node_name: {{ HOSTNAME_CFG01 }} |
| 37 | retry: {count: 1, delay: 5} |
| 38 | skip_fail: false |
| 39 | |
| 40 | - description: Update fernet keys for keystone server on the mounted glusterfs volume |
| 41 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 42 | -C 'I@keystone:server' state.sls keystone.server -b 1 |
| 43 | node_name: {{ HOSTNAME_CFG01 }} |
| 44 | retry: {count: 1, delay: 5} |
| 45 | skip_fail: false |
| 46 | |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 47 | - description: Populate keystone services/tenants/admins |
| 48 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 49 | -C 'I@keystone:client' state.sls keystone.client |
| 50 | node_name: {{ HOSTNAME_CFG01 }} |
| 51 | retry: {count: 1, delay: 5} |
| 52 | skip_fail: false |
| 53 | |
| 54 | - description: Check keystone service-list |
| 55 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Tatyana Leontovich | b8b02d8 | 2017-04-21 14:07:33 +0300 | [diff] [blame] | 56 | -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack service list' |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 57 | node_name: {{ HOSTNAME_CFG01 }} |
| 58 | retry: {count: 1, delay: 5} |
| 59 | skip_fail: false |
| 60 | |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 61 | - description: Check glance image-list |
| 62 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 63 | -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list' |
| 64 | node_name: {{ HOSTNAME_CFG01 }} |
| 65 | retry: {count: 1, delay: 5} |
| 66 | skip_fail: false |
| 67 | |
| 68 | |
| 69 | - description: Install nova on all controllers |
| 70 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 71 | -C 'I@nova:controller' state.sls nova -b 1 |
| 72 | node_name: {{ HOSTNAME_CFG01 }} |
Dennis Dmitriev | 4ab889c | 2017-04-27 14:11:04 +0300 | [diff] [blame] | 73 | retry: {count: 2, delay: 5} |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 74 | skip_fail: false |
| 75 | |
| 76 | - description: Check nova service-list |
| 77 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 78 | -C 'I@keystone:server' cmd.run '. /root/keystonerc; nova service-list' |
| 79 | node_name: {{ HOSTNAME_CFG01 }} |
| 80 | retry: {count: 1, delay: 5} |
| 81 | skip_fail: false |
| 82 | |
| 83 | |
| 84 | - description: Install cinder |
| 85 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 86 | -C 'I@cinder:controller' state.sls cinder -b 1 |
| 87 | node_name: {{ HOSTNAME_CFG01 }} |
| 88 | retry: {count: 1, delay: 5} |
| 89 | skip_fail: false |
| 90 | |
| 91 | - description: Check cinder list |
| 92 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 93 | -C 'I@keystone:server' cmd.run '. /root/keystonerc; cinder list' |
| 94 | node_name: {{ HOSTNAME_CFG01 }} |
| 95 | retry: {count: 1, delay: 5} |
| 96 | skip_fail: false |
| 97 | |
| 98 | |
| 99 | - description: Install neutron service |
| 100 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 101 | -C 'I@neutron:server' state.sls neutron -b 1 |
| 102 | node_name: {{ HOSTNAME_CFG01 }} |
| 103 | retry: {count: 1, delay: 5} |
| 104 | skip_fail: false |
| 105 | |
| 106 | - description: Install neutron on gtw node |
| 107 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 108 | -C 'I@neutron:gateway' state.sls neutron |
| 109 | node_name: {{ HOSTNAME_CFG01 }} |
| 110 | retry: {count: 1, delay: 5} |
| 111 | skip_fail: false |
| 112 | |
| 113 | |
| 114 | - description: Check neutron agent-list |
| 115 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 116 | -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list' |
| 117 | node_name: {{ HOSTNAME_CFG01 }} |
| 118 | retry: {count: 1, delay: 5} |
| 119 | skip_fail: false |
| 120 | |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 121 | - description: Install heat service |
| 122 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 123 | -C 'I@heat:server' state.sls heat -b 1 |
| 124 | node_name: {{ HOSTNAME_CFG01 }} |
| 125 | retry: {count: 1, delay: 5} |
| 126 | skip_fail: false |
| 127 | |
| 128 | - description: Check heat service |
| 129 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
Igor Yozhikov | 8ec6d2f | 2017-05-23 16:17:29 +0300 | [diff] [blame] | 130 | -C 'I@keystone:server' cmd.run '. /root/keystonerc; openstack orchestration resource type list' |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 131 | node_name: {{ HOSTNAME_CFG01 }} |
Igor Yozhikov | 8ec6d2f | 2017-05-23 16:17:29 +0300 | [diff] [blame] | 132 | retry: {count: 5, delay: 10} |
Tatyana Leontovich | 38be41b | 2017-04-12 14:45:23 +0300 | [diff] [blame] | 133 | skip_fail: false |
| 134 | |
| 135 | |
| 136 | - description: Deploy horizon dashboard |
| 137 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 138 | -C 'I@horizon:server' state.sls horizon |
| 139 | node_name: {{ HOSTNAME_CFG01 }} |
| 140 | retry: {count: 1, delay: 5} |
| 141 | skip_fail: true |
| 142 | |
| 143 | - description: Deploy nginx proxy |
| 144 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 145 | -C 'I@nginx:server' state.sls nginx |
| 146 | node_name: {{ HOSTNAME_CFG01 }} |
| 147 | retry: {count: 1, delay: 5} |
| 148 | skip_fail: true |
| 149 | |
| 150 | |
| 151 | # Install compute node |
| 152 | |
| 153 | - description: Apply formulas for compute node |
| 154 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 155 | node_name: {{ HOSTNAME_CFG01 }} |
| 156 | retry: {count: 1, delay: 5} |
| 157 | skip_fail: true |
| 158 | |
| 159 | - description: Re-apply(as in doc) formulas for compute node |
| 160 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 161 | node_name: {{ HOSTNAME_CFG01 }} |
| 162 | retry: {count: 1, delay: 5} |
| 163 | skip_fail: true |
| 164 | |
| 165 | - description: Check IP on computes |
| 166 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run |
| 167 | 'ip a' |
| 168 | node_name: {{ HOSTNAME_CFG01 }} |
| 169 | retry: {count: 10, delay: 30} |
| 170 | skip_fail: false |
Oleksandr Ivashchenko | a95a72b | 2017-06-06 15:55:59 +0300 | [diff] [blame^] | 171 | |
| 172 | |
| 173 | # Upload cirros image |
| 174 | |
| 175 | - description: Upload cirros image on ctl01 |
| 176 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 177 | 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img' |
| 178 | node_name: {{ HOSTNAME_CFG01 }} |
| 179 | retry: {count: 2, delay: 30} |
| 180 | skip_fail: false |
| 181 | |
| 182 | - description: Register image in glance |
| 183 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 184 | '. /root/keystonercv3; glance image-create --name cirros --visibility public --disk-format qcow2 --container-format bare --progress < /root/cirros-0.3.4-i386-disk.img' |
| 185 | node_name: {{ HOSTNAME_CFG01 }} |
| 186 | retry: {count: 1, delay: 30} |
| 187 | skip_fail: false |
| 188 | |
| 189 | - description: Create net04_external |
| 190 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 191 | '. /root/keystonercv3; neutron net-create net04_ext --shared --router:external True --provider:physical_network physnet1 --provider:network_type flat' |
| 192 | node_name: {{ HOSTNAME_CFG01 }} |
| 193 | retry: {count: 1, delay: 30} |
| 194 | skip_fail: false |
| 195 | |
| 196 | - description: Create subnet_external |
| 197 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 198 | '. /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' |
| 199 | node_name: {{ HOSTNAME_CFG01 }} |
| 200 | retry: {count: 1, delay: 30} |
| 201 | skip_fail: false |
| 202 | |
| 203 | - description: Create net04 |
| 204 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 205 | '. /root/keystonercv3; neutron net-create net04' |
| 206 | node_name: {{ HOSTNAME_CFG01 }} |
| 207 | retry: {count: 1, delay: 30} |
| 208 | skip_fail: false |
| 209 | |
| 210 | - description: Create subnet_net04 |
| 211 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 212 | '. /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' |
| 213 | node_name: {{ HOSTNAME_CFG01 }} |
| 214 | retry: {count: 1, delay: 30} |
| 215 | skip_fail: false |
| 216 | |
| 217 | - description: Create router |
| 218 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 219 | '. /root/keystonercv3; neutron router-create net04_router01' |
| 220 | node_name: {{ HOSTNAME_CFG01 }} |
| 221 | retry: {count: 1, delay: 30} |
| 222 | skip_fail: false |
| 223 | |
| 224 | - description: Set geteway |
| 225 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 226 | '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext' |
| 227 | node_name: {{ HOSTNAME_CFG01 }} |
| 228 | retry: {count: 1, delay: 30} |
| 229 | skip_fail: false |
| 230 | |
| 231 | - description: Add interface |
| 232 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 233 | '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet' |
| 234 | node_name: {{ HOSTNAME_CFG01 }} |
| 235 | retry: {count: 1, delay: 30} |
| 236 | skip_fail: false |
| 237 | |
| 238 | - description: Allow all tcp |
| 239 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 240 | '. /root/keystonercv3; nova secgroup-add-rule default tcp 1 65535 0.0.0.0/0' |
| 241 | node_name: {{ HOSTNAME_CFG01 }} |
| 242 | retry: {count: 1, delay: 30} |
| 243 | skip_fail: false |
| 244 | |
| 245 | - description: Allow all icmp |
| 246 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 247 | '. /root/keystonercv3; nova secgroup-add-rule default icmp -1 -1 0.0.0.0/0' |
| 248 | node_name: {{ HOSTNAME_CFG01 }} |
| 249 | retry: {count: 1, delay: 30} |
| 250 | skip_fail: false |
| 251 | |
| 252 | # Configure cinder-volume salt-call |
| 253 | - description: Set disks 01 |
| 254 | cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb' |
| 255 | node_name: {{ HOSTNAME_CTL01 }} |
| 256 | retry: {count: 1, delay: 30} |
| 257 | skip_fail: false |
| 258 | |
| 259 | - description: Set disks 02 |
| 260 | cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb' |
| 261 | node_name: {{ HOSTNAME_CTL02 }} |
| 262 | retry: {count: 1, delay: 30} |
| 263 | skip_fail: false |
| 264 | |
| 265 | - description: Set disks 03 |
| 266 | cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb' |
| 267 | node_name: {{ HOSTNAME_CTL03 }} |
| 268 | retry: {count: 1, delay: 30} |
| 269 | skip_fail: false |
| 270 | |
| 271 | - description: Create partitions 01 |
| 272 | cmd: salt-call cmd.run 'pvcreate /dev/vdb1' |
| 273 | node_name: {{ HOSTNAME_CTL01 }} |
| 274 | retry: {count: 1, delay: 30} |
| 275 | skip_fail: false |
| 276 | |
| 277 | - description: Create partitions 02 |
| 278 | cmd: salt-call cmd.run 'pvcreate /dev/vdb1' |
| 279 | node_name: {{ HOSTNAME_CTL01 }} |
| 280 | retry: {count: 1, delay: 30} |
| 281 | skip_fail: false |
| 282 | |
| 283 | - description: Create partitions 03 |
| 284 | cmd: salt-call cmd.run 'pvcreate /dev/vdb1' |
| 285 | node_name: {{ HOSTNAME_CTL01 }} |
| 286 | retry: {count: 1, delay: 30} |
| 287 | skip_fail: false |