sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 1 | {% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %} |
sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 2 | {% from 'cookied-bm-mcp-ocata-contrail/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 %} |
sgudz | cced67d | 2017-10-11 15:56:09 +0300 | [diff] [blame] | 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 | 8c888ec | 2017-10-02 15:29:23 +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 | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 13 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 14 | {{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }} |
sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 15 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 16 | {{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }} |
sgudz | 8c888ec | 2017-10-02 15:29:23 +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 | 8c888ec | 2017-10-02 15:29:23 +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 | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 28 | |
| 29 | # install contrail |
sgudz | 868f086 | 2018-03-16 21:47:18 +0200 | [diff] [blame] | 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 |
sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 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 | |
sgudz | 868f086 | 2018-03-16 21:47:18 +0200 | [diff] [blame] | 44 | - description: Install Opencontrail control on ctl01 |
sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 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 }} |
sgudz | cced67d | 2017-10-11 15:56:09 +0300 | [diff] [blame] | 48 | retry: {count: 1, delay: 5} |
| 49 | skip_fail: false |
| 50 | |
sgudz | 868f086 | 2018-03-16 21:47:18 +0200 | [diff] [blame] | 51 | - description: Install Opencontrail control on all nodes |
| 52 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 53 | -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client |
| 54 | node_name: {{ HOSTNAME_CFG01 }} |
sgudz | 868f086 | 2018-03-16 21:47:18 +0200 | [diff] [blame] | 55 | retry: {count: 1, delay: 5} |
sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 56 | skip_fail: false |
| 57 | |
sgudz | 868f086 | 2018-03-16 21:47:18 +0200 | [diff] [blame] | 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 |
sgudz | cced67d | 2017-10-11 15:56:09 +0300 | [diff] [blame] | 61 | node_name: {{ HOSTNAME_CFG01 }} |
| 62 | retry: {count: 1, delay: 5} |
| 63 | skip_fail: false |
| 64 | |
sgudz | 868f086 | 2018-03-16 21:47:18 +0200 | [diff] [blame] | 65 | - description: Workaround for https://mirantis.jira.com/browse/PROD-12798 |
sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 66 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
sgudz | 868f086 | 2018-03-16 21:47:18 +0200 | [diff] [blame] | 67 | -C 'I@opencontrail:control' service.restart 'keepalived' |
sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 68 | node_name: {{ HOSTNAME_CFG01 }} |
sgudz | 868f086 | 2018-03-16 21:47:18 +0200 | [diff] [blame] | 69 | retry: {count: 1, delay: 5} |
sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 70 | skip_fail: false |
| 71 | |
sgudz | 868f086 | 2018-03-16 21:47:18 +0200 | [diff] [blame] | 72 | # OpenContrail vrouters |
| 73 | - description: Install Opencontrail client |
sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 74 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
sgudz | 868f086 | 2018-03-16 21:47:18 +0200 | [diff] [blame] | 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' |
sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 83 | node_name: {{ HOSTNAME_CFG01 }} |
sgudz | cced67d | 2017-10-11 15:56:09 +0300 | [diff] [blame] | 84 | retry: {count: 2, delay: 5} |
sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 85 | skip_fail: false |
| 86 | |
sgudz | 868f086 | 2018-03-16 21:47:18 +0200 | [diff] [blame] | 87 | - description: Install Opencontrail on computes |
| 88 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 89 | -C 'I@opencontrail:compute' state.sls 'opencontrail' |
| 90 | node_name: {{ HOSTNAME_CFG01 }} |
| 91 | retry: {count: 2, delay: 5} |
| 92 | skip_fail: false |
| 93 | |
| 94 | - description: Test Opencontrail |
| 95 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 96 | -C 'I@opencontrail:control' cmd.run 'contrail-status' |
sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 97 | node_name: {{ HOSTNAME_CFG01 }} |
| 98 | retry: {count: 1, delay: 5} |
| 99 | skip_fail: false |
| 100 | |
Dennis Dmitriev | 4034db0 | 2018-08-26 21:50:13 +0300 | [diff] [blame] | 101 | {{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }} |
sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 102 | |
| 103 | - description: Deploy horizon dashboard |
| 104 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 105 | -C 'I@horizon:server' state.sls horizon |
| 106 | node_name: {{ HOSTNAME_CFG01 }} |
| 107 | retry: {count: 1, delay: 5} |
| 108 | skip_fail: true |
| 109 | |
| 110 | - description: Deploy nginx proxy |
| 111 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False |
| 112 | -C 'I@nginx:server' state.sls nginx |
| 113 | node_name: {{ HOSTNAME_CFG01 }} |
| 114 | retry: {count: 1, delay: 5} |
| 115 | skip_fail: true |
| 116 | |
| 117 | |
| 118 | # Install compute node |
| 119 | |
| 120 | - description: Apply formulas for compute node |
| 121 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply |
| 122 | node_name: {{ HOSTNAME_CFG01 }} |
| 123 | retry: {count: 1, delay: 5} |
| 124 | skip_fail: true |
| 125 | |
| 126 | - description: Re-apply(as in doc) 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} |
Oleksii Butenko | 9f2601c | 2018-02-08 15:13:21 +0200 | [diff] [blame] | 130 | skip_fail: false |
sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 131 | |
| 132 | - description: Check IP on computes |
| 133 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run |
| 134 | 'ip a' |
| 135 | node_name: {{ HOSTNAME_CFG01 }} |
| 136 | retry: {count: 10, delay: 30} |
| 137 | skip_fail: false |
| 138 | |
| 139 | |
| 140 | # Upload cirros image |
| 141 | |
| 142 | - description: Upload cirros image on ctl01 |
| 143 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
| 144 | 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img' |
| 145 | node_name: {{ HOSTNAME_CFG01 }} |
| 146 | retry: {count: 2, delay: 30} |
| 147 | skip_fail: false |
| 148 | |
| 149 | - description: Register image in glance |
| 150 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run |
Dmitry Tyzhnenko | 30f5804 | 2017-11-28 17:00:40 +0200 | [diff] [blame] | 151 | '. /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' |
sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 152 | node_name: {{ HOSTNAME_CFG01 }} |
| 153 | retry: {count: 1, delay: 30} |
| 154 | skip_fail: false |
| 155 | |
sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 156 | - description: sync time |
| 157 | cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run |
| 158 | 'service ntp stop; ntpd -gq; service ntp start' |
| 159 | node_name: {{ HOSTNAME_CFG01 }} |
| 160 | retry: {count: 1, delay: 30} |
| 161 | skip_fail: false |
| 162 | |
sgudz | cced67d | 2017-10-11 15:56:09 +0300 | [diff] [blame] | 163 | - description: Install docker.io on ctl |
| 164 | cmd: salt "ctl01*" cmd.run 'apt-get install docker.io -y' |
sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 165 | node_name: {{ HOSTNAME_CFG01 }} |
| 166 | retry: {count: 1, delay: 30} |
| 167 | skip_fail: false |
| 168 | |
Tatyana Leontovich | d6bcbc9 | 2018-03-23 15:02:28 +0200 | [diff] [blame] | 169 | - description: Enable forward policy |
| 170 | cmd: salt "ctl01*" cmd.run 'iptables --policy FORWARD ACCEPT' |
| 171 | node_name: {{ HOSTNAME_CFG01 }} |
| 172 | retry: {count: 1, delay: 30} |
| 173 | skip_fail: false |
sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 174 | |
sgudz | cced67d | 2017-10-11 15:56:09 +0300 | [diff] [blame] | 175 | - description: Hack resolv.conf on VCP nodes for internal services access |
| 176 | cmd: | |
| 177 | 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;" |
sgudz | cced67d | 2017-10-11 15:56:09 +0300 | [diff] [blame] | 178 | node_name: {{ HOSTNAME_CFG01 }} |
| 179 | retry: {count: 1, delay: 5} |
| 180 | skip_fail: false |
sgudz | 8c888ec | 2017-10-02 15:29:23 +0300 | [diff] [blame] | 181 | |
sgudz | cced67d | 2017-10-11 15:56:09 +0300 | [diff] [blame] | 182 | |
| 183 | - description: Hack vrouter (Delete default moun point) |
| 184 | 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" |
| 185 | node_name: {{ HOSTNAME_CFG01 }} |
| 186 | retry: {count: 1, delay: 30} |
| 187 | skip_fail: true |
| 188 | |
| 189 | - description: Temporary WR for correct pci in vrouter.conf |
| 190 | cmd: salt "cmp*" cmd.run "sed -i 's/physical\_interface\_address\=.*/physical\_interface\_address=0000\:05\:00\.0/g' /etc/contrail/contrail-vrouter-agent.conf" |
| 191 | node_name: {{ HOSTNAME_CFG01 }} |
| 192 | retry: {count: 1, delay: 30} |
| 193 | skip_fail: true |
| 194 | |
| 195 | - description: Remove crashes files from /var/crashes/ while vrouter was crashed |
| 196 | cmd: salt "cmp*" cmd.run "rm -rf /var/crashes/*" |
| 197 | node_name: {{ HOSTNAME_CFG01 }} |
| 198 | retry: {count: 1, delay: 30} |
| 199 | skip_fail: true |
| 200 | |
| 201 | - description: Reboot computes |
sgudz | 2b3dcfa | 2018-07-18 21:51:38 +0300 | [diff] [blame] | 202 | cmd: | |
| 203 | salt "cmp*" system.reboot; |
| 204 | sleep 600; |
sgudz | cced67d | 2017-10-11 15:56:09 +0300 | [diff] [blame] | 205 | node_name: {{ HOSTNAME_CFG01 }} |
| 206 | retry: {count: 1, delay: 30} |
| 207 | skip_fail: true |