blob: 013fb29a3565b83758944eee5d0d149e7b95fdcf [file] [log] [blame]
sgudz8c888ec2017-10-02 15:29:23 +03001{% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %}
sgudz8c888ec2017-10-02 15:29:23 +03002{% from 'cookied-bm-mcp-ocata-contrail/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 %}
sgudzcced67d2017-10-11 15:56:09 +03005{% 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
sgudz8c888ec2017-10-02 15:29:23 +030010# Install OpenStack control services
11
Dennis Dmitriev4034db02018-08-26 21:50:13 +030012{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE(USE_ORCHESTRATE=false) }}
sgudz8c888ec2017-10-02 15:29:23 +030013
Dennis Dmitriev4034db02018-08-26 21:50:13 +030014{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
sgudz8c888ec2017-10-02 15:29:23 +030015
Dennis Dmitriev4034db02018-08-26 21:50:13 +030016{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
sgudz8c888ec2017-10-02 15:29:23 +030017
Dennis Dmitriev4034db02018-08-26 21:50:13 +030018{{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER(INSTALL_VOLUME=true) }}
sgudz8c888ec2017-10-02 15:29:23 +030019
Dennis Dmitriev4034db02018-08-26 21:50:13 +030020{{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON(INSTALL_GATEWAY=false) }}
sgudz8c888ec2017-10-02 15:29:23 +030021
22# install contrail
sgudz868f0862018-03-16 21:47:18 +020023- 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
sgudz8c888ec2017-10-02 15:29:23 +030031 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
sgudz868f0862018-03-16 21:47:18 +020037- description: Install Opencontrail control on ctl01
sgudz8c888ec2017-10-02 15:29:23 +030038 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 }}
sgudzcced67d2017-10-11 15:56:09 +030041 retry: {count: 1, delay: 5}
42 skip_fail: false
43
sgudz868f0862018-03-16 21:47:18 +020044- description: Install Opencontrail control on all nodes
45 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
sgudz8c888ec2017-10-02 15:29:23 +030046 -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client
47 node_name: {{ HOSTNAME_CFG01 }}
sgudz868f0862018-03-16 21:47:18 +020048 retry: {count: 1, delay: 5}
sgudz8c888ec2017-10-02 15:29:23 +030049 skip_fail: false
50
sgudz868f0862018-03-16 21:47:18 +020051- 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
sgudzcced67d2017-10-11 15:56:09 +030054 node_name: {{ HOSTNAME_CFG01 }}
55 retry: {count: 1, delay: 5}
56 skip_fail: false
57
sgudz868f0862018-03-16 21:47:18 +020058- description: Workaround for https://mirantis.jira.com/browse/PROD-12798
sgudz8c888ec2017-10-02 15:29:23 +030059 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
sgudz868f0862018-03-16 21:47:18 +020060 -C 'I@opencontrail:control' service.restart 'keepalived'
sgudz8c888ec2017-10-02 15:29:23 +030061 node_name: {{ HOSTNAME_CFG01 }}
sgudz868f0862018-03-16 21:47:18 +020062 retry: {count: 1, delay: 5}
sgudz8c888ec2017-10-02 15:29:23 +030063 skip_fail: false
64
sgudz868f0862018-03-16 21:47:18 +020065# OpenContrail vrouters
66- description: Install Opencontrail client
sgudz8c888ec2017-10-02 15:29:23 +030067 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
sgudz868f0862018-03-16 21:47:18 +020068 -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'
sgudz8c888ec2017-10-02 15:29:23 +030076 node_name: {{ HOSTNAME_CFG01 }}
sgudzcced67d2017-10-11 15:56:09 +030077 retry: {count: 2, delay: 5}
sgudz8c888ec2017-10-02 15:29:23 +030078 skip_fail: false
79
sgudz868f0862018-03-16 21:47:18 +020080- description: Install Opencontrail on computes
81 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
82 -C 'I@opencontrail:compute' state.sls 'opencontrail'
83 node_name: {{ HOSTNAME_CFG01 }}
84 retry: {count: 2, delay: 5}
85 skip_fail: false
86
87- description: Test Opencontrail
88 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
89 -C 'I@opencontrail:control' cmd.run 'contrail-status'
sgudz8c888ec2017-10-02 15:29:23 +030090 node_name: {{ HOSTNAME_CFG01 }}
91 retry: {count: 1, delay: 5}
92 skip_fail: false
93
Dennis Dmitriev4034db02018-08-26 21:50:13 +030094{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
sgudz8c888ec2017-10-02 15:29:23 +030095
96- description: Deploy horizon dashboard
97 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
98 -C 'I@horizon:server' state.sls horizon
99 node_name: {{ HOSTNAME_CFG01 }}
100 retry: {count: 1, delay: 5}
101 skip_fail: true
102
103- description: Deploy nginx proxy
104 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
105 -C 'I@nginx:server' state.sls nginx
106 node_name: {{ HOSTNAME_CFG01 }}
107 retry: {count: 1, delay: 5}
108 skip_fail: true
109
110
111# Install compute node
112
113- description: Apply formulas for compute node
114 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
115 node_name: {{ HOSTNAME_CFG01 }}
116 retry: {count: 1, delay: 5}
117 skip_fail: true
118
119- description: Re-apply(as in doc) formulas for compute node
120 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
121 node_name: {{ HOSTNAME_CFG01 }}
122 retry: {count: 1, delay: 5}
Oleksii Butenko9f2601c2018-02-08 15:13:21 +0200123 skip_fail: false
sgudz8c888ec2017-10-02 15:29:23 +0300124
125- description: Check IP on computes
126 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
127 'ip a'
128 node_name: {{ HOSTNAME_CFG01 }}
129 retry: {count: 10, delay: 30}
130 skip_fail: false
131
132
133 # Upload cirros image
134
135- description: Upload cirros image on ctl01
136 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
137 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
138 node_name: {{ HOSTNAME_CFG01 }}
139 retry: {count: 2, delay: 30}
140 skip_fail: false
141
142- description: Register image in glance
143 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
Dmitry Tyzhnenko30f58042017-11-28 17:00:40 +0200144 '. /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'
sgudz8c888ec2017-10-02 15:29:23 +0300145 node_name: {{ HOSTNAME_CFG01 }}
146 retry: {count: 1, delay: 30}
147 skip_fail: false
148
sgudz8c888ec2017-10-02 15:29:23 +0300149- description: sync time
150 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
151 'service ntp stop; ntpd -gq; service ntp start'
152 node_name: {{ HOSTNAME_CFG01 }}
153 retry: {count: 1, delay: 30}
154 skip_fail: false
155
sgudzcced67d2017-10-11 15:56:09 +0300156- description: Install docker.io on ctl
157 cmd: salt "ctl01*" cmd.run 'apt-get install docker.io -y'
sgudz8c888ec2017-10-02 15:29:23 +0300158 node_name: {{ HOSTNAME_CFG01 }}
159 retry: {count: 1, delay: 30}
160 skip_fail: false
161
Tatyana Leontovichd6bcbc92018-03-23 15:02:28 +0200162- description: Enable forward policy
163 cmd: salt "ctl01*" cmd.run 'iptables --policy FORWARD ACCEPT'
164 node_name: {{ HOSTNAME_CFG01 }}
165 retry: {count: 1, delay: 30}
166 skip_fail: false
sgudz8c888ec2017-10-02 15:29:23 +0300167
sgudzcced67d2017-10-11 15:56:09 +0300168- description: Hack resolv.conf on VCP nodes for internal services access
169 cmd: |
170 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;"
sgudzcced67d2017-10-11 15:56:09 +0300171 node_name: {{ HOSTNAME_CFG01 }}
172 retry: {count: 1, delay: 5}
173 skip_fail: false
sgudz8c888ec2017-10-02 15:29:23 +0300174
sgudzcced67d2017-10-11 15:56:09 +0300175
176- description: Hack vrouter (Delete default moun point)
177 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"
178 node_name: {{ HOSTNAME_CFG01 }}
179 retry: {count: 1, delay: 30}
180 skip_fail: true
181
182- description: Temporary WR for correct pci in vrouter.conf
183 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"
184 node_name: {{ HOSTNAME_CFG01 }}
185 retry: {count: 1, delay: 30}
186 skip_fail: true
187
188- description: Remove crashes files from /var/crashes/ while vrouter was crashed
189 cmd: salt "cmp*" cmd.run "rm -rf /var/crashes/*"
190 node_name: {{ HOSTNAME_CFG01 }}
191 retry: {count: 1, delay: 30}
192 skip_fail: true
193
194- description: Reboot computes
sgudz2b3dcfa2018-07-18 21:51:38 +0300195 cmd: |
196 salt "cmp*" system.reboot;
197 sleep 600;
sgudzcced67d2017-10-11 15:56:09 +0300198 node_name: {{ HOSTNAME_CFG01 }}
199 retry: {count: 1, delay: 30}
200 skip_fail: true