Project

General

Profile

Yast based unattended installation » History » Version 11

Oliver Weinmann, 12/23/2011 07:08 AM

1 1 Oliver Weinmann
h1. Autoyast based unattended installation
2
3 10 Oliver Weinmann
h1.!! Attention !! 
4
h3. Currently there is a problem with the correct display of SLES versions in foreman. No matter what SP level is installed foreman will always only show the major version. There are two tickets, one created by me, raised regarding this problem. It is not affecting deployment at all but it will hopefully be fixed soon.
5 11 Oliver Weinmann
h1. !! Attention !!
6 9 Oliver Weinmann
7
h2. Tickets
8
9
http://theforeman.org/issues/1379
10
http://theforeman.org/issues/1176
11
12 1 Oliver Weinmann
h2. Media notes
13
14 7 Oliver Weinmann
Installation media can be accessed via nfs,ftp or http. The easiest way to setup installation sources for SLES is to use the module in Yast.
15 1 Oliver Weinmann
16 7 Oliver Weinmann
Yast -> Miscellaneous -> Installation Server
17
18
The path to the installation media differs from SLES9 and SLES10/11. So you have to create two separate installation media entries in foreman.
19
20 1 Oliver Weinmann
h3. SLES9
21
22
ftp://server/SLES/$major.$minor_$arch
23
24 7 Oliver Weinmann
Foreman will try to find initrd in @mediapath/boot/$arch/loader. This is a problem since SLES9 keeps the initrd in a different directory. A simple workaround is to copy the folder to the correct location for Foreman to pick it up.
25 1 Oliver Weinmann
26 7 Oliver Weinmann
e.g.
27
28
Foreman tries to copy initrd of SLES 9.4 64Bit:
29
30
<pre>ftp://Server/SLES/9.4_x86_64/boot/x86_64/loader/initrd</pre>
31
32
So we have to copy and create the directory structure:
33
34
<pre>
35
mkdir boot/x86_64/loader
36
cp SUSE-SLES-9-Service-Pack-4/CD1/boot/loader/initrd boot/x86_64/loader
37
</pre>
38
39
Now Foreman will find the initrd. You can verfiy this by enabling debugging for foreman proxy and checking the logs or checking the file size on the files created in the tftp directory.
40 1 Oliver Weinmann
41
h2. Autoyast files
42
43 4 Oliver Weinmann
The Yast2 provisioning templates provided by foreman are working fine for OpenSUSE but not really for SLES. Below is a complete provisioning template tested on SLES 11.1.
44 3 Oliver Weinmann
45 4 Oliver Weinmann
h2. Puppet Version
46 1 Oliver Weinmann
47 4 Oliver Weinmann
The included version of puppet is way to old, even on SLES 11.1. One way to install a more recent version is to download a patch from Novell's website. The patch can be put on a additional installation source and included in the installation process.
48
49 3 Oliver Weinmann
h3. SLES 11
50
51
Download the patch from Novell's website. Please note that you need a valid support contract to download the patch. Create a minimal installation source that can be added during the installation process. This will ensure that a later version of puppet is installed during deployment with foreman. You can find very good instructions on how to create an installation source here:
52
53 1 Oliver Weinmann
http://en.opensuse.org/SDB:Creating_YaST_installation_sources#repomd.2Frpm_md.2FYUM_sources
54 3 Oliver Weinmann
55 4 Oliver Weinmann
Once you have the install source ready, create a new provision template in forman:
56 1 Oliver Weinmann
57 8 Oliver Weinmann
Name: YaST2 SLES 11.1 Updates
58 4 Oliver Weinmann
Snippet: YES
59 1 Oliver Weinmann
60 4 Oliver Weinmann
<pre>
61
    <listentry>
62
      <media_url>ftp://server/SLES/11.1_Updates/</media_url>
63 8 Oliver Weinmann
      <product>Updates</product>
64 4 Oliver Weinmann
      <product_dir>/</product_dir>
65
    </listentry>
66
</pre>
67
68 5 Oliver Weinmann
h2. Additional installation sources e.g. SDK
69 4 Oliver Weinmann
70
Many important packages are not included in the default installation media. In case you would like to add the SDK (Software Development Kit) install sources create another provision template.
71
72
Name: YaST2 SLES 11.1 SDK
73
Snippet: YES
74
75
<pre>
76
    <listentry>
77
      <media_url>ftp://server/SLES/11.1_SDK/</media_url>
78 8 Oliver Weinmann
      <product>SDK</product>
79 4 Oliver Weinmann
      <product_dir>/</product_dir>
80
    </listentry>
81
</pre>
82
83 6 Oliver Weinmann
h2. Software Packages
84 1 Oliver Weinmann
85 6 Oliver Weinmann
If you don't specify any software packages autoyast will assume a minimal installation. This means no GUI but a very small footprint on the installed system. In case you want a default Installation with GUI and so on, create one more provisioning template to hold the package definitions.
86
87
Name: Yast SLES 11.1 Packages
88
Snippet: YES
89
90 1 Oliver Weinmann
<pre>
91 6 Oliver Weinmann
<base>default</base>
92
    <packages config:type="list">
93
      <package>ConsoleKit-32bit</package>
94
      <package>Mesa-32bit</package>
95
      <package>PolicyKit-32bit</package>
96
      <package>PolicyKit-gnome-libs-32bit</package>
97
      <package>aspell-32bit</package>
98
      <package>at-spi-32bit</package>
99
      <package>audiofile-32bit</package>
100
      <package>audit-libs-32bit</package>
101
      <package>bind-libs-32bit</package>
102
      <package>cpufrequtils-32bit</package>
103
      <package>cracklib-32bit</package>
104
      <package>cryptconfig-32bit</package>
105
      <package>cyrus-sasl-32bit</package>
106
      <package>cyrus-sasl-gssapi-32bit</package>
107
      <package>cyrus-sasl-plain-32bit</package>
108
      <package>dbus-1-32bit</package>
109
      <package>dbus-1-glib-32bit</package>
110
      <package>device-mapper-32bit</package>
111
      <package>evolution-data-server-32bit</package>
112
      <package>fam-32bit</package>
113
      <package>file-32bit</package>
114
      <package>freeglut-32bit</package>
115
      <package>freetype-32bit</package>
116
      <package>fribidi-32bit</package>
117
      <package>gconf2-32bit</package>
118
      <package>gdbm-32bit</package>
119
      <package>gettext-runtime-32bit</package>
120
      <package>giflib-32bit</package>
121
      <package>glibc-locale-32bit</package>
122
      <package>gnome-keyring-32bit</package>
123
      <package>gnome-panel-32bit</package>
124
      <package>gnome-vfs2-32bit</package>
125
      <package>gpm-32bit</package>
126
      <package>hal-32bit</package>
127
      <package>hunspell-32bit</package>
128
      <package>libFLAC8-32bit</package>
129
      <package>libHX13-32bit</package>
130
      <package>libacl-32bit</package>
131
      <package>libaio-32bit</package>
132
      <package>libart_lgpl-32bit</package>
133
      <package>libattr-32bit</package>
134
      <package>libavahi-client3-32bit</package>
135
      <package>libavahi-common3-32bit</package>
136
      <package>libavahi-glib1-32bit</package>
137
      <package>libbonobo-32bit</package>
138
      <package>libbonoboui-32bit</package>
139
      <package>libbz2-1-32bit</package>
140
      <package>libcanberra-gtk-32bit</package>
141
      <package>libcanberra-gtk0-32bit</package>
142
      <package>libcanberra0-32bit</package>
143
      <package>libcap2-32bit</package>
144
      <package>libcroco-0_6-3-32bit</package>
145
      <package>libcurl4-32bit</package>
146
      <package>libdb-4_5-32bit</package>
147
      <package>libdrm-32bit</package>
148
      <package>libesd0-32bit</package>
149
      <package>libfreebl3-32bit</package>
150
      <package>libgcrypt11-32bit</package>
151
      <package>libglade2-32bit</package>
152
      <package>libgnome-32bit</package>
153
      <package>libgnome-desktop-2-11-32bit</package>
154
      <package>libgnomecanvas-32bit</package>
155
      <package>libgnutls26-32bit</package>
156
      <package>libgpg-error0-32bit</package>
157
      <package>libgsf-1-114-32bit</package>
158
      <package>libgstreamer-0_10-0-32bit</package>
159
      <package>libgthread-2_0-0-32bit</package>
160
      <package>libgweather1-32bit</package>
161
      <package>libical0-32bit</package>
162
      <package>libidl-32bit</package>
163
      <package>libidn-32bit</package>
164
      <package>liblcms1-32bit</package>
165
      <package>libldap-2_4-2-32bit</package>
166
      <package>libltdl7-32bit</package>
167
      <package>libmng-32bit</package>
168
      <package>libnetpbm10-32bit</package>
169
      <package>libnscd-32bit</package>
170
      <package>libnsssharedhelper0-32bit</package>
171
      <package>libogg0-32bit</package>
172
      <package>libopenct1-32bit</package>
173
      <package>libopensc2-32bit</package>
174
      <package>libproxy0-32bit</package>
175
      <package>libproxy0-config-gnome</package>
176
      <package>libpulse0-32bit</package>
177
      <package>libqt4-32bit</package>
178
      <package>libqt4-qt3support-32bit</package>
179
      <package>libqt4-sql-32bit</package>
180
      <package>libqt4-x11-32bit</package>
181
      <package>libreiserfs-32bit</package>
182
      <package>librsvg-32bit</package>
183
      <package>libsepol1-32bit</package>
184
      <package>libsmbclient0-32bit</package>
185
      <package>libsmbios2-32bit</package>
186
      <package>libsndfile-32bit</package>
187
      <package>libsoup-2_4-1-32bit</package>
188
      <package>libsqlite3-0-32bit</package>
189
      <package>libstdc++33-32bit</package>
190
      <package>libtalloc1-32bit</package>
191
      <package>libtasn1-3-32bit</package>
192
      <package>libtdb1-32bit</package>
193
      <package>libtool-32bit</package>
194
      <package>libvorbis-32bit</package>
195
      <package>libwbclient0-32bit</package>
196
      <package>libwnck-1-22-32bit</package>
197
      <package>libxcrypt-32bit</package>
198
      <package>libxml2-32bit</package>
199
      <package>libxslt-32bit</package>
200
      <package>mozilla-nspr-32bit</package>
201
      <package>mozilla-nss-32bit</package>
202
      <package>mozilla-xulrunner191-32bit</package>
203
      <package>nautilus-32bit</package>
204
      <package>nautilus-cd-burner-32bit</package>
205
      <package>opensc-32bit</package>
206
      <package>openslp-32bit</package>
207
      <package>opie-32bit</package>
208
      <package>orbit2-32bit</package>
209
      <package>pam-32bit</package>
210
      <package>pam-modules-32bit</package>
211
      <package>pam_mount-32bit</package>
212
      <package>parted-32bit</package>
213
      <package>pciutils-32bit</package>
214
      <package>pcsc-lite-32bit</package>
215
      <package>perl-32bit</package>
216
      <package>popt-32bit</package>
217
      <package>qt3-32bit</package>
218
      <package>rpm-32bit</package>
219
      <package>samba-32bit</package>
220
      <package>samba-client-32bit</package>
221
      <package>startup-notification-32bit</package>
222
      <package>strace-32bit</package>
223
      <package>sysfsutils-32bit</package>
224
      <package>tcl-32bit</package>
225
      <package>tcpd-32bit</package>
226
      <package>tk-32bit</package>
227
      <package>utempter-32bit</package>
228
      <package>xaw3d-32bit</package>
229
      <package>xorg-x11-driver-video-radeonhd</package>
230
      <package>yast2-trans-en_GB</package>
231
         </packages>
232
 <patterns config:type="list">
233
      <pattern>Minimal</pattern>
234
      <pattern>WBEM</pattern>
235
      <pattern>apparmor</pattern>
236
      <pattern>base</pattern>
237
      <pattern>documentation</pattern>
238
      <pattern>gnome</pattern>
239
      <pattern>print_server</pattern>
240
      <pattern>x11</pattern>
241
    </patterns>
242
</pre>
243
244
This is the default package selection of a fresh installed SLES 11.1 system. I'm not sure but maybe just defining the patterns is enough.
245
246
h2. Provisioning template
247
248
And finally a good and minimal provisioning template, tested on SLES 11.1:
249
250
<pre>
251 1 Oliver Weinmann
<?xml version="1.0" encoding="UTF-8"?>
252
<!DOCTYPE profile>
253
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
254
  <general>
255
    <mode>
256
      <confirm config:type="boolean">false</confirm>
257
      <final_reboot config:type="boolean">true</final_reboot>
258
    </mode>
259
  <%25= snippets "YaST2 Signature-Handling" -%25>
260
  </general>
261
  <networking>
262
    <dns>
263
      <hostname><%25= @host.name %25></hostname>
264
      <resolv_conf_policy>auto</resolv_conf_policy>
265
    </dns>
266
    <interfaces config:type="list">
267
      <interface>
268
        <bootproto>dhcp</bootproto>
269
        <device>eth0</device>
270
        <startmode>auto</startmode>
271
        <usercontrol>no</usercontrol>
272
      </interface>
273
    </interfaces>
274
  </networking>
275
  <ntp-client>
276
    <configure_dhcp config:type="boolean">false</configure_dhcp>
277
    <peers config:type="list">
278
      <peer>
279
        <address>ntp</address>
280
        <initial_sync config:type="boolean">true</initial_sync>
281
        <options></options>
282
        <type>server</type>
283
      </peer>
284
    </peers>
285
    <start_at_boot config:type="boolean">true</start_at_boot>
286
    <start_in_chroot config:type="boolean">true</start_in_chroot>
287
  </ntp-client>
288
  <%25= @host.diskLayout %25>
289
  <runlevel>
290
    <default>5</default>
291
  </runlevel>
292
  <add-on>
293
    <add_on_products config:type="list">
294
  <%25= snippets "YaST2 SLES 11.1 SDK" -%25>
295 8 Oliver Weinmann
  <%25= snippets "YaST2 SLES 11.1 Updates" -%25>
296 1 Oliver Weinmann
  </add_on_products>
297
  </add-on>
298
  <software>
299 6 Oliver Weinmann
  <%25= snippets "YaST2 SLES 11.1 Packages" -%25>
300
  </software>
301 1 Oliver Weinmann
 <x11>
302
    <color_depth config:type="integer">16</color_depth>
303
    <display_manager>gdm</display_manager>
304
    <enable_3d config:type="boolean">false</enable_3d>
305
    <enable_xgl config:type="boolean">false</enable_xgl>
306
    <resolution>1280x1024 (SXGA)</resolution>
307
    <window_manager>gnome</window_manager>
308
  </x11>
309
  <users config:type="list">
310
    <user>
311
      <username>root</username>
312
      <encrypted config:type="boolean">true</encrypted>
313
      <fullname>root</fullname>
314
      <gid>0</gid>
315
      <home>/root</home>
316
      <shell>/bin/bash</shell>
317
      <uid>0</uid>
318
      <user_password><%25= root_pass %25></user_password>
319
    </user>
320
  </users>
321
  <scripts>
322
    <post-scripts config:type="list">
323
      <script>
324
        <filename>post.sh</filename>
325
        <interpreter>shell</interpreter>
326
        <network_needed config:type="boolean">true</network_needed>
327
        <notification>Setting up Puppet / Foreman ...</notification>
328
        <debug config:type="boolean">true</debug>
329
        <source><![CDATA[
330
          cat > /etc/puppet/puppet.conf << EOF
331
<%25= snippets "puppet.conf" -%25>
332
EOF
333
/usr/sbin/puppetd --config /etc/puppet/puppet.conf -o --tags no_such_tag --server puppet  --no-daemonize
334
/usr/bin/wget -q -O /dev/null --no-check-certificate <%25= foreman_url %25>
335
/sbin/chkconfig puppet on -f
336
]]>
337
        </source>
338
      </script>
339
    </post-scripts>
340
  </scripts>
341
</profile>
342 2 Oliver Weinmann
</pre>