Project

General

Profile

Yast based unattended installation » History » Version 3

Oliver Weinmann, 12/23/2011 05:53 AM

1 1 Oliver Weinmann
h1. Autoyast based unattended installation
2
3
h2. Media notes
4
5
Installation media can be accessed via nfs,ftp or http. The path to the installation media differs from SLES9 and SLES10/11. So you have to create two separate installation media entries in foreman.
6
7
h3. SLES9
8
9
ftp://server/SLES/$major.$minor_$arch
10
11
h3. SLES10/11
12
13
ftp://server/SLES/$major.$minor_$arch/CD1
14
15
h2. Autoyast files
16
17 3 Oliver Weinmann
The Yast2 provisioning templates provided by foreman are working fine for OpenSUSE but not really for SLES. The 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. 
18
19
h2. Puppet Patch
20
21
h3. SLES 11
22
23
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:
24
25
http://en.opensuse.org/SDB:Creating_YaST_installation_sources#repomd.2Frpm_md.2FYUM_sources
26
27
28
29
A good and minimal provisioning template tested on SLES 11.1:
30 1 Oliver Weinmann
31 2 Oliver Weinmann
<pre>
32 1 Oliver Weinmann
<?xml version="1.0" encoding="UTF-8"?>
33
<!DOCTYPE profile>
34
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
35
  <general>
36
    <mode>
37
      <confirm config:type="boolean">false</confirm>
38
      <final_reboot config:type="boolean">true</final_reboot>
39
    </mode>
40
  <%25= snippets "YaST2 Signature-Handling" -%25>
41
  </general>
42
  <networking>
43
    <dns>
44
      <hostname><%25= @host.name %25></hostname>
45
      <resolv_conf_policy>auto</resolv_conf_policy>
46
    </dns>
47
    <interfaces config:type="list">
48
      <interface>
49
        <bootproto>dhcp</bootproto>
50
        <device>eth0</device>
51
        <startmode>auto</startmode>
52
        <usercontrol>no</usercontrol>
53
      </interface>
54
    </interfaces>
55
  </networking>
56
  <ntp-client>
57
    <configure_dhcp config:type="boolean">false</configure_dhcp>
58
    <peers config:type="list">
59
      <peer>
60
        <address>ntp</address>
61
        <initial_sync config:type="boolean">true</initial_sync>
62
        <options></options>
63
        <type>server</type>
64
      </peer>
65
    </peers>
66
    <start_at_boot config:type="boolean">true</start_at_boot>
67
    <start_in_chroot config:type="boolean">true</start_in_chroot>
68
  </ntp-client>
69
  <%25= @host.diskLayout %25>
70
  <runlevel>
71
    <default>5</default>
72
  </runlevel>
73
  <add-on>
74
    <add_on_products config:type="list">
75
  <%25= snippets "YaST2 SLES 11.1 SDK" -%25>
76
  <%25= snippets "YaST2 SLES 11.1 Repos" -%25>
77
  <%25= snippets "YaST2 SLES 11 Driver Updates" -%25>
78
  </add_on_products>
79
  </add-on>
80
  <software>
81
  <%25= snippets "YaST2 SLES 11.1 Software" -%25>
82
 <x11>
83
    <color_depth config:type="integer">16</color_depth>
84
    <display_manager>gdm</display_manager>
85
    <enable_3d config:type="boolean">false</enable_3d>
86
    <enable_xgl config:type="boolean">false</enable_xgl>
87
    <resolution>1280x1024 (SXGA)</resolution>
88
    <window_manager>gnome</window_manager>
89
  </x11>
90
  <users config:type="list">
91
    <user>
92
      <username>root</username>
93
      <encrypted config:type="boolean">true</encrypted>
94
      <fullname>root</fullname>
95
      <gid>0</gid>
96
      <home>/root</home>
97
      <shell>/bin/bash</shell>
98
      <uid>0</uid>
99
      <user_password><%25= root_pass %25></user_password>
100
    </user>
101
  </users>
102
  <scripts>
103
    <post-scripts config:type="list">
104
      <script>
105
        <filename>post.sh</filename>
106
        <interpreter>shell</interpreter>
107
        <network_needed config:type="boolean">true</network_needed>
108
        <notification>Setting up Puppet / Foreman ...</notification>
109
        <debug config:type="boolean">true</debug>
110
        <source><![CDATA[
111
          cat > /etc/puppet/puppet.conf << EOF
112
<%25= snippets "puppet.conf" -%25>
113
EOF
114
/usr/sbin/puppetd --config /etc/puppet/puppet.conf -o --tags no_such_tag --server puppet  --no-daemonize
115
/usr/bin/wget -q -O /dev/null --no-check-certificate <%25= foreman_url %25>
116
/sbin/chkconfig puppet on -f
117
]]>
118
        </source>
119
      </script>
120
    </post-scripts>
121
  </scripts>
122
</profile>
123 2 Oliver Weinmann
</pre>