blob: ed312b8b5f68d8f1804ab58525b83c03e103dd89 [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 Leontovicheae32052018-10-24 22:28:18 +03009{% set REPOSITORY_SUITE = os_env('REPOSITORY_SUITE', 'proposed') %}
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 Leontovicheae32052018-10-24 22:28:18 +030014{% set DOCKER_LOCAL_REPO = os_env('DOCKER_LOCAL_REPO', 'deb [arch=amd64] http://mirror.mcp.mirantis.local.test/' + REPOSITORY_SUITE + '/docker/xenial xenial stable') %}
15
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020016# Install OpenStack control services
17
sgudz62df2fc2018-10-09 12:26:19 +030018{{ SHARED_OPENSTACK.MACRO_INSTALL_KEYSTONE() }}
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020019
Dennis Dmitriev4034db02018-08-26 21:50:13 +030020{{ SHARED_OPENSTACK.MACRO_INSTALL_GLANCE() }}
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020021
Dennis Dmitriev4034db02018-08-26 21:50:13 +030022{{ SHARED_OPENSTACK.MACRO_INSTALL_NOVA() }}
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020023
Dennis Dmitriev4034db02018-08-26 21:50:13 +030024{{ SHARED_OPENSTACK.MACRO_INSTALL_CINDER() }}
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020025
Dennis Dmitriev4034db02018-08-26 21:50:13 +030026{{ SHARED_OPENSTACK.MACRO_INSTALL_NEUTRON() }}
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020027
Tatyana Leontoviche98062a2018-02-27 12:34:44 +020028- description: Install bind if pillars 'bind:server' exists on any server
29 cmd: |
30 if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@bind:server' match.pillar 'bind:server' ; then
31 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@bind:server' state.sls bind;
32 salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@designate:server' state.sls designate -b 1
33 fi
34 node_name: {{ HOSTNAME_CFG01 }}
35 retry: {count: 1, delay: 10}
36 skip_fail: false
37
Dennis Dmitriev4034db02018-08-26 21:50:13 +030038{{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020039
40- description: Deploy horizon dashboard
41 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
42 -C 'I@horizon:server' state.sls horizon
43 node_name: {{ HOSTNAME_CFG01 }}
44 retry: {count: 1, delay: 5}
45 skip_fail: true
46
47- description: Deploy nginx proxy
48 cmd: salt --hard-crash --state-output=mixed --state-verbose=False
49 -C 'I@nginx:server' state.sls nginx
50 node_name: {{ HOSTNAME_CFG01 }}
51 retry: {count: 1, delay: 5}
52 skip_fail: true
53
54
55# Install compute node
56
57- description: Apply formulas for compute node
58 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
59 node_name: {{ HOSTNAME_CFG01 }}
60 retry: {count: 1, delay: 5}
61 skip_fail: true
62
63- description: Re-apply(as in doc) formulas for compute node
64 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.apply
65 node_name: {{ HOSTNAME_CFG01 }}
66 retry: {count: 1, delay: 5}
Oleksii Butenko9f2601c2018-02-08 15:13:21 +020067 skip_fail: false
Tatyana Leontovich3c316a12018-01-31 12:42:22 +020068
69- description: Check IP on computes
70 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' cmd.run
71 'ip a'
72 node_name: {{ HOSTNAME_CFG01 }}
73 retry: {count: 10, delay: 30}
74 skip_fail: false
75
76
77 # Upload cirros image
78# Configure cinder-volume salt-call
79- description: Set disks 01
80 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
81 node_name: {{ HOSTNAME_CTL01 }}
82 retry: {count: 1, delay: 30}
83 skip_fail: false
84
85- description: Set disks 02
86 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
87 node_name: {{ HOSTNAME_CTL02 }}
88 retry: {count: 1, delay: 30}
89 skip_fail: false
90
91- description: Set disks 03
92 cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
93 node_name: {{ HOSTNAME_CTL03 }}
94 retry: {count: 1, delay: 30}
95 skip_fail: false
96
97- description: Create partitions 01
98 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
99 node_name: {{ HOSTNAME_CTL01 }}
100 retry: {count: 1, delay: 30}
101 skip_fail: false
102
103- description: Create partitions 02
104 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
105 node_name: {{ HOSTNAME_CTL02 }}
106 retry: {count: 1, delay: 30}
107 skip_fail: false
108
109- description: Create partitions 03
110 cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
111 node_name: {{ HOSTNAME_CTL03 }}
112 retry: {count: 1, delay: 30}
113 skip_fail: false
114
115- description: create volume_group
116 cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
117 node_name: {{ HOSTNAME_CFG01 }}
118 retry: {count: 1, delay: 30}
119 skip_fail: false
120
121- description: Install cinder-volume
122 cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
123 node_name: {{ HOSTNAME_CFG01 }}
124 retry: {count: 1, delay: 30}
125 skip_fail: false
126
127- description: Install crudini
128 cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
129 node_name: {{ HOSTNAME_CFG01 }}
130 retry: {count: 1, delay: 30}
131 skip_fail: false
132
133- description: Temporary WR set enabled backends value 01
134 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
135 node_name: {{ HOSTNAME_CTL01 }}
136 retry: {count: 1, delay: 30}
137 skip_fail: false
138
139- description: Temporary WR set enabled backends value 02
140 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
141 node_name: {{ HOSTNAME_CTL02 }}
142 retry: {count: 1, delay: 30}
143 skip_fail: false
144
145- description: Temporary WR set enabled backends value 03
146 cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
147 node_name: {{ HOSTNAME_CTL03 }}
148 retry: {count: 1, delay: 30}
149 skip_fail: false
150
151- description: Restart cinder volume
152 cmd: |
153 salt -C 'I@cinder:controller' service.restart cinder-volume;
154 node_name: {{ HOSTNAME_CFG01 }}
155 retry: {count: 2, delay: 5}
156 skip_fail: false
157
158- description: Upload cirros image on ctl01
159 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
160 'wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-i386-disk.img'
161 node_name: {{ HOSTNAME_CFG01 }}
162 retry: {count: 2, delay: 30}
163 skip_fail: false
164
165- description: Create net04_external
166 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
167 '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
168 node_name: {{ HOSTNAME_CFG01 }}
169 retry: {count: 1, delay: 30}
170 skip_fail: false
171
172- description: Create subnet_external
173 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
174 '. /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'
175 node_name: {{ HOSTNAME_CFG01 }}
176 retry: {count: 1, delay: 30}
177 skip_fail: false
178
179- description: Create net04
180 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
181 '. /root/keystonercv3; neutron net-create net04'
182 node_name: {{ HOSTNAME_CFG01 }}
183 retry: {count: 1, delay: 30}
184 skip_fail: false
185
186- description: Create subnet_net04
187 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
188 '. /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'
189 node_name: {{ HOSTNAME_CFG01 }}
190 retry: {count: 1, delay: 30}
191 skip_fail: false
192
193- description: Create router
194 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
195 '. /root/keystonercv3; neutron router-create net04_router01'
196 node_name: {{ HOSTNAME_CFG01 }}
197 retry: {count: 1, delay: 30}
198 skip_fail: false
199
200- description: Set geteway
201 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
202 '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
203 node_name: {{ HOSTNAME_CFG01 }}
204 retry: {count: 1, delay: 30}
205 skip_fail: false
206
207- description: Add interface
208 cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
209 '. /root/keystonercv3; neutron router-interface-add net04_router01 net04__subnet'
210 node_name: {{ HOSTNAME_CFG01 }}
211 retry: {count: 1, delay: 30}
212 skip_fail: false
213
214- description: sync time
215 cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' cmd.run
216 'service ntp stop; ntpd -gq; service ntp start'
217 node_name: {{ HOSTNAME_CFG01 }}
218 retry: {count: 1, delay: 30}
219 skip_fail: false
220
Tatyana Leontovich3c316a12018-01-31 12:42:22 +0200221- description: create rc file on cfg
222 cmd: scp ctl01:/root/keystonercv3 /root
223 node_name: {{ HOSTNAME_CFG01 }}
224 retry: {count: 1, delay: 30}
225 skip_fail: false
226
227- description: Copy rc file
228 cmd: scp /root/keystonercv3 gtw01:/root
229 node_name: {{ HOSTNAME_CFG01 }}
230 retry: {count: 1, delay: 30}
231 skip_fail: false