| sgudz | d7f8ec9 | 2018-04-19 16:22:47 +0300 | [diff] [blame] | 1 | {% from 'cookied-bm-mcp-ocata-contrail-nfv/underlay.yaml' import HOSTNAME_CFG01 with context %} | 
|  | 2 | {% from 'cookied-bm-mcp-ocata-contrail-nfv/underlay.yaml' import HOSTNAME_GTW01 with context %} | 
|  | 3 | {% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %} | 
|  | 4 | {% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %} | 
|  | 5 | {% set PATTERN = os_env('PATTERN', 'false') %} | 
|  | 6 | {% set RUN_TEMPEST = os_env('RUN_TEMPEST', 'false') %} | 
| Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 7 |  | 
|  | 8 | {% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %} | 
|  | 9 |  | 
| sgudz | d7f8ec9 | 2018-04-19 16:22:47 +0300 | [diff] [blame] | 10 | # Install OpenStack control services | 
|  | 11 |  | 
| sgudz | 62df2fc | 2018-10-09 12:26:19 +0300 | [diff] [blame] | 12 | {{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE() }} | 
| sgudz | d7f8ec9 | 2018-04-19 16:22:47 +0300 | [diff] [blame] | 13 |  | 
| Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 14 | {{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }} | 
| sgudz | d7f8ec9 | 2018-04-19 16:22:47 +0300 | [diff] [blame] | 15 |  | 
| Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 16 | {{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }} | 
| sgudz | d7f8ec9 | 2018-04-19 16:22:47 +0300 | [diff] [blame] | 17 |  | 
| sgudz | e12b509 | 2018-09-15 00:40:10 +0300 | [diff] [blame] | 18 | {{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER(INSTALL_VOLUME=false) }} | 
|  | 19 |  | 
|  | 20 | - description: WR Install cinder volume | 
|  | 21 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False | 
|  | 22 | -C 'I@cinder:volume' state.sls cinder | 
|  | 23 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 24 | retry: {count: 2, delay: 5} | 
|  | 25 | skip_fail: false | 
| sgudz | d7f8ec9 | 2018-04-19 16:22:47 +0300 | [diff] [blame] | 26 |  | 
| Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 27 | {{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON(INSTALL_GATEWAY=false) }} | 
| sgudz | d7f8ec9 | 2018-04-19 16:22:47 +0300 | [diff] [blame] | 28 |  | 
|  | 29 | # install contrail | 
|  | 30 | - description: Install Opencontrail db on ctl01 | 
|  | 31 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False | 
|  | 32 | -C 'I@opencontrail:database and *01*' state.sls opencontrail.database | 
|  | 33 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 34 | retry: {count: 2, delay: 20} | 
|  | 35 | skip_fail: false | 
|  | 36 |  | 
|  | 37 | - description: Install Opencontrail db on all nodes | 
|  | 38 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False | 
|  | 39 | -C 'I@opencontrail:database' state.sls opencontrail.database | 
|  | 40 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 41 | retry: {count: 2, delay: 20} | 
|  | 42 | skip_fail: false | 
|  | 43 |  | 
|  | 44 | - description: Install Opencontrail control on ctl01 | 
|  | 45 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False | 
|  | 46 | -C 'I@opencontrail:control and *01*' state.sls opencontrail exclude=opencontrail.client | 
|  | 47 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 48 | retry: {count: 1, delay: 5} | 
|  | 49 | skip_fail: false | 
|  | 50 |  | 
|  | 51 | - description: Install Opencontrail control on all nodes | 
|  | 52 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False | 
|  | 53 | -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client | 
|  | 54 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 55 | retry: {count: 1, delay: 5} | 
|  | 56 | skip_fail: false | 
|  | 57 |  | 
|  | 58 | - description: Install Opencontrail on collector | 
|  | 59 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False | 
|  | 60 | -C 'I@opencontrail:collector' state.sls opencontrail exclude=opencontrail.client | 
|  | 61 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 62 | retry: {count: 1, delay: 5} | 
|  | 63 | skip_fail: false | 
|  | 64 |  | 
|  | 65 | - description: Workaround for https://mirantis.jira.com/browse/PROD-12798 | 
|  | 66 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False | 
|  | 67 | -C 'I@opencontrail:control' service.restart 'keepalived' | 
|  | 68 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 69 | retry: {count: 1, delay: 5} | 
|  | 70 | skip_fail: false | 
|  | 71 |  | 
|  | 72 | # OpenContrail vrouters | 
|  | 73 | - description: Install Opencontrail client | 
|  | 74 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False | 
|  | 75 | -C 'I@opencontrail:database:id:1' state.sls 'opencontrail.client' | 
|  | 76 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 77 | retry: {count: 1, delay: 5} | 
|  | 78 | skip_fail: false | 
|  | 79 |  | 
|  | 80 | - description: Install Opencontrail client on computes | 
|  | 81 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False | 
|  | 82 | -C 'I@opencontrail:compute' state.sls 'opencontrail.client' | 
|  | 83 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 84 | retry: {count: 2, delay: 5} | 
|  | 85 | skip_fail: false | 
|  | 86 |  | 
|  | 87 | # The next four steps should be converted to one (state.sls opencontrail)  with skip_fail: false | 
|  | 88 | # It is related to bug with hugepages. So we need to add WR, then reboot | 
|  | 89 | # for only 1G hugepages were mounted. Then re-apply state | 
|  | 90 | - description: Install Opencontrail on computes | 
|  | 91 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False | 
|  | 92 | -C 'I@opencontrail:compute' state.sls 'opencontrail' | 
|  | 93 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 94 | retry: {count: 1, delay: 5} | 
|  | 95 | skip_fail: true | 
|  | 96 |  | 
|  | 97 | - description: Hack vrouter (Delete default moun point) | 
|  | 98 | cmd: salt "cmp*" cmd.run "sed -i 's/exit 0//g' /etc/rc.local; echo 'umount /dev/hugepages; service supervisor-vrouter restart' >> /etc/rc.local; echo 'exit 0' >> /etc/rc.local" | 
|  | 99 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 100 | retry: {count: 1, delay: 30} | 
|  | 101 | skip_fail: true | 
|  | 102 |  | 
|  | 103 | - description: Reboot computes | 
|  | 104 | cmd: salt --timeout=600  "cmp*" system.reboot | 
|  | 105 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 106 | retry: {count: 1, delay: 30} | 
|  | 107 | skip_fail: true | 
|  | 108 |  | 
|  | 109 | - description: Install Opencontrail on computes | 
|  | 110 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False | 
|  | 111 | -C 'I@opencontrail:compute' state.sls 'opencontrail' | 
|  | 112 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 113 | retry: {count: 2, delay: 5} | 
|  | 114 | skip_fail: false | 
|  | 115 |  | 
|  | 116 | - description: Remove crashes files from /var/crashes/ while vrouter was crashed | 
|  | 117 | cmd: salt  "cmp*" cmd.run "rm -rf /var/crashes/*" | 
|  | 118 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 119 | retry: {count: 1, delay: 30} | 
|  | 120 | skip_fail: true | 
|  | 121 |  | 
|  | 122 | - description: Test Opencontrail | 
|  | 123 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False | 
|  | 124 | -C 'I@opencontrail:control' cmd.run 'contrail-status' | 
|  | 125 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 126 | retry: {count: 1, delay: 5} | 
|  | 127 | skip_fail: false | 
|  | 128 |  | 
| Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 129 | {{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }} | 
| sgudz | d7f8ec9 | 2018-04-19 16:22:47 +0300 | [diff] [blame] | 130 |  | 
|  | 131 | - description: Deploy horizon dashboard | 
|  | 132 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False | 
|  | 133 | -C 'I@horizon:server' state.sls horizon | 
|  | 134 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 135 | retry: {count: 1, delay: 5} | 
|  | 136 | skip_fail: true | 
|  | 137 |  | 
|  | 138 | - description: Deploy nginx proxy | 
|  | 139 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False | 
|  | 140 | -C 'I@nginx:server' state.sls nginx | 
|  | 141 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 142 | retry: {count: 1, delay: 5} | 
|  | 143 | skip_fail: true | 
|  | 144 |  | 
|  | 145 | # Install compute node | 
|  | 146 | - description: Apply formulas for compute node | 
|  | 147 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply | 
|  | 148 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 149 | retry: {count: 1, delay: 5} | 
|  | 150 | skip_fail: true | 
|  | 151 |  | 
|  | 152 | - description: Re-apply(as in doc) formulas for compute node | 
|  | 153 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply | 
|  | 154 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 155 | retry: {count: 1, delay: 5} | 
|  | 156 | skip_fail: false | 
|  | 157 |  | 
|  | 158 | - description: Check IP on computes | 
|  | 159 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run | 
|  | 160 | 'ip a' | 
|  | 161 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 162 | retry: {count: 10, delay: 30} | 
|  | 163 | skip_fail: false | 
|  | 164 |  | 
|  | 165 | # Upload cirros image | 
|  | 166 | - description: Upload cirros image on ctl01 | 
|  | 167 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run | 
|  | 168 | 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img' | 
|  | 169 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 170 | retry: {count: 2, delay: 30} | 
|  | 171 | skip_fail: false | 
|  | 172 |  | 
|  | 173 | - description: Register image in glance | 
|  | 174 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run | 
|  | 175 | '. /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' | 
|  | 176 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 177 | retry: {count: 1, delay: 30} | 
|  | 178 | skip_fail: false | 
|  | 179 |  | 
|  | 180 | - description: sync time | 
|  | 181 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run | 
|  | 182 | 'service ntp stop; ntpd -gq;  service ntp start' | 
|  | 183 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 184 | retry: {count: 1, delay: 30} | 
|  | 185 | skip_fail: false | 
|  | 186 |  | 
|  | 187 | - description: Install docker.io on ctl | 
|  | 188 | cmd: salt "ctl01*" cmd.run 'apt-get install docker.io -y' | 
|  | 189 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 190 | retry: {count: 1, delay: 30} | 
|  | 191 | skip_fail: false | 
|  | 192 |  | 
|  | 193 | - description: Enable forward policy | 
|  | 194 | cmd: salt "ctl01*" cmd.run 'iptables --policy FORWARD ACCEPT' | 
|  | 195 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 196 | retry: {count: 1, delay: 30} | 
|  | 197 | skip_fail: false | 
|  | 198 |  | 
|  | 199 | - description: Hack resolv.conf on VCP nodes for internal services access | 
|  | 200 | cmd: | | 
|  | 201 | 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;" | 
|  | 202 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 203 | retry: {count: 1, delay: 5} | 
|  | 204 | skip_fail: false | 
|  | 205 |  | 
|  | 206 | - description: Reboot computes | 
| sgudz | 2b3dcfa | 2018-07-18 21:51:38 +0300 | [diff] [blame] | 207 | cmd: | | 
|  | 208 | salt "cmp*" system.reboot; | 
|  | 209 | sleep 600; | 
| sgudz | d7f8ec9 | 2018-04-19 16:22:47 +0300 | [diff] [blame] | 210 | node_name: {{ HOSTNAME_CFG01 }} | 
|  | 211 | retry: {count: 1, delay: 30} | 
|  | 212 | skip_fail: true |