Project

General

Profile

Yast based unattended installation » History » Version 15

Oliver Weinmann, 02/09/2012 09:51 AM

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