Project

General

Profile

Actions

Yast based unattended installation » History » Revision 4

« Previous | Revision 4/17 (diff) | Next »
Oliver Weinmann, 12/23/2011 06:38 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. Below is a complete provisioning template tested on SLES 11.1.

Puppet Version

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.

SLES 11

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:

http://en.opensuse.org/SDB:Creating_YaST_installation_sources#repomd.2Frpm_md.2FYUM_sources

Once you have the install source ready, create a new provision template in forman:

Name: YaST2 SLES 11.1 Repos
Snippet: YES

    <listentry>
      <media_url>ftp://server/SLES/11.1_Updates/</media_url>
      <product>VEGA</product>
      <product_dir>/</product_dir>
    </listentry>

h2 Additional installation sources e.g. SDK

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.

Name: YaST2 SLES 11.1 SDK
Snippet: YES

    <listentry>
      <media_url>ftp://server/SLES/11.1_SDK/</media_url>
      <product>VEGA</product>
      <product_dir>/</product_dir>
    </listentry>

h2 Provisioning template
A good and minimal provisioning template tested on SLES 11.1:

<?xml version="1.0" encoding="UTF-8"?>
<!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>
  <%25= snippets "YaST2 Signature-Handling" -%25>
  </general>
  <networking>
    <dns>
      <hostname><%25= @host.name %25></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>
  <%25= @host.diskLayout %25>
  <runlevel>
    <default>5</default>
  </runlevel>
  <add-on>
    <add_on_products config:type="list">
  <%25= snippets "YaST2 SLES 11.1 SDK" -%25>
  <%25= snippets "YaST2 SLES 11.1 Repos" -%25>
  <%25= snippets "YaST2 SLES 11 Driver Updates" -%25>
  </add_on_products>
  </add-on>
  <software>
  <%25= snippets "YaST2 SLES 11.1 Software" -%25>
 <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><%25= root_pass %25></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
<%25= snippets "puppet.conf" -%25>
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 <%25= foreman_url %25>
/sbin/chkconfig puppet on -f
]]>
        </source>
      </script>
    </post-scripts>
  </scripts>
</profile>

Updated by Oliver Weinmann almost 13 years ago · 17 revisions