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