blob: ec83dc7a2097630b816254f28fab1f2548c24b3a [file] [log] [blame]
sgudz850e6072018-06-05 14:46:53 +03001{% from 'cookied-bm-contrail40/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-bm-contrail40/underlay.yaml' import HOSTNAME_GTW01 with context %}
3{% from 'cookied-bm-contrail40/underlay.yaml' import DOMAIN_NAME with context %}
4{% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %}
5{% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %}
6{% set PATTERN = os_env('PATTERN', 'false') %}
7{% set RUN_TEMPEST = os_env('RUN_TEMPEST', 'false') %}
Dennis Dmitriev4034db02018-08-26 21:50:13 +03008
9{% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %}
10
sgudz850e6072018-06-05 14:46:53 +030011# Install OpenStack control services
12
sgudz62df2fc2018-10-09 12:26:19 +030013{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE() }}
sgudz850e6072018-06-05 14:46:53 +030014
Dennis Dmitriev4034db02018-08-26 21:50:13 +030015{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
sgudz850e6072018-06-05 14:46:53 +030016
Dennis Dmitriev4034db02018-08-26 21:50:13 +030017{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
sgudz850e6072018-06-05 14:46:53 +030018
sgudz6aea2562018-08-22 15:05:37 +030019{{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER(INSTALL_VOLUME=false) }}
20
21- description: WR Install cinder volume
22 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
23 -C 'I@cinder:volume' state.sls cinder
24 node_name: {{ HOSTNAME_CFG01 }}
25 retry: {count: 2, delay: 5}
26 skip_fail: false
sgudz850e6072018-06-05 14:46:53 +030027
Dennis Dmitriev4034db02018-08-26 21:50:13 +030028{{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON(INSTALL_GATEWAY=false) }}
sgudz850e6072018-06-05 14:46:53 +030029
30# install contrail
31- description: Install docker for Opencontrail
32 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
33 -C 'I@opencontrail:database' state.sls docker.host
34 node_name: {{ HOSTNAME_CFG01 }}
35 retry: {count: 1, delay: 20}
36 skip_fail: false
37
38- description: Install Opencontrail requirements
39 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
40 -C 'I@opencontrail:database' state.sls opencontrail exclude=opencontrail.client
41 node_name: {{ HOSTNAME_CFG01 }}
42 retry: {count: 1, delay: 20}
43 skip_fail: false
44
45- description: Spawn Opencontrail docker images
46 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
47 -C 'I@opencontrail:database' state.sls docker.client && sleep 15;
48 node_name: {{ HOSTNAME_CFG01 }}
49 retry: {count: 1, delay: 5}
50 skip_fail: false
51
52- description: Finalize opencontrail services
53 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
54 -C 'I@opencontrail:database and *01*' state.sls opencontrail.client
55 node_name: {{ HOSTNAME_CFG01 }}
56 retry: {count: 3, delay: 30}
57 skip_fail: true
58
sgudz30da28b2018-08-13 22:35:54 +030059- description: Highstate analytics
60 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
61 -C 'nal*' state.sls highstate && sleep 15;
62 node_name: {{ HOSTNAME_CFG01 }}
63 retry: {count: 1, delay: 5}
64 skip_fail: true
65
sgudz850e6072018-06-05 14:46:53 +030066- description: Check contrail status
67 cmd: sleep 15; salt --hard-crash --state-output=mixed --state-verbose=False
68 -C 'I@opencontrail:database' cmd.run 'doctrail all contrail-status'
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.highstate exclude=opencontrail.client
76 node_name: {{ HOSTNAME_CFG01 }}
77 retry: {count: 2, delay: 5}
78 skip_fail: false
79
Dennis Dmitriev4034db02018-08-26 21:50:13 +030080{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
sgudz850e6072018-06-05 14:46:53 +030081
82- description: Deploy horizon dashboard
83 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
84 -C 'I@horizon:server' state.sls horizon
85 node_name: {{ HOSTNAME_CFG01 }}
86 retry: {count: 1, delay: 5}
87 skip_fail: true
88
89- description: Deploy nginx proxy
90 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
91 -C 'I@nginx:server' state.sls nginx
92 node_name: {{ HOSTNAME_CFG01 }}
93 retry: {count: 1, delay: 5}
94 skip_fail: true
95
96
97# Install compute node
98
99- description: Apply formulas for compute node
100 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
101 node_name: {{ HOSTNAME_CFG01 }}
102 retry: {count: 1, delay: 5}
103 skip_fail: true
104
105- description: Check IP on computes
106 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
107 'ip a'
108 node_name: {{ HOSTNAME_CFG01 }}
109 retry: {count: 10, delay: 30}
110 skip_fail: false
111
112
113 # Upload cirros image
114
115- description: Upload cirros image on ctl01
116 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
117 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
118 node_name: {{ HOSTNAME_CFG01 }}
119 retry: {count: 2, delay: 30}
120 skip_fail: false
121
122- description: Register image in glance
123 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
124 '. /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'
125 node_name: {{ HOSTNAME_CFG01 }}
126 retry: {count: 1, delay: 30}
127 skip_fail: false
128
129- description: Create net04
130 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
131 '. /root/keystonercv3; neutron net-create net04'
132 node_name: {{ HOSTNAME_CFG01 }}
133 retry: {count: 1, delay: 30}
134 skip_fail: false
135
136- description: Create subnet_net04
137 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
138 '. /root/keystonercv3; neutron subnet-create net04 192.168.0.0/24 --name net04__subnet'
139 node_name: {{ HOSTNAME_CFG01 }}
140 retry: {count: 1, delay: 30}
141 skip_fail: false
142
143- description: Create router
144 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
145 '. /root/keystonercv3; neutron router-create net04_router01'
146 node_name: {{ HOSTNAME_CFG01 }}
147 retry: {count: 1, delay: 30}
148 skip_fail: false
149
150- description: Add interface
151 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
152 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
153 node_name: {{ HOSTNAME_CFG01 }}
154 retry: {count: 1, delay: 30}
155 skip_fail: false
156
157- description: Allow all
158 cmd: |
159 salt 'ctl01*' cmd.run '. /root/keystonercv3; openstack security group rule create default --egress --protocol tcp';
160 salt 'ctl01*' cmd.run '. /root/keystonercv3; openstack security group rule create default --ingress --protocol tcp';
161 salt 'ctl01*' cmd.run '. /root/keystonercv3; openstack security group rule create default --egress --protocol icmp';
162 salt 'ctl01*' cmd.run '. /root/keystonercv3; openstack security group rule create default --ingress --protocol icmp';
163 node_name: {{ HOSTNAME_CFG01 }}
164 retry: {count: 1, delay: 30}
165 skip_fail: true
166
167- description: sync time
168 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
169 'service ntp stop; ntpd -gq; service ntp start'
170 node_name: {{ HOSTNAME_CFG01 }}
171 retry: {count: 1, delay: 30}
172 skip_fail: false
173
174- description: Install docker.io on ctl
175 cmd: salt "ctl01*" cmd.run 'apt-get install docker.io -y'
176 node_name: {{ HOSTNAME_CFG01 }}
177 retry: {count: 1, delay: 30}
178 skip_fail: false
179
180- description: Enable forward policy
181 cmd: salt "ctl01*" cmd.run 'iptables --policy FORWARD ACCEPT'
182 node_name: {{ HOSTNAME_CFG01 }}
183 retry: {count: 1, delay: 30}
184 skip_fail: false
185
186- description: Hack resolv.conf on VCP nodes for internal services access
187 cmd: |
188 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;"
189 node_name: {{ HOSTNAME_CFG01 }}
190 retry: {count: 1, delay: 5}
191 skip_fail: false
192
193- description: Remove crashes files from /var/crashes/ while vrouter was crashed
194 cmd: salt "cmp*" cmd.run "rm -rf /var/crashes/*"
195 node_name: {{ HOSTNAME_CFG01 }}
196 retry: {count: 1, delay: 30}
197 skip_fail: true
198
199- description: Reboot computes
200 cmd: |
201 salt "cmp*" system.reboot;
202 sleep 600;
203 node_name: {{ HOSTNAME_CFG01 }}
204 retry: {count: 1, delay: 30}
205 skip_fail: true
206
207- description: Finalize contrail
208 cmd: salt -C 'I@opencontrail:compute' state.sls opencontrail.client
209 node_name: {{ HOSTNAME_CFG01 }}
210 retry: {count: 1, delay: 30}
211 skip_fail: false
212
213- description: Check status for contrail services
214 cmd: |
215 sleep 15;
216 salt -C 'I@opencontrail:database' cmd.run 'doctrail all contrail-status'
217 node_name: {{ HOSTNAME_CFG01 }}
218 retry: {count: 1, delay: 30}
219 skip_fail: false
220
221- description: WR for having ability to use hostnames
222 cmd: |
223 CTL01_ADDRESS=`salt --out=newline_values_only 'ctl01*' network.interface_ip ens2`;
224 echo "$CTL01_ADDRESS ctl01.{{ DOMAIN_NAME }} ctl01" >> /etc/hosts;
225 node_name: {{ HOSTNAME_CFG01 }}
226 retry: {count: 1, delay: 30}
227 skip_fail: true