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