blob: fe01d301e44c70f130e91a7b7bd787f44d819745 [file] [log] [blame]
sgudz8c888ec2017-10-02 15:29:23 +03001{% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %}
sgudz8c888ec2017-10-02 15:29:23 +03002{% 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 %}
sgudzcced67d2017-10-11 15:56:09 +03005{% set PATTERN = os_env('PATTERN', 'false') %}
6{% set RUN_TEMPEST = os_env('RUN_TEMPEST', 'false') %}
Dennis Dmitriev4034db02018-08-26 21:50:13 +03007
8{% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %}
9
sgudz8c888ec2017-10-02 15:29:23 +030010# Install OpenStack control services
11
sgudz62df2fc2018-10-09 12:26:19 +030012{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE() }}
sgudz8c888ec2017-10-02 15:29:23 +030013
Dennis Dmitriev4034db02018-08-26 21:50:13 +030014{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
sgudz8c888ec2017-10-02 15:29:23 +030015
Dennis Dmitriev4034db02018-08-26 21:50:13 +030016{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
sgudz8c888ec2017-10-02 15:29:23 +030017
sgudze12b5092018-09-15 00:40:10 +030018{{ 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
sgudz8c888ec2017-10-02 15:29:23 +030026
Dennis Dmitriev4034db02018-08-26 21:50:13 +030027{{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON(INSTALL_GATEWAY=false) }}
sgudz8c888ec2017-10-02 15:29:23 +030028
29# install contrail
sgudz868f0862018-03-16 21:47:18 +020030- 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
sgudz8c888ec2017-10-02 15:29:23 +030038 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
sgudz868f0862018-03-16 21:47:18 +020044- description: Install Opencontrail control on ctl01
sgudz8c888ec2017-10-02 15:29:23 +030045 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 }}
sgudzcced67d2017-10-11 15:56:09 +030048 retry: {count: 1, delay: 5}
49 skip_fail: false
50
sgudz868f0862018-03-16 21:47:18 +020051- description: Install Opencontrail control on all nodes
52 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
sgudz8c888ec2017-10-02 15:29:23 +030053 -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client
54 node_name: {{ HOSTNAME_CFG01 }}
sgudz868f0862018-03-16 21:47:18 +020055 retry: {count: 1, delay: 5}
sgudz8c888ec2017-10-02 15:29:23 +030056 skip_fail: false
57
sgudz868f0862018-03-16 21:47:18 +020058- 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
sgudzcced67d2017-10-11 15:56:09 +030061 node_name: {{ HOSTNAME_CFG01 }}
62 retry: {count: 1, delay: 5}
63 skip_fail: false
64
sgudz868f0862018-03-16 21:47:18 +020065- description: Workaround for https://mirantis.jira.com/browse/PROD-12798
sgudz8c888ec2017-10-02 15:29:23 +030066 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
sgudz868f0862018-03-16 21:47:18 +020067 -C 'I@opencontrail:control' service.restart 'keepalived'
sgudz8c888ec2017-10-02 15:29:23 +030068 node_name: {{ HOSTNAME_CFG01 }}
sgudz868f0862018-03-16 21:47:18 +020069 retry: {count: 1, delay: 5}
sgudz8c888ec2017-10-02 15:29:23 +030070 skip_fail: false
71
sgudz868f0862018-03-16 21:47:18 +020072# OpenContrail vrouters
73- description: Install Opencontrail client
sgudz8c888ec2017-10-02 15:29:23 +030074 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
sgudz868f0862018-03-16 21:47:18 +020075 -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'
sgudz8c888ec2017-10-02 15:29:23 +030083 node_name: {{ HOSTNAME_CFG01 }}
sgudzcced67d2017-10-11 15:56:09 +030084 retry: {count: 2, delay: 5}
sgudz8c888ec2017-10-02 15:29:23 +030085 skip_fail: false
86
sgudz868f0862018-03-16 21:47:18 +020087- 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'
sgudz8c888ec2017-10-02 15:29:23 +030097 node_name: {{ HOSTNAME_CFG01 }}
98 retry: {count: 1, delay: 5}
99 skip_fail: false
100
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300101{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
sgudz8c888ec2017-10-02 15:29:23 +0300102
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 Butenko9f2601c2018-02-08 15:13:21 +0200130 skip_fail: false
sgudz8c888ec2017-10-02 15:29:23 +0300131
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 Tyzhnenko30f58042017-11-28 17:00:40 +0200151 '. /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'
sgudz8c888ec2017-10-02 15:29:23 +0300152 node_name: {{ HOSTNAME_CFG01 }}
153 retry: {count: 1, delay: 30}
154 skip_fail: false
155
sgudz8c888ec2017-10-02 15:29:23 +0300156- 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
sgudzcced67d2017-10-11 15:56:09 +0300163- description: Install docker.io on ctl
164 cmd: salt "ctl01*" cmd.run 'apt-get install docker.io -y'
sgudz8c888ec2017-10-02 15:29:23 +0300165 node_name: {{ HOSTNAME_CFG01 }}
166 retry: {count: 1, delay: 30}
167 skip_fail: false
168
Tatyana Leontovichd6bcbc92018-03-23 15:02:28 +0200169- 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
sgudz8c888ec2017-10-02 15:29:23 +0300174
sgudzcced67d2017-10-11 15:56:09 +0300175- 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;"
sgudzcced67d2017-10-11 15:56:09 +0300178 node_name: {{ HOSTNAME_CFG01 }}
179 retry: {count: 1, delay: 5}
180 skip_fail: false
sgudz8c888ec2017-10-02 15:29:23 +0300181
sgudzcced67d2017-10-11 15:56:09 +0300182
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
sgudz2b3dcfa2018-07-18 21:51:38 +0300202 cmd: |
203 salt "cmp*" system.reboot;
204 sleep 600;
sgudzcced67d2017-10-11 15:56:09 +0300205 node_name: {{ HOSTNAME_CFG01 }}
206 retry: {count: 1, delay: 30}
207 skip_fail: true