sgudz | 850e607 | 2018-06-05 14:46:53 +0300 | [diff] [blame] | 1 | {% from 'cookied-bm-contrail40/underlay.yaml' import HOSTNAME_CFG01 with context %} |
| 2 | {% from 'cookied-bm-contrail40/underlay.yaml' import HOSTNAME_GTW01 with context %} |
| 3 | {% from 'cookied-bm-contrail40/underlay.yaml' import DOMAIN_NAME with context %} |
| 4 | {% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %} |
| 5 | {% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %} |
| 6 | {% set PATTERN = os_env('PATTERN', 'false') %} |
| 7 | {% set RUN_TEMPEST = os_env('RUN_TEMPEST', 'false') %} |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame^] | 8 | |
| 9 | {% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %} |
| 10 | |
sgudz | 850e607 | 2018-06-05 14:46:53 +0300 | [diff] [blame] | 11 | # Install OpenStack control services |
| 12 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame^] | 13 | {{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE(USE_ORCHESTRATE=false) }} |
sgudz | 850e607 | 2018-06-05 14:46:53 +0300 | [diff] [blame] | 14 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame^] | 15 | {{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }} |
sgudz | 850e607 | 2018-06-05 14:46:53 +0300 | [diff] [blame] | 16 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame^] | 17 | {{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }} |
sgudz | 850e607 | 2018-06-05 14:46:53 +0300 | [diff] [blame] | 18 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame^] | 19 | {{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER(INSTALL_VOLUME=true) }} |
sgudz | 850e607 | 2018-06-05 14:46:53 +0300 | [diff] [blame] | 20 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame^] | 21 | {{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON(INSTALL_GATEWAY=false) }} |
sgudz | 850e607 | 2018-06-05 14:46:53 +0300 | [diff] [blame] | 22 | |
| 23 | # install contrail |
| 24 | - description: Install docker for Opencontrail |
| 25 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 26 | -C 'I@opencontrail:database' state.sls docker.host |
| 27 | node_name: {{ HOSTNAME_CFG01 }} |
| 28 | retry: {count: 1, delay: 20} |
| 29 | skip_fail: false |
| 30 | |
| 31 | - description: Install Opencontrail requirements |
| 32 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 33 | -C 'I@opencontrail:database' state.sls opencontrail exclude=opencontrail.client |
| 34 | node_name: {{ HOSTNAME_CFG01 }} |
| 35 | retry: {count: 1, delay: 20} |
| 36 | skip_fail: false |
| 37 | |
| 38 | - description: Spawn Opencontrail docker images |
| 39 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 40 | -C 'I@opencontrail:database' state.sls docker.client && sleep 15; |
| 41 | node_name: {{ HOSTNAME_CFG01 }} |
| 42 | retry: {count: 1, delay: 5} |
| 43 | skip_fail: false |
| 44 | |
| 45 | - description: Finalize opencontrail services |
| 46 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 47 | -C 'I@opencontrail:database and *01*' state.sls opencontrail.client |
| 48 | node_name: {{ HOSTNAME_CFG01 }} |
| 49 | retry: {count: 3, delay: 30} |
| 50 | skip_fail: true |
| 51 | |
sgudz | 30da28b | 2018-08-13 22:35:54 +0300 | [diff] [blame] | 52 | - description: Highstate analytics |
| 53 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 54 | -C 'nal*' state.sls highstate && sleep 15; |
| 55 | node_name: {{ HOSTNAME_CFG01 }} |
| 56 | retry: {count: 1, delay: 5} |
| 57 | skip_fail: true |
| 58 | |
sgudz | 850e607 | 2018-06-05 14:46:53 +0300 | [diff] [blame] | 59 | - description: Check contrail status |
| 60 | cmd: sleep 15; salt --hard-crash --state-output=mixed --state-verbose=False |
| 61 | -C 'I@opencontrail:database' cmd.run 'doctrail all contrail-status' |
| 62 | node_name: {{ HOSTNAME_CFG01 }} |
| 63 | retry: {count: 1, delay: 5} |
| 64 | skip_fail: false |
| 65 | |
| 66 | - description: Install Opencontrail client on computes |
| 67 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 68 | -C 'I@opencontrail:compute' state.highstate exclude=opencontrail.client |
| 69 | node_name: {{ HOSTNAME_CFG01 }} |
| 70 | retry: {count: 2, delay: 5} |
| 71 | skip_fail: false |
| 72 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame^] | 73 | {{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }} |
sgudz | 850e607 | 2018-06-05 14:46:53 +0300 | [diff] [blame] | 74 | |
| 75 | - description: Deploy horizon dashboard |
| 76 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 77 | -C 'I@horizon:server' state.sls horizon |
| 78 | node_name: {{ HOSTNAME_CFG01 }} |
| 79 | retry: {count: 1, delay: 5} |
| 80 | skip_fail: true |
| 81 | |
| 82 | - description: Deploy nginx proxy |
| 83 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 84 | -C 'I@nginx:server' state.sls nginx |
| 85 | node_name: {{ HOSTNAME_CFG01 }} |
| 86 | retry: {count: 1, delay: 5} |
| 87 | skip_fail: true |
| 88 | |
| 89 | |
| 90 | # Install compute node |
| 91 | |
| 92 | - description: Apply formulas for compute node |
| 93 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 94 | node_name: {{ HOSTNAME_CFG01 }} |
| 95 | retry: {count: 1, delay: 5} |
| 96 | skip_fail: true |
| 97 | |
| 98 | - description: Check IP on computes |
| 99 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run |
| 100 | 'ip a' |
| 101 | node_name: {{ HOSTNAME_CFG01 }} |
| 102 | retry: {count: 10, delay: 30} |
| 103 | skip_fail: false |
| 104 | |
| 105 | |
| 106 | # Upload cirros image |
| 107 | |
| 108 | - description: Upload cirros image on ctl01 |
| 109 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 110 | 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img' |
| 111 | node_name: {{ HOSTNAME_CFG01 }} |
| 112 | retry: {count: 2, delay: 30} |
| 113 | skip_fail: false |
| 114 | |
| 115 | - description: Register image in glance |
| 116 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 117 | '. /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' |
| 118 | node_name: {{ HOSTNAME_CFG01 }} |
| 119 | retry: {count: 1, delay: 30} |
| 120 | skip_fail: false |
| 121 | |
| 122 | - description: Create net04 |
| 123 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 124 | '. /root/keystonercv3; neutron net-create net04' |
| 125 | node_name: {{ HOSTNAME_CFG01 }} |
| 126 | retry: {count: 1, delay: 30} |
| 127 | skip_fail: false |
| 128 | |
| 129 | - description: Create subnet_net04 |
| 130 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 131 | '. /root/keystonercv3; neutron subnet-create net04 192.168.0.0/24 --name net04__subnet' |
| 132 | node_name: {{ HOSTNAME_CFG01 }} |
| 133 | retry: {count: 1, delay: 30} |
| 134 | skip_fail: false |
| 135 | |
| 136 | - description: Create router |
| 137 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 138 | '. /root/keystonercv3; neutron router-create net04_router01' |
| 139 | node_name: {{ HOSTNAME_CFG01 }} |
| 140 | retry: {count: 1, delay: 30} |
| 141 | skip_fail: false |
| 142 | |
| 143 | - description: Add interface |
| 144 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 145 | '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet' |
| 146 | node_name: {{ HOSTNAME_CFG01 }} |
| 147 | retry: {count: 1, delay: 30} |
| 148 | skip_fail: false |
| 149 | |
| 150 | - description: Allow all |
| 151 | cmd: | |
| 152 | salt 'ctl01*' cmd.run '. /root/keystonercv3; openstack security group rule create default --egress --protocol tcp'; |
| 153 | salt 'ctl01*' cmd.run '. /root/keystonercv3; openstack security group rule create default --ingress --protocol tcp'; |
| 154 | salt 'ctl01*' cmd.run '. /root/keystonercv3; openstack security group rule create default --egress --protocol icmp'; |
| 155 | salt 'ctl01*' cmd.run '. /root/keystonercv3; openstack security group rule create default --ingress --protocol icmp'; |
| 156 | node_name: {{ HOSTNAME_CFG01 }} |
| 157 | retry: {count: 1, delay: 30} |
| 158 | skip_fail: true |
| 159 | |
| 160 | - description: sync time |
| 161 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run |
| 162 | 'service ntp stop; ntpd -gq; service ntp start' |
| 163 | node_name: {{ HOSTNAME_CFG01 }} |
| 164 | retry: {count: 1, delay: 30} |
| 165 | skip_fail: false |
| 166 | |
| 167 | - description: Install docker.io on ctl |
| 168 | cmd: salt "ctl01*" cmd.run 'apt-get install docker.io -y' |
| 169 | node_name: {{ HOSTNAME_CFG01 }} |
| 170 | retry: {count: 1, delay: 30} |
| 171 | skip_fail: false |
| 172 | |
| 173 | - description: Enable forward policy |
| 174 | cmd: salt "ctl01*" cmd.run 'iptables --policy FORWARD ACCEPT' |
| 175 | node_name: {{ HOSTNAME_CFG01 }} |
| 176 | retry: {count: 1, delay: 30} |
| 177 | skip_fail: false |
| 178 | |
| 179 | - description: Hack resolv.conf on VCP nodes for internal services access |
| 180 | cmd: | |
| 181 | salt --hard-crash --state-output=mixed --state-verbose=False -C '* and not kvm* and not cmp* and not gtw* and not cfg*' cmd.run "echo 'nameserver 172.18.208.44' > /etc/resolv.conf;" |
| 182 | node_name: {{ HOSTNAME_CFG01 }} |
| 183 | retry: {count: 1, delay: 5} |
| 184 | skip_fail: false |
| 185 | |
| 186 | - description: Remove crashes files from /var/crashes/ while vrouter was crashed |
| 187 | cmd: salt "cmp*" cmd.run "rm -rf /var/crashes/*" |
| 188 | node_name: {{ HOSTNAME_CFG01 }} |
| 189 | retry: {count: 1, delay: 30} |
| 190 | skip_fail: true |
| 191 | |
| 192 | - description: Reboot computes |
| 193 | cmd: | |
| 194 | salt "cmp*" system.reboot; |
| 195 | sleep 600; |
| 196 | node_name: {{ HOSTNAME_CFG01 }} |
| 197 | retry: {count: 1, delay: 30} |
| 198 | skip_fail: true |
| 199 | |
| 200 | - description: Finalize contrail |
| 201 | cmd: salt -C 'I@opencontrail:compute' state.sls opencontrail.client |
| 202 | node_name: {{ HOSTNAME_CFG01 }} |
| 203 | retry: {count: 1, delay: 30} |
| 204 | skip_fail: false |
| 205 | |
| 206 | - description: Check status for contrail services |
| 207 | cmd: | |
| 208 | sleep 15; |
| 209 | salt -C 'I@opencontrail:database' cmd.run 'doctrail all contrail-status' |
| 210 | node_name: {{ HOSTNAME_CFG01 }} |
| 211 | retry: {count: 1, delay: 30} |
| 212 | skip_fail: false |
| 213 | |
| 214 | - description: WR for having ability to use hostnames |
| 215 | cmd: | |
| 216 | CTL01_ADDRESS=`salt --out=newline_values_only 'ctl01*' network.interface_ip ens2`; |
| 217 | echo "$CTL01_ADDRESS ctl01.{{ DOMAIN_NAME }} ctl01" >> /etc/hosts; |
| 218 | node_name: {{ HOSTNAME_CFG01 }} |
| 219 | retry: {count: 1, delay: 30} |
| 220 | skip_fail: true |