blob: d97665ea74b54feba358c434677e2fffaae3d0b2 [file] [log] [blame]
sgudzd7f8ec92018-04-19 16:22:47 +03001{% 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 Dmitriev4034db02018-08-26 21:50:13 +03007
8{% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %}
9
sgudzd7f8ec92018-04-19 16:22:47 +030010# Install OpenStack control services
11
sgudz62df2fc2018-10-09 12:26:19 +030012{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE() }}
sgudzd7f8ec92018-04-19 16:22:47 +030013
Dennis Dmitriev4034db02018-08-26 21:50:13 +030014{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
sgudzd7f8ec92018-04-19 16:22:47 +030015
Dennis Dmitriev4034db02018-08-26 21:50:13 +030016{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
sgudzd7f8ec92018-04-19 16:22:47 +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
sgudzd7f8ec92018-04-19 16:22:47 +030026
Dennis Dmitriev4034db02018-08-26 21:50:13 +030027{{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON(INSTALL_GATEWAY=false) }}
sgudzd7f8ec92018-04-19 16:22:47 +030028
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 Dmitriev4034db02018-08-26 21:50:13 +0300129{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
sgudzd7f8ec92018-04-19 16:22:47 +0300130
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
sgudz2b3dcfa2018-07-18 21:51:38 +0300207 cmd: |
208 salt "cmp*" system.reboot;
209 sleep 600;
sgudzd7f8ec92018-04-19 16:22:47 +0300210 node_name: {{ HOSTNAME_CFG01 }}
211 retry: {count: 1, delay: 30}
212 skip_fail: true