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