/
autoyast.xml.erb
380 lines (375 loc) · 12.8 KB
/
autoyast.xml.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
<?xml version="1.0"?>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<deploy_image>
<image_installation config:type="boolean">false</image_installation>
</deploy_image>
<general>
<ask-list config:type="list"/>
<mode>
<confirm config:type="boolean">false</confirm>
<final_halt config:type="boolean">false</final_halt>
<final_reboot config:type="boolean">false</final_reboot>
<halt config:type="boolean">false</halt>
<second_stage config:type="boolean">true</second_stage>
</mode>
<mouse>
<id>none</id>
</mouse>
<proposals config:type="list"/>
<signature-handling>
<accept_file_without_checksum config:type="boolean">true</accept_file_without_checksum>
<accept_non_trusted_gpg_key config:type="boolean">true</accept_non_trusted_gpg_key>
<accept_unknown_gpg_key config:type="boolean">true</accept_unknown_gpg_key>
<accept_unsigned_file config:type="boolean">true</accept_unsigned_file>
<accept_verification_failed config:type="boolean">true</accept_verification_failed>
<import_gpg_key config:type="boolean">true</import_gpg_key>
</signature-handling>
<storage/>
</general>
<add-on>
<add_on_products config:type="list">
<% @repos.keys.sort.each do |name| %>
<listentry>
<name><%= name %></name>
<product><%= name %></product>
<product_dir>/</product_dir>
<media_url><%= @repos[name][:url] %></media_url>
<% unless @repos[name][:priority] == 99 -%>
<priority><%= @repos[name][:priority] %></priority>
<% end -%>
<!-- See bnc#787157 for discussion on ask_on_error -->
<ask_on_error config:type="boolean"><%= @repos[name][:ask_on_error] || 'false' %></ask_on_error>
</listentry>
<% end %>
</add_on_products>
</add-on>
<users config:type="list">
<user>
<username>root</username>
<% if @rootpw_hash != "" %>
<user_password><%= @rootpw_hash %></user_password>
<encrypted config:type="boolean">true</encrypted>
<% end %>
<forename/>
<surname/>
</user>
<user>
<username>glance</username>
<user_password>!</user_password>
<encrypted config:type="boolean">true</encrypted>
<uid>200</uid>
<gid>200</gid>
<home>/var/lib/glance</home>
<shell>/sbin/nologin</shell>
</user>
<user>
<username>qemu</username>
<user_password>!</user_password>
<encrypted config:type="boolean">true</encrypted>
<uid>201</uid>
<gid>201</gid>
<home>/</home>
<shell>/sbin/nologin</shell>
</user>
<user>
<username>cinder</username>
<user_password>!</user_password>
<encrypted config:type="boolean">true</encrypted>
<uid>203</uid>
<gid>203</gid>
<home>/var/lib/cinder</home>
<shell>/sbin/nologin</shell>
</user>
</users>
<groups config:type="list">
<!-- for making HA on shared NFS backend storage work -->
<group>
<gid>200</gid>
<groupname>glance</groupname>
<group_password>x</group_password>
<userlist>glance</userlist>
</group>
<group>
<gid>201</gid>
<groupname>qemu</groupname>
<group_password>x</group_password>
<userlist/>
</group>
<group>
<gid>202</gid>
<groupname>kvm</groupname>
<group_password>x</group_password>
<userlist>qemu</userlist>
</group>
<group>
<gid>203</gid>
<groupname>cinder</groupname>
<group_password>x</group_password>
<userlist>cinder</userlist>
</group>
</groups>
<networking>
<keep_install_network config:type="boolean">true</keep_install_network>
<dns>
<dhcp_hostname config:type="boolean">true</dhcp_hostname>
<domain><%= @domain_name %></domain>
<hostname><%= @node_hostname %></hostname>
<% unless @nameservers.empty? -%>
<nameservers config:type="list">
<% @nameservers.each do |nameserver| -%>
<nameserver><%= nameserver %></nameserver>
<% end -%>
</nameservers>
<% end -%>
<resolv_conf_policy>auto</resolv_conf_policy>
<write_hostname config:type="boolean">false</write_hostname>
</dns>
<managed config:type="boolean">false</managed>
<routing>
<ip_forward config:type="boolean">false</ip_forward>
</routing>
</networking>
<partitioning config:type="list">
<% if @raid_type == "single" -%>
<drive>
<% if @boot_device %>
<device>/dev/<%= @boot_device %></device>
<% end %>
<initialize config:type="boolean">true</initialize>
<type config:type="symbol">CT_DISK</type>
<disklabel>gpt</disklabel>
<partitions config:type="list">
<% if @use_uefi %>
<partition>
<create config:type="boolean">true</create>
<format config:type="boolean">true</format>
<filesystem config:type="symbol">vfat</filesystem>
<partition_id config:type="integer">259</partition_id>
<mount>/boot/efi</mount>
<size>128M</size>
</partition>
<% end %>
<partition>
<create config:type="boolean">true</create>
<partition_id config:type="integer">263</partition_id>
<size>10M</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<filesystem config:type="symbol">swap</filesystem>
<format config:type="boolean">true</format>
<mount>swap</mount>
<size>auto</size>
</partition>
<partition>
<create config:type="boolean">true</create>
<format config:type="boolean">true</format>
<mount>/</mount>
<size>auto</size>
</partition>
</partitions>
<use>all</use>
</drive>
<% else -%>
<% @raid_disks.each do |disk| -%>
<drive>
<device><%= disk %></device>
<type config:type="symbol">CT_DISK</type>
<initialize config:type="boolean">true</initialize>
<partitions config:type="list">
<% if @use_uefi %>
<partition>
<create config:type="boolean">true</create>
<format config:type="boolean">true</format>
<filesystem config:type="symbol">vfat</filesystem>
<partition_id config:type="integer">259</partition_id>
<mount>/boot/efi</mount>
<size>128M</size>
</partition>
<% end %>
<partition>
<create config:type="boolean">true</create>
<partition_id config:type="integer">263</partition_id>
<size>10M</size>
</partition>
<partition>
<mount>swap</mount>
<size>auto</size>
</partition>
<partition>
<partition_id config:type="integer">253</partition_id>
<format config:type="boolean">false</format>
<raid_name>/dev/md0</raid_name>
<raid_type>raid</raid_type>
<size>200M</size>
</partition>
<partition>
<partition_id config:type="integer">253</partition_id>
<format config:type="boolean">false</format>
<raid_name>/dev/md1</raid_name>
<raid_type>raid</raid_type>
<size>max</size>
</partition>
</partitions>
<use>all</use>
</drive>
<% end -%>
<drive>
<device>/dev/md</device>
<type config:type="symbol">CT_MD</type>
<initialize config:type="boolean">true</initialize>
<partitions config:type="list">
<partition>
<filesystem config:type="symbol">ext3</filesystem>
<format config:type="boolean">true</format>
<mount>/boot</mount>
<partition_id config:type="integer">131</partition_id>
<partition_nr config:type="integer">0</partition_nr>
<raid_options>
<raid_type>raid1</raid_type>
</raid_options>
</partition>
<partition>
<filesystem config:type="symbol"><%= @default_fs %></filesystem>
<format config:type="boolean">true</format>
<mount>/</mount>
<partition_id config:type="integer">131</partition_id>
<partition_nr config:type="integer">1</partition_nr>
<raid_options>
<raid_type><%= @raid_type %></raid_type>
</raid_options>
</partition>
</partitions>
<use>all</use>
</drive>
<% end -%>
</partitioning>
<timezone>
<hwclock>UTC</hwclock>
<timezone><%=@timezone%></timezone>
</timezone>
<% if @platform == "suse" && @target_platform_version.to_f >= 12 || @platform == "opensuse" -%>
<services-manager>
<services>
<enable config:type="list">
<service>sshd</service>
</enable>
</services>
</services-manager>
<% end %>
<scripts>
<% if @platform == "suse" && @target_platform_version.to_f >= 12 || @platform == "opensuse" -%>
<pre-scripts config:type="list">
<script>
<debug config:type="boolean">true</debug>
<filename>filesystem_default</filename>
<source>
<![CDATA[
# Change the default FS YaST will use for partitions
sed -i s/"^[[:space:]]*DEFAULT_FS=.*"/DEFAULT_FS=\"<%= @default_fs %>\"/ /etc/sysconfig/storage
]]>
</source>
</script>
</pre-scripts>
<% end %>
<chroot-scripts config:type="list">
<script>
<chrooted config:type="boolean">true</chrooted>
<debug config:type="boolean">true</debug>
<filename>crowbar_post</filename>
<source>
<![CDATA[
export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): '
HTTP_SERVER="<%= @admin_node_ip %>:<%= @web_port %>"
HOSTNAME="<%= @node_fqdn %>"
cat <<EOF > /etc/crowbarrc
[default]
server = <%= @crowbar_protocol %>://<%= @admin_node_ip %>
username = <%= @crowbar_client_username %>
password = <%= @crowbar_client_password %>
<% unless @crowbar_verify_ssl %>
verify_ssl = 0
<% end %>
EOF
mkdir -p /root/.ssh
chmod 700 /root/.ssh
if ! curl -s -o /root/.ssh/authorized_keys.wget \
http://$HTTP_SERVER/authorized_keys ||\
grep -q "Error 404" /root/.ssh/authorized_keys.wget; then
rm -f /root/.ssh/authorized_keys.wget
else
chmod 644 /root/.ssh/authorized_keys
cat /root/.ssh/authorized_keys.wget >> /root/.ssh/authorized_keys
rm -f /root/.ssh/authorized_keys.wget
fi
curl -s -o /usr/sbin/crowbar_join <%= @crowbar_join %>
chmod +x /usr/sbin/crowbar_join
mkdir -p /var/log/crowbar
crowbarctl restricted transition $HOSTNAME "installed"
# Wait for DHCP to update - this is mainly for virtual environments or really large deploys
sleep 30
sync
]]>
</source>
</script>
</chroot-scripts>
<init-scripts config:type="list">
<!-- bugfix bnc#886238: https://bugzilla.novell.com/show_bug.cgi?id=886238 -->
<script>
<filename>autoyast_set_hostentries.sh</filename>
<source>
<![CDATA[
echo "<%= @node_ip %> <%= @node_fqdn %> <%= @node_hostname %>" >> /etc/hosts
]]>
</source>
</script>
<!-- /bugfix bnc#886238: https://bugzilla.novell.com/show_bug.cgi?id=886238 -->
<script>
<source>
<![CDATA[
/usr/sbin/crowbar_join --setup --verbose
]]>
</source>
</script>
</init-scripts>
</scripts>
<software>
<packages config:type="list">
<package>autoyast2-installation</package>
<% if @architecture == "x86_64" -%>
<package>biosdevname</package>
<% end -%>
<% if @platform == "suse" && @cpu_model == "intel" -%>
<package>ucode-intel</package>
<% elsif @platform == "suse" && @cpu_model == "amd" -%>
<package>ucode-amd</package>
<%end -%>
<package>netcat-openbsd</package>
<package>ruby2.1-rubygem-chef</package>
<package>ruby2.1-rubygem-crowbar-client</package>
<% if @platform == "suse" && @target_platform_version == "11.3" -%>
<package>suse-sle11-openstack-cloud-release</package>
<% elsif @platform == "suse" && @target_platform_version.to_f >= 12.1 -%>
<package>suse-openstack-cloud-crowbar-release</package>
<package>supportutils-plugin-suse-openstack-cloud</package>
<% end -%>
<% if @platform == "opensuse" -%>
<package>rsyslog</package>
<% end -%>
<% @packages.each do |package| -%>
<package><%= package %></package>
<% end -%>
</packages>
<patterns config:type="list">
<% if @platform == "suse" -%>
<pattern>Minimal</pattern>
<% elsif @platform == "opensuse" -%>
<pattern>enhanced_base</pattern>
<pattern>sw_management</pattern>
<!-- not required, might be nice <pattern>yast2_basis</pattern> -->
<% end -%>
<pattern>base</pattern>
</patterns>
</software>
</profile>