Project

General

Profile

Yast based unattended installation » History » Version 16

Anonymous, 11/25/2013 03:04 PM
Update some SLES information

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