Version 1/15 - Next » - Current version
Oliver Weinmann, 12/23/2011 05:46 am


Autoyast based unattended installation

Media notes

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.

SLES9

ftp://server/SLES/$major.$minor_$arch

SLES10/11

ftp://server/SLES/$major.$minor_$arch/CD1

Autoyast files

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:


<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<general>
<mode>
<confirm config:type="boolean">false</confirm>
<final_reboot config:type="boolean">true</final_reboot>
</mode>
<%= snippets "YaST2 Signature-Handling" -%>
</general>
<networking>
<dns>
<hostname><%= @host.name ></hostname>
<resolv_conf_policy>auto</resolv_conf_policy>
</dns>
<interfaces config:type="list">
<interface>
<bootproto>dhcp</bootproto>
<device>eth0</device>
<startmode>auto</startmode>
<usercontrol>no</usercontrol>
</interface>
</interfaces>
</networking>
<ntp-client>
<configure_dhcp config:type="boolean">false</configure_dhcp>
<peers config:type="list">
<peer>
<address>ntp</address>
<initial_sync config:type="boolean">true</initial_sync>
<options></options>
<type>server</type>
</peer>
</peers>
<start_at_boot config:type="boolean">true</start_at_boot>
<start_in_chroot config:type="boolean">true</start_in_chroot>
</ntp-client>
<
= @host.diskLayout >
<runlevel>
<default>5</default>
</runlevel>
<add-on>
<add_on_products config:type="list">
<
= snippets "YaST2 SLES 11.1 SDK" -%>
<%= snippets "YaST2 SLES 11.1 Repos" -%>
<%= snippets "YaST2 SLES 11 Driver Updates" -%>
</add_on_products>
</add-on>
<software>
<%= snippets "YaST2 SLES 11.1 Software" -%>
<x11>
<color_depth config:type="integer">16</color_depth>
<display_manager>gdm</display_manager>
<enable_3d config:type="boolean">false</enable_3d>
<enable_xgl config:type="boolean">false</enable_xgl>
<resolution>1280x1024 (SXGA)</resolution>
<window_manager>gnome</window_manager>
</x11>
<users config:type="list">
<user>
<username>root</username>
<encrypted config:type="boolean">true</encrypted>
<fullname>root</fullname>
<gid>0</gid>
<home>/root</home>
<shell>/bin/bash</shell>
<uid>0</uid>
<user_password><%= root_pass ></user_password>
</user>
</users>
<scripts>
<post-scripts config:type="list">
<script>
<filename>post.sh</filename>
<interpreter>shell</interpreter>
<network_needed config:type="boolean">true</network_needed>
<notification>Setting up Puppet / Foreman ...</notification>
<debug config:type="boolean">true</debug>
<source><![CDATA[
cat > /etc/puppet/puppet.conf << EOF
<
= snippets "puppet.conf" -%>
EOF
/usr/sbin/puppetd --config /etc/puppet/puppet.conf -o --tags no_such_tag --server puppet --no-daemonize
/usr/bin/wget -q -O /dev/null --no-check-certificate <%= foreman_url %>
/sbin/chkconfig puppet on -f
]]>
</source>
</script>
</post-scripts>
</scripts>
</profile>

Also available in: HTML TXT