Project

General

Profile

Yast based unattended installation » History » Version 2

Oliver Weinmann, 12/23/2011 05:47 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
The Yast2 provisioning templates provided by foreman are working fine for OpenSUSE but not really for SLES. A good and minimal provisioning template tested on SLES 11.1:
18
19 2 Oliver Weinmann
<pre>
20 1 Oliver Weinmann
<?xml version="1.0" encoding="UTF-8"?>
21
<!DOCTYPE profile>
22
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
23
  <general>
24
    <mode>
25
      <confirm config:type="boolean">false</confirm>
26
      <final_reboot config:type="boolean">true</final_reboot>
27
    </mode>
28
  <%25= snippets "YaST2 Signature-Handling" -%25>
29
  </general>
30
  <networking>
31
    <dns>
32
      <hostname><%25= @host.name %25></hostname>
33
      <resolv_conf_policy>auto</resolv_conf_policy>
34
    </dns>
35
    <interfaces config:type="list">
36
      <interface>
37
        <bootproto>dhcp</bootproto>
38
        <device>eth0</device>
39
        <startmode>auto</startmode>
40
        <usercontrol>no</usercontrol>
41
      </interface>
42
    </interfaces>
43
  </networking>
44
  <ntp-client>
45
    <configure_dhcp config:type="boolean">false</configure_dhcp>
46
    <peers config:type="list">
47
      <peer>
48
        <address>ntp</address>
49
        <initial_sync config:type="boolean">true</initial_sync>
50
        <options></options>
51
        <type>server</type>
52
      </peer>
53
    </peers>
54
    <start_at_boot config:type="boolean">true</start_at_boot>
55
    <start_in_chroot config:type="boolean">true</start_in_chroot>
56
  </ntp-client>
57
  <%25= @host.diskLayout %25>
58
  <runlevel>
59
    <default>5</default>
60
  </runlevel>
61
  <add-on>
62
    <add_on_products config:type="list">
63
  <%25= snippets "YaST2 SLES 11.1 SDK" -%25>
64
  <%25= snippets "YaST2 SLES 11.1 Repos" -%25>
65
  <%25= snippets "YaST2 SLES 11 Driver Updates" -%25>
66
  </add_on_products>
67
  </add-on>
68
  <software>
69
  <%25= snippets "YaST2 SLES 11.1 Software" -%25>
70
 <x11>
71
    <color_depth config:type="integer">16</color_depth>
72
    <display_manager>gdm</display_manager>
73
    <enable_3d config:type="boolean">false</enable_3d>
74
    <enable_xgl config:type="boolean">false</enable_xgl>
75
    <resolution>1280x1024 (SXGA)</resolution>
76
    <window_manager>gnome</window_manager>
77
  </x11>
78
  <users config:type="list">
79
    <user>
80
      <username>root</username>
81
      <encrypted config:type="boolean">true</encrypted>
82
      <fullname>root</fullname>
83
      <gid>0</gid>
84
      <home>/root</home>
85
      <shell>/bin/bash</shell>
86
      <uid>0</uid>
87
      <user_password><%25= root_pass %25></user_password>
88
    </user>
89
  </users>
90
  <scripts>
91
    <post-scripts config:type="list">
92
      <script>
93
        <filename>post.sh</filename>
94
        <interpreter>shell</interpreter>
95
        <network_needed config:type="boolean">true</network_needed>
96
        <notification>Setting up Puppet / Foreman ...</notification>
97
        <debug config:type="boolean">true</debug>
98
        <source><![CDATA[
99
          cat > /etc/puppet/puppet.conf << EOF
100
<%25= snippets "puppet.conf" -%25>
101
EOF
102
/usr/sbin/puppetd --config /etc/puppet/puppet.conf -o --tags no_such_tag --server puppet  --no-daemonize
103
/usr/bin/wget -q -O /dev/null --no-check-certificate <%25= foreman_url %25>
104
/sbin/chkconfig puppet on -f
105
]]>
106
        </source>
107
      </script>
108
    </post-scripts>
109
  </scripts>
110
</profile>
111 2 Oliver Weinmann
</pre>