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