blob: 25fd59f181b81e8467a4470a8a4557c9fda4efba [file] [log] [blame]
Tatyana Leontovich3c316a12018-01-31 12:42:22 +02001{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_CFG01 with context %}
2{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_CTL01 with context %}
3{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_CTL02 with context %}
4{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_CTL03 with context %}
5{% from 'virtual-offline-pike-ovs/underlay.yaml' import HOSTNAME_GTW01 with context %}
Tatyana Leontovich0eb5ca32018-07-13 22:05:17 +03006{% from 'virtual-offline-pike-ovs/underlay.yaml' import LAB_CONFIG_NAME with context %}
Tatyana Leontovich3c316a12018-01-31 12:42:22 +02007{% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %}
8{% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %}
Tatyana Leontovich4436f492018-03-21 21:45:31 +02009{% set REPOSITORY_SUITE = os_env('REPOSITORY_SUITE', 'testing') %}
Tatyana Leontovich0eb5ca32018-07-13 22:05:17 +030010{% set DOMAIN_NAME = os_env('DOMAIN_NAME', 'virtual-offline-pike-ovs') %}
11{% import 'shared-backup-restore.yaml' as BACKUP with context %}
12{% import 'shared-salt.yaml' as SHARED with context %}
Dennis Dmitriev4034db02018-08-26 21:50:13 +030013{% import 'shared-openstack.yaml' as SHARED_OPENSTACK with context %}
Tatyana Leontovich0eb5ca32018-07-13 22:05:17 +030014{% set DOCKER_LOCAL_REPO = os_env('DOCKER_LOCAL_REPO', 'deb [arch=amd64] http://mirror.mcp.mirantis.local.test/ubuntu-xenial/docker ' + REPOSITORY_SUITE + ' stable') %}
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020015# Install OpenStack control services
16
sgudz62df2fc2018-10-09 12:26:19 +030017{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE() }}
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020018
Dennis Dmitriev4034db02018-08-26 21:50:13 +030019{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020020
Dennis Dmitriev4034db02018-08-26 21:50:13 +030021{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020022
Dennis Dmitriev4034db02018-08-26 21:50:13 +030023{{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }}
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020024
Dennis Dmitriev4034db02018-08-26 21:50:13 +030025{{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }}
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020026
Tatyana Leontoviche98062a2018-02-27 12:34:44 +020027- description: Install bind if pillars 'bind:server' exists on any server
28 cmd: |
29 if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@bind:server' match.pillar 'bind:server' ; then
30 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@bind:server' state.sls bind;
31 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@designate:server' state.sls designate -b 1
32 fi
33 node_name: {{ HOSTNAME_CFG01 }}
34 retry: {count: 1, delay: 10}
35 skip_fail: false
36
Dennis Dmitriev4034db02018-08-26 21:50:13 +030037{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020038
39- description: Deploy horizon dashboard
40 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
41 -C 'I@horizon:server' state.sls horizon
42 node_name: {{ HOSTNAME_CFG01 }}
43 retry: {count: 1, delay: 5}
44 skip_fail: true
45
46- description: Deploy nginx proxy
47 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
48 -C 'I@nginx:server' state.sls nginx
49 node_name: {{ HOSTNAME_CFG01 }}
50 retry: {count: 1, delay: 5}
51 skip_fail: true
52
53
54# Install compute node
55
56- description: Apply formulas for compute node
57 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
58 node_name: {{ HOSTNAME_CFG01 }}
59 retry: {count: 1, delay: 5}
60 skip_fail: true
61
62- description: Re-apply(as in doc) formulas for compute node
63 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
64 node_name: {{ HOSTNAME_CFG01 }}
65 retry: {count: 1, delay: 5}
Oleksii Butenko9f2601c2018-02-08 15:13:21 +020066 skip_fail: false
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020067
68- description: Check IP on computes
69 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
70 'ip a'
71 node_name: {{ HOSTNAME_CFG01 }}
72 retry: {count: 10, delay: 30}
73 skip_fail: false
74
75
76 # Upload cirros image
77# Configure cinder-volume salt-call
78- description: Set disks 01
79 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
80 node_name: {{ HOSTNAME_CTL01 }}
81 retry: {count: 1, delay: 30}
82 skip_fail: false
83
84- description: Set disks 02
85 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
86 node_name: {{ HOSTNAME_CTL02 }}
87 retry: {count: 1, delay: 30}
88 skip_fail: false
89
90- description: Set disks 03
91 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
92 node_name: {{ HOSTNAME_CTL03 }}
93 retry: {count: 1, delay: 30}
94 skip_fail: false
95
96- description: Create partitions 01
97 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
98 node_name: {{ HOSTNAME_CTL01 }}
99 retry: {count: 1, delay: 30}
100 skip_fail: false
101
102- description: Create partitions 02
103 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
104 node_name: {{ HOSTNAME_CTL02 }}
105 retry: {count: 1, delay: 30}
106 skip_fail: false
107
108- description: Create partitions 03
109 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
110 node_name: {{ HOSTNAME_CTL03 }}
111 retry: {count: 1, delay: 30}
112 skip_fail: false
113
114- description: create volume_group
115 cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
116 node_name: {{ HOSTNAME_CFG01 }}
117 retry: {count: 1, delay: 30}
118 skip_fail: false
119
120- description: Install cinder-volume
121 cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
122 node_name: {{ HOSTNAME_CFG01 }}
123 retry: {count: 1, delay: 30}
124 skip_fail: false
125
126- description: Install crudini
127 cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
128 node_name: {{ HOSTNAME_CFG01 }}
129 retry: {count: 1, delay: 30}
130 skip_fail: false
131
132- description: Temporary WR set enabled backends value 01
133 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
134 node_name: {{ HOSTNAME_CTL01 }}
135 retry: {count: 1, delay: 30}
136 skip_fail: false
137
138- description: Temporary WR set enabled backends value 02
139 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
140 node_name: {{ HOSTNAME_CTL02 }}
141 retry: {count: 1, delay: 30}
142 skip_fail: false
143
144- description: Temporary WR set enabled backends value 03
145 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
146 node_name: {{ HOSTNAME_CTL03 }}
147 retry: {count: 1, delay: 30}
148 skip_fail: false
149
150- description: Restart cinder volume
151 cmd: |
152 salt -C 'I@cinder:controller' service.restart cinder-volume;
153 node_name: {{ HOSTNAME_CFG01 }}
154 retry: {count: 2, delay: 5}
155 skip_fail: false
156
157- description: Upload cirros image on ctl01
158 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
159 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
160 node_name: {{ HOSTNAME_CFG01 }}
161 retry: {count: 2, delay: 30}
162 skip_fail: false
163
164- description: Create net04_external
165 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
166 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
167 node_name: {{ HOSTNAME_CFG01 }}
168 retry: {count: 1, delay: 30}
169 skip_fail: false
170
171- description: Create subnet_external
172 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
173 '. /root/keystonercv3; neutron subnet-create net04_ext {{ IPV4_NET_EXTERNAL_PREFIX }}.0/24 --name net04_ext__subnet --disable-dhcp --allocation-pool start={{ IPV4_NET_EXTERNAL_PREFIX }}.150,end={{ IPV4_NET_EXTERNAL_PREFIX }}.180 --gateway {{ IPV4_NET_EXTERNAL_PREFIX }}.1'
174 node_name: {{ HOSTNAME_CFG01 }}
175 retry: {count: 1, delay: 30}
176 skip_fail: false
177
178- description: Create net04
179 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
180 '. /root/keystonercv3; neutron net-create net04'
181 node_name: {{ HOSTNAME_CFG01 }}
182 retry: {count: 1, delay: 30}
183 skip_fail: false
184
185- description: Create subnet_net04
186 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
187 '. /root/keystonercv3; neutron subnet-create net04 {{ IPV4_NET_TENANT_PREFIX }}.0/24 --name net04__subnet --allocation-pool start={{ IPV4_NET_TENANT_PREFIX }}.120,end={{ IPV4_NET_TENANT_PREFIX }}.240'
188 node_name: {{ HOSTNAME_CFG01 }}
189 retry: {count: 1, delay: 30}
190 skip_fail: false
191
192- description: Create router
193 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
194 '. /root/keystonercv3; neutron router-create net04_router01'
195 node_name: {{ HOSTNAME_CFG01 }}
196 retry: {count: 1, delay: 30}
197 skip_fail: false
198
199- description: Set geteway
200 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
201 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
202 node_name: {{ HOSTNAME_CFG01 }}
203 retry: {count: 1, delay: 30}
204 skip_fail: false
205
206- description: Add interface
207 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
208 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
209 node_name: {{ HOSTNAME_CFG01 }}
210 retry: {count: 1, delay: 30}
211 skip_fail: false
212
213- description: sync time
214 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
215 'service ntp stop; ntpd -gq; service ntp start'
216 node_name: {{ HOSTNAME_CFG01 }}
217 retry: {count: 1, delay: 30}
218 skip_fail: false
219
Tatyana Leontovich4436f492018-03-21 21:45:31 +0200220- description: Enable local docker repo
221 cmd: |
222 set -e;
223 echo "{{ DOCKER_LOCAL_REPO }}" > /etc/apt/sources.list.d/mcp_docker.list;
224 apt-get clean; apt-get update;
225 node_name: {{ HOSTNAME_GTW01 }}
226 retry: {count: 1, delay: 30}
227 skip_fail: false
228
229- description: Install docker-ce on gtw
230 cmd: salt-call cmd.run 'apt-get install docker-ce -y'
Tatyana Leontovich3c316a12018-01-31 12:42:22 +0200231 node_name: {{ HOSTNAME_GTW01 }}
232 retry: {count: 1, delay: 30}
233 skip_fail: false
234
Tatyana Leontovichd6bcbc92018-03-23 15:02:28 +0200235- description: Enable forward policy on gtw
236 cmd: |
237 set -e;
238 iptables --policy FORWARD ACCEPT;
239 node_name: {{ HOSTNAME_GTW01 }}
240 retry: {count: 1, delay: 30}
241 skip_fail: false
242
Tatyana Leontovich3c316a12018-01-31 12:42:22 +0200243- description: create rc file on cfg
244 cmd: scp ctl01:/root/keystonercv3 /root
245 node_name: {{ HOSTNAME_CFG01 }}
246 retry: {count: 1, delay: 30}
247 skip_fail: false
248
249- description: Copy rc file
250 cmd: scp /root/keystonercv3 gtw01:/root
251 node_name: {{ HOSTNAME_CFG01 }}
252 retry: {count: 1, delay: 30}
253 skip_fail: false