blob: 737e8e026bc711263ef62a56a5391584b5373a99 [file] [log] [blame]
sgudzf5a51222018-05-11 14:20:50 +03001{% from 'cookied-bm-contrail-maas/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'cookied-bm-contrail-maas/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 %}
Dennis Dmitriev4034db02018-08-26 21:50:13 +03005
6{% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %}
7
sgudzf5a51222018-05-11 14:20:50 +03008# Install OpenStack control services
9
Dennis Dmitriev4034db02018-08-26 21:50:13 +030010{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE(USE_ORCHESTRATE=false) }}
sgudzf5a51222018-05-11 14:20:50 +030011
Dennis Dmitriev4034db02018-08-26 21:50:13 +030012{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
sgudzf5a51222018-05-11 14:20:50 +030013
Dennis Dmitriev4034db02018-08-26 21:50:13 +030014{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
sgudzf5a51222018-05-11 14:20:50 +030015
Dennis Dmitriev4034db02018-08-26 21:50:13 +030016{{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER(INSTALL_VOLUME=true) }}
sgudzf5a51222018-05-11 14:20:50 +030017
Dennis Dmitriev4034db02018-08-26 21:50:13 +030018{{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON(INSTALL_GATEWAY=false) }}
sgudzf5a51222018-05-11 14:20:50 +030019
20# install contrail
21- description: Install Opencontrail db on ctl01
22 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
23 -C 'I@opencontrail:database and *01*' state.sls opencontrail.database
24 node_name: {{ HOSTNAME_CFG01 }}
25 retry: {count: 2, delay: 20}
26 skip_fail: false
27
28- description: Install Opencontrail db on all nodes
29 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
30 -C 'I@opencontrail:database' state.sls opencontrail.database
31 node_name: {{ HOSTNAME_CFG01 }}
32 retry: {count: 2, delay: 20}
33 skip_fail: false
34
35- description: Install Opencontrail control on ctl01
36 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
37 -C 'I@opencontrail:control and *01*' state.sls opencontrail exclude=opencontrail.client
38 node_name: {{ HOSTNAME_CFG01 }}
39 retry: {count: 1, delay: 5}
40 skip_fail: false
41
42- description: Install Opencontrail control on all nodes
43 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
44 -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client
45 node_name: {{ HOSTNAME_CFG01 }}
46 retry: {count: 1, delay: 5}
47 skip_fail: false
48
49- description: Install Opencontrail on collector
50 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
51 -C 'I@opencontrail:collector' state.sls opencontrail exclude=opencontrail.client
52 node_name: {{ HOSTNAME_CFG01 }}
53 retry: {count: 1, delay: 5}
54 skip_fail: false
55
56- description: Workaround for https://mirantis.jira.com/browse/PROD-12798
57 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
58 -C 'I@opencontrail:control' service.restart 'keepalived'
59 node_name: {{ HOSTNAME_CFG01 }}
60 retry: {count: 1, delay: 5}
61 skip_fail: false
62
63# OpenContrail vrouters
64- description: Install Opencontrail client
65 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
66 -C 'I@opencontrail:database:id:1' state.sls 'opencontrail.client'
67 node_name: {{ HOSTNAME_CFG01 }}
68 retry: {count: 1, delay: 5}
69 skip_fail: false
70
71- description: Install Opencontrail client on computes
72 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
73 -C 'I@opencontrail:compute' state.sls 'opencontrail.client'
74 node_name: {{ HOSTNAME_CFG01 }}
75 retry: {count: 2, delay: 5}
76 skip_fail: false
77
78- description: Install Opencontrail on computes
79 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
80 -C 'I@opencontrail:compute' state.sls 'opencontrail'
81 node_name: {{ HOSTNAME_CFG01 }}
82 retry: {count: 2, delay: 5}
83 skip_fail: false
84
85- description: Test Opencontrail
86 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
87 -C 'I@opencontrail:control' cmd.run 'contrail-status'
88 node_name: {{ HOSTNAME_CFG01 }}
89 retry: {count: 1, delay: 5}
90 skip_fail: false
91
Dennis Dmitriev4034db02018-08-26 21:50:13 +030092{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
sgudzf5a51222018-05-11 14:20:50 +030093
94- description: Deploy horizon dashboard
95 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
96 -C 'I@horizon:server' state.sls horizon
97 node_name: {{ HOSTNAME_CFG01 }}
98 retry: {count: 1, delay: 5}
99 skip_fail: true
100
101- description: Deploy nginx proxy
102 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
103 -C 'I@nginx:server' state.sls nginx
104 node_name: {{ HOSTNAME_CFG01 }}
105 retry: {count: 1, delay: 5}
106 skip_fail: true
107
108
109# Install compute node
110
111- description: Apply formulas for compute node
112 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
113 node_name: {{ HOSTNAME_CFG01 }}
114 retry: {count: 1, delay: 5}
115 skip_fail: true
116
117- description: Re-apply(as in doc) formulas for compute node
118 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
119 node_name: {{ HOSTNAME_CFG01 }}
120 retry: {count: 1, delay: 5}
121 skip_fail: false
122
123- description: Check IP on computes
124 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
125 'ip a'
126 node_name: {{ HOSTNAME_CFG01 }}
127 retry: {count: 10, delay: 30}
128 skip_fail: false
129
130
131 # Upload cirros image
132
133- description: Upload cirros image on ctl01
134 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
135 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
136 node_name: {{ HOSTNAME_CFG01 }}
137 retry: {count: 2, delay: 30}
138 skip_fail: false
139
140- description: Register image in glance
141 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
142 '. /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'
143 node_name: {{ HOSTNAME_CFG01 }}
144 retry: {count: 1, delay: 30}
145 skip_fail: false
146
147- description: sync time
148 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
149 'service ntp stop; ntpd -gq; service ntp start'
150 node_name: {{ HOSTNAME_CFG01 }}
151 retry: {count: 1, delay: 30}
152 skip_fail: false
153
154- description: Install docker.io on ctl
155 cmd: salt "ctl01*" cmd.run 'apt-get install docker.io -y'
156 node_name: {{ HOSTNAME_CFG01 }}
157 retry: {count: 1, delay: 30}
158 skip_fail: false
159
160- description: Enable forward policy
161 cmd: salt "ctl01*" cmd.run 'iptables --policy FORWARD ACCEPT'
162 node_name: {{ HOSTNAME_CFG01 }}
163 retry: {count: 1, delay: 30}
164 skip_fail: false
165
166- description: Hack vrouter (Delete default moun point)
167 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"
168 node_name: {{ HOSTNAME_CFG01 }}
169 retry: {count: 1, delay: 30}
170 skip_fail: true
171
172- description: Temporary WR for correct pci in vrouter.conf
173 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"
174 node_name: {{ HOSTNAME_CFG01 }}
175 retry: {count: 1, delay: 30}
176 skip_fail: true
177
178- description: Remove crashes files from /var/crashes/ while vrouter was crashed
179 cmd: salt "cmp*" cmd.run "rm -rf /var/crashes/*"
180 node_name: {{ HOSTNAME_CFG01 }}
181 retry: {count: 1, delay: 30}
182 skip_fail: true
183
184- description: Reboot computes
185 cmd: salt --timeout=600 "cmp*" system.reboot
186 node_name: {{ HOSTNAME_CFG01 }}
187 retry: {count: 1, delay: 30}
188 skip_fail: true