blob: 089a2559cd1dbce5b911e21d0b887379495aef93 [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
Dennis Dmitriev4034db02018-08-26 21:50:13 +030012{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE(USE_ORCHESTRATE=false) }}
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
Dennis Dmitriev4034db02018-08-26 21:50:13 +030018{{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER(INSTALL_VOLUME=true) }}
sgudzd7f8ec92018-04-19 16:22:47 +030019
Dennis Dmitriev4034db02018-08-26 21:50:13 +030020{{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON(INSTALL_GATEWAY=false) }}
sgudzd7f8ec92018-04-19 16:22:47 +030021
22# install contrail
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
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
37- description: Install Opencontrail control on ctl01
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 }}
41 retry: {count: 1, delay: 5}
42 skip_fail: false
43
44- description: Install Opencontrail control on all nodes
45 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
46 -C 'I@opencontrail:control' 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 on collector
52 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
53 -C 'I@opencontrail:collector' state.sls opencontrail exclude=opencontrail.client
54 node_name: {{ HOSTNAME_CFG01 }}
55 retry: {count: 1, delay: 5}
56 skip_fail: false
57
58- description: Workaround for https://mirantis.jira.com/browse/PROD-12798
59 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
60 -C 'I@opencontrail:control' service.restart 'keepalived'
61 node_name: {{ HOSTNAME_CFG01 }}
62 retry: {count: 1, delay: 5}
63 skip_fail: false
64
65# OpenContrail vrouters
66- description: Install Opencontrail client
67 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
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'
76 node_name: {{ HOSTNAME_CFG01 }}
77 retry: {count: 2, delay: 5}
78 skip_fail: false
79
80# The next four steps should be converted to one (state.sls opencontrail) with skip_fail: false
81# It is related to bug with hugepages. So we need to add WR, then reboot
82# for only 1G hugepages were mounted. Then re-apply state
83- description: Install Opencontrail on computes
84 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
85 -C 'I@opencontrail:compute' state.sls 'opencontrail'
86 node_name: {{ HOSTNAME_CFG01 }}
87 retry: {count: 1, delay: 5}
88 skip_fail: true
89
90- description: Hack vrouter (Delete default moun point)
91 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"
92 node_name: {{ HOSTNAME_CFG01 }}
93 retry: {count: 1, delay: 30}
94 skip_fail: true
95
96- description: Reboot computes
97 cmd: salt --timeout=600 "cmp*" system.reboot
98 node_name: {{ HOSTNAME_CFG01 }}
99 retry: {count: 1, delay: 30}
100 skip_fail: true
101
102- description: Install Opencontrail on computes
103 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
104 -C 'I@opencontrail:compute' state.sls 'opencontrail'
105 node_name: {{ HOSTNAME_CFG01 }}
106 retry: {count: 2, delay: 5}
107 skip_fail: false
108
109- description: Remove crashes files from /var/crashes/ while vrouter was crashed
110 cmd: salt "cmp*" cmd.run "rm -rf /var/crashes/*"
111 node_name: {{ HOSTNAME_CFG01 }}
112 retry: {count: 1, delay: 30}
113 skip_fail: true
114
115- description: Test Opencontrail
116 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
117 -C 'I@opencontrail:control' cmd.run 'contrail-status'
118 node_name: {{ HOSTNAME_CFG01 }}
119 retry: {count: 1, delay: 5}
120 skip_fail: false
121
Dennis Dmitriev4034db02018-08-26 21:50:13 +0300122{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
sgudzd7f8ec92018-04-19 16:22:47 +0300123
124- description: Deploy horizon dashboard
125 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
126 -C 'I@horizon:server' state.sls horizon
127 node_name: {{ HOSTNAME_CFG01 }}
128 retry: {count: 1, delay: 5}
129 skip_fail: true
130
131- description: Deploy nginx proxy
132 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
133 -C 'I@nginx:server' state.sls nginx
134 node_name: {{ HOSTNAME_CFG01 }}
135 retry: {count: 1, delay: 5}
136 skip_fail: true
137
138# Install compute node
139- description: Apply formulas for compute node
140 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
141 node_name: {{ HOSTNAME_CFG01 }}
142 retry: {count: 1, delay: 5}
143 skip_fail: true
144
145- description: Re-apply(as in doc) formulas for compute node
146 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
147 node_name: {{ HOSTNAME_CFG01 }}
148 retry: {count: 1, delay: 5}
149 skip_fail: false
150
151- description: Check IP on computes
152 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
153 'ip a'
154 node_name: {{ HOSTNAME_CFG01 }}
155 retry: {count: 10, delay: 30}
156 skip_fail: false
157
158 # Upload cirros image
159- description: Upload cirros image on ctl01
160 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
161 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
162 node_name: {{ HOSTNAME_CFG01 }}
163 retry: {count: 2, delay: 30}
164 skip_fail: false
165
166- description: Register image in glance
167 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
168 '. /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'
169 node_name: {{ HOSTNAME_CFG01 }}
170 retry: {count: 1, delay: 30}
171 skip_fail: false
172
173- description: sync time
174 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
175 'service ntp stop; ntpd -gq; service ntp start'
176 node_name: {{ HOSTNAME_CFG01 }}
177 retry: {count: 1, delay: 30}
178 skip_fail: false
179
180- description: Install docker.io on ctl
181 cmd: salt "ctl01*" cmd.run 'apt-get install docker.io -y'
182 node_name: {{ HOSTNAME_CFG01 }}
183 retry: {count: 1, delay: 30}
184 skip_fail: false
185
186- description: Enable forward policy
187 cmd: salt "ctl01*" cmd.run 'iptables --policy FORWARD ACCEPT'
188 node_name: {{ HOSTNAME_CFG01 }}
189 retry: {count: 1, delay: 30}
190 skip_fail: false
191
192- description: Hack resolv.conf on VCP nodes for internal services access
193 cmd: |
194 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;"
195 node_name: {{ HOSTNAME_CFG01 }}
196 retry: {count: 1, delay: 5}
197 skip_fail: false
198
199- description: Reboot computes
sgudz2b3dcfa2018-07-18 21:51:38 +0300200 cmd: |
201 salt "cmp*" system.reboot;
202 sleep 600;
sgudzd7f8ec92018-04-19 16:22:47 +0300203 node_name: {{ HOSTNAME_CFG01 }}
204 retry: {count: 1, delay: 30}
205 skip_fail: true