ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 1 | {% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | {% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CTL01 with context %} |
| 3 | {% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CTL02 with context %} |
| 4 | {% from 'virtual-mcp-trusty/underlay.yaml' import HOSTNAME_CTL03 with context %} |
| 5 | {% from 'virtual-mcp-trusty/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 | |
Vladimir Khlyunev | 72b2be9 | 2018-11-21 15:51:19 +0400 | [diff] [blame] | 9 | # vkhlyunev: shared steps are constantly updating due master development so |
| 10 | # we cant use them for old release. For openstack.yaml we can use some shared |
| 11 | # steps for now but TODO: bind deployment workflow to 2018.8.0 state |
| 12 | |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 13 | # Install OpenStack control services |
ibumarskov | 5986763 | 2018-05-21 17:03:24 +0400 | [diff] [blame] | 14 | - description: Sync time |
| 15 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False -G 'oscodename:trusty' cmd.run "service ntp stop && ntpdate pool.ntp.org && service ntp start" |
| 16 | node_name: {{ HOSTNAME_CFG01 }} |
| 17 | retry: {count: 1, delay: 5} |
| 18 | skip_fail: false |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 19 | |
ibumarskov | 1b85e89 | 2018-08-30 11:54:47 +0400 | [diff] [blame] | 20 | {% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %} |
ibumarskov | e23c10e | 2018-08-20 15:47:58 +0400 | [diff] [blame] | 21 | |
ibumarskov | 1b85e89 | 2018-08-30 11:54:47 +0400 | [diff] [blame] | 22 | # Deploy nginx before openstack services (PROD-22740) |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 23 | - description: Deploy nginx proxy |
| 24 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 25 | -C 'I@nginx:server' state.sls nginx |
| 26 | node_name: {{ HOSTNAME_CFG01 }} |
| 27 | retry: {count: 1, delay: 5} |
| 28 | skip_fail: true |
| 29 | |
Vladimir Khlyunev | 72b2be9 | 2018-11-21 15:51:19 +0400 | [diff] [blame] | 30 | - description: Install keystone service on primary node |
| 31 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 32 | -C 'I@keystone:server and *01*' state.sls keystone.server |
| 33 | node_name: {{ HOSTNAME_CFG01 }} |
| 34 | retry: {count: 2, delay: 15} |
| 35 | skip_fail: false |
| 36 | |
| 37 | - description: Install keystone service on other nodes |
| 38 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 39 | -C 'I@keystone:server' state.sls keystone.server |
| 40 | node_name: {{ HOSTNAME_CFG01 }} |
| 41 | retry: {count: 2, delay: 15} |
| 42 | skip_fail: false |
| 43 | |
| 44 | - description: Restart apache due to PROD-10477 |
| 45 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' |
| 46 | cmd.run "service apache2 restart" |
| 47 | node_name: {{ HOSTNAME_CFG01 }} |
| 48 | retry: {count: 1, delay: 15} |
| 49 | skip_fail: false |
| 50 | |
| 51 | - description: Check apache status to PROD-10477 |
| 52 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' |
| 53 | cmd.run "service apache2 status" |
| 54 | node_name: {{ HOSTNAME_CFG01 }} |
| 55 | retry: {count: 1, delay: 15} |
| 56 | skip_fail: false |
| 57 | |
| 58 | - description: Mount glusterfs.client volumes (resuires created 'keystone' system user) |
| 59 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 60 | -C 'I@keystone:server' state.sls glusterfs.client -b 1 |
| 61 | node_name: {{ HOSTNAME_CFG01 }} |
| 62 | retry: {count: 1, delay: 5} |
| 63 | skip_fail: false |
| 64 | |
| 65 | - description: Update fernet keys for keystone server on the mounted glusterfs volume |
| 66 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 67 | -C 'I@keystone:server' state.sls keystone.server -b 1 |
| 68 | node_name: {{ HOSTNAME_CFG01 }} |
| 69 | retry: {count: 1, delay: 5} |
| 70 | skip_fail: false |
| 71 | |
| 72 | - description: Populate keystone services/tenants/admins |
| 73 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 74 | -C 'I@keystone:client' state.sls keystone.client |
| 75 | node_name: {{ HOSTNAME_CFG01 }} |
| 76 | retry: {count: 2, delay: 5} |
| 77 | skip_fail: false |
| 78 | |
| 79 | - description: Check keystone service-list |
| 80 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 81 | -C "I@keystone:server" cmd.run ". /root/keystonercv3; |
| 82 | openstack service list" |
| 83 | node_name: {{ HOSTNAME_CFG01 }} |
| 84 | retry: {count: 1, delay: 5} |
| 85 | skip_fail: false |
ibumarskov | 1b85e89 | 2018-08-30 11:54:47 +0400 | [diff] [blame] | 86 | |
| 87 | {{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }} |
| 88 | |
Vladimir Khlyunev | 72b2be9 | 2018-11-21 15:51:19 +0400 | [diff] [blame] | 89 | - description: Install nova service on primary node |
| 90 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 91 | -C "I@nova:controller and *01*" state.sls nova.controller |
| 92 | node_name: {{ HOSTNAME_CFG01 }} |
| 93 | retry: {count: 1, delay: 5} |
| 94 | skip_fail: false |
| 95 | |
| 96 | - description: Install nova service on other nodes |
| 97 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 98 | -C "I@nova:controller" state.sls nova.controller |
| 99 | node_name: {{ HOSTNAME_CFG01 }} |
| 100 | retry: {count: 1, delay: 5} |
| 101 | skip_fail: false |
| 102 | |
| 103 | - description: Check nova service-list |
| 104 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 105 | -C "I@keystone:server" cmd.run ". /root/keystonercv3; |
| 106 | openstack compute service list" |
| 107 | node_name: {{ HOSTNAME_CFG01 }} |
| 108 | retry: {count: 1, delay: 5} |
| 109 | skip_fail: false |
| 110 | |
| 111 | - description: Check nova list |
| 112 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 113 | -C "I@keystone:server" cmd.run ". /root/keystonercv3; |
| 114 | openstack server list" |
| 115 | node_name: {{ HOSTNAME_CFG01 }} |
| 116 | retry: {count: 1, delay: 5} |
| 117 | skip_fail: false |
ibumarskov | 1b85e89 | 2018-08-30 11:54:47 +0400 | [diff] [blame] | 118 | |
| 119 | {{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }} |
| 120 | |
| 121 | {{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }} |
| 122 | |
| 123 | {{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }} |
| 124 | |
| 125 | {{ SHARED_OPENSTACK.MACRO_INSTALL_HORIZON() }} |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 126 | |
| 127 | # Install compute node |
| 128 | |
| 129 | - description: Apply formulas for compute node |
| 130 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 131 | node_name: {{ HOSTNAME_CFG01 }} |
| 132 | retry: {count: 1, delay: 5} |
| 133 | skip_fail: true |
| 134 | |
| 135 | - description: Re-apply(as in doc) formulas for compute node |
| 136 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 137 | node_name: {{ HOSTNAME_CFG01 }} |
| 138 | retry: {count: 1, delay: 5} |
| 139 | skip_fail: true |
| 140 | |
ibumarskov | 34d75d3 | 2018-09-11 13:18:10 +0400 | [diff] [blame] | 141 | - description: Restart libvirtd on compute nodes (PROD-23034) |
| 142 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' service.restart libvirtd |
| 143 | node_name: {{ HOSTNAME_CFG01 }} |
| 144 | retry: {count: 1, delay: 5} |
| 145 | skip_fail: false |
| 146 | |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 147 | - description: Check IP on computes |
| 148 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run |
| 149 | 'ip a' |
| 150 | node_name: {{ HOSTNAME_CFG01 }} |
| 151 | retry: {count: 10, delay: 30} |
| 152 | skip_fail: false |
| 153 | |
ibumarskov | 1b85e89 | 2018-08-30 11:54:47 +0400 | [diff] [blame] | 154 | # Upload cirros image |
ibumarskov | 712a687 | 2018-04-25 09:22:15 +0400 | [diff] [blame] | 155 | |
| 156 | - description: Upload cirros image on ctl01 |
| 157 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 158 | 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img' |
| 159 | node_name: {{ HOSTNAME_CFG01 }} |
| 160 | retry: {count: 2, delay: 30} |
| 161 | skip_fail: false |
| 162 | |
| 163 | - description: Register image in glance |
| 164 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 165 | '. /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' |
| 166 | node_name: {{ HOSTNAME_CFG01 }} |
| 167 | retry: {count: 1, delay: 30} |
| 168 | skip_fail: false |
| 169 | |
| 170 | - description: Create net04_external |
| 171 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 172 | '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat' |
| 173 | node_name: {{ HOSTNAME_CFG01 }} |
| 174 | retry: {count: 1, delay: 30} |
| 175 | skip_fail: false |
| 176 | |
| 177 | - description: Create subnet_external |
| 178 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 179 | '. /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' |
| 180 | node_name: {{ HOSTNAME_CFG01 }} |
| 181 | retry: {count: 1, delay: 30} |
| 182 | skip_fail: false |
| 183 | |
| 184 | - description: Create net04 |
| 185 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 186 | '. /root/keystonercv3; neutron net-create net04' |
| 187 | node_name: {{ HOSTNAME_CFG01 }} |
| 188 | retry: {count: 1, delay: 30} |
| 189 | skip_fail: false |
| 190 | |
| 191 | - description: Create subnet_net04 |
| 192 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 193 | '. /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' |
| 194 | node_name: {{ HOSTNAME_CFG01 }} |
| 195 | retry: {count: 1, delay: 30} |
| 196 | skip_fail: false |
| 197 | |
| 198 | - description: Create router |
| 199 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 200 | '. /root/keystonercv3; neutron router-create net04_router01' |
| 201 | node_name: {{ HOSTNAME_CFG01 }} |
| 202 | retry: {count: 1, delay: 30} |
| 203 | skip_fail: false |
| 204 | |
| 205 | - description: Set geteway |
| 206 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 207 | '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext' |
| 208 | node_name: {{ HOSTNAME_CFG01 }} |
| 209 | retry: {count: 1, delay: 30} |
| 210 | skip_fail: false |
| 211 | |
| 212 | - description: Add interface |
| 213 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 214 | '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet' |
| 215 | node_name: {{ HOSTNAME_CFG01 }} |
| 216 | retry: {count: 1, delay: 30} |
| 217 | skip_fail: false |
| 218 | |
| 219 | #- description: Allow all tcp |
| 220 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 221 | # '. /root/keystonercv3; openstack security group rule create --proto tcp --dst-port 22 default' |
| 222 | # node_name: {{ HOSTNAME_CFG01 }} |
| 223 | # retry: {count: 1, delay: 30} |
| 224 | # skip_fail: false |
| 225 | # |
| 226 | #- description: Allow all icmp |
| 227 | # cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 228 | # '. /root/keystonercv3; openstack security group rule create --proto icmp default' |
| 229 | # node_name: {{ HOSTNAME_CFG01 }} |
| 230 | # retry: {count: 1, delay: 30} |
| 231 | # skip_fail: false |
| 232 | |
| 233 | - description: sync time |
| 234 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run |
| 235 | 'service ntp stop; ntpd -gq; service ntp start' |
| 236 | node_name: {{ HOSTNAME_CFG01 }} |
| 237 | retry: {count: 1, delay: 30} |
| 238 | skip_fail: true |
| 239 | |
| 240 | - description: Install docker.io on gtw |
| 241 | cmd: salt-call cmd.run 'apt-get install docker.io -y' |
| 242 | node_name: {{ HOSTNAME_CFG01 }} |
| 243 | retry: {count: 1, delay: 30} |
| 244 | skip_fail: false |
| 245 | |
| 246 | - description: Enable forward policy on gtw |
| 247 | cmd: | |
| 248 | set -e; |
| 249 | iptables --policy FORWARD ACCEPT; |
| 250 | node_name: {{ HOSTNAME_GTW01 }} |
| 251 | retry: {count: 1, delay: 30} |
| 252 | skip_fail: false |
| 253 | |
| 254 | - description: create rc file on cfg |
| 255 | cmd: scp ctl01:/root/keystonercv3 /root |
| 256 | node_name: {{ HOSTNAME_CFG01 }} |
| 257 | retry: {count: 1, delay: 30} |
| 258 | skip_fail: false |
| 259 | |
| 260 | - description: Copy rc file |
| 261 | cmd: scp /root/keystonercv3 gtw01:/root |
| 262 | node_name: {{ HOSTNAME_CFG01 }} |
| 263 | retry: {count: 1, delay: 30} |
| 264 | skip_fail: false |