Project

General

Profile

Yast based unattended installation » History » Revision 2

Revision 1 (Oliver Weinmann, 12/23/2011 05:46 AM) → Revision 2/17 (Oliver Weinmann, 12/23/2011 05:47 AM)

h1. Autoyast based unattended installation 

 h2. 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. 

 h3. SLES9 

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

 h3. SLES10/11 

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

 h2. 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: 

 <pre> 
 <?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> 
 </pre>