« Previous - Version 10/54 (diff) - Next » - Current version
Ohad Levy, 03/29/2010 02:52 am


How do I use unattended installations (Kickstart, jumpstart, preseed)?

Foreman automates network boot processes using PXEboot (or native Solaris net:dhcp)

At this time, Foreman does not support DHCP and DNS alteration, you would need to do those steps manually. DHCP/DNS management. Coming soon

TFTP

Foreman has currently limited support for TFTP- that means it require the TFTP server to be accessible via the local file system.
future versions of Foreman would allow remote TFTP servers as well.

make sure you add into your config/settings.yml

 :tftppath: /var/lib/tftpboot/pxelinux.cfg

replace the value with your actual TFTP directory and ensure that the user which executes Foreman have write access.

How does Foreman manages TFTP?

When clicking on the Build button (in the host list), Foreman would generate a link which will be automatically read by pxelinux,
This link would point to a predefined syslinux(pxelinux) boot file which would be based on the Operating System used.

Note:- if you require the link to point to different PXE files based on serial console variables, adding '0,19200n8' in the serial field of a host will create a different symbolic link.

after a successful OS installation, that link will be removed, and your default PXE settings will be served.
The idea behind it is to set the boot order on each host to always boot from network, and then change the settings via Foreman.

This avoids the need to press F12 on each machine just to reinstall it, Clicking on Build in Foreman will trigger a host re-installation upon the next server reboot if default boot order is PXE

an example of a such a file for CentOS 5 32bit:

default linux
label linux
kernel boot/centos-5-32.vmlinuz
append initrd=boot/centos-5-32.initrd.img ks=http://foremanhost/unattended/kickstart ksdevice=eth0 network kssendmac

and another example for Ubuntu 9.04 32bit

default preseed
label preseed
kernel boot/ubuntu-9.04-32.linux
append initrd=boot/ubuntu-9.04-32.initrd.gz ramdisk_size=10800 root=/dev/rd/0 rw auto preseed/url=http://foremanhost/unattended/preseed console-keymaps-at/keymap=us locale=en_US interface=eth0 DEBCONF_PRIORITY=critical netcfg/dhcp_timeout=60 --

PuppetCA

Foreman will enable host autosign during provisioning time, that means, the user which executes Foreman must have:
1. write access to /etc/puppet/autosign.conf
2. sudo access to run puppetca

Once a host (which is enabled for build) is requesting a kickstart/jumpstart etc than an entry would be created in the autosign.conf file.
Each operating system will run puppetd after the OS installation but before the first reboot, this will acquire the puppet certificate, then the host will notify Foreman that it has finished the installation, and Foreman will remove the entry from the autosign file automatically.

Whats inside the Kickstart / jumpstart /preseed ?

These files are all generated dynamically based on the setting of each host in Foreman, things like partition tables and root password can be unique per server.

if you want to see the kickstart/preseed etc you may use the spoof parameter, just point your browser to:

http://foremanhost:3000/unattended/kickstart?spoof=123.321.123.321
  • 123.321.123.321 is the hosts IP Address (the one you want to build).
  • usually you want to see the page source, the browser might display the file in html which will result in hard to read output.
  • if you are using passenger please remove the ":3000" from the URL.

Modifying the unattended template

You probably want to do minor teaks to your kickstart/jumpstart/preseed template (yeah the same kind puppet uses).
the template for can be found at:
RedHat based installation

app/view/unattended/kickstart.rhtml

Debian/Ubuntu installations
app/view/unattended/preseed.rhtml

and a finish script
app/view/unattended/preseed_finish.rhtml

Snippets support

as of version 0.1-2 snippets support was added, for reusable code that be shared between operating systems deployments (e.g. puppet.conf).
They are pure ERB templates (same as puppet templates) and could be modified at the following directory:

app/views/unattended/snippets

in order to create a new snippet place it in that the same directory and prefix it with a "_". later you can call it from the existing templates:

<%= snippets "vmware" -%>

Dynamic disk partition

It is possible to use a script (e.g a kickstart post script) instead of a static partition table.
see Dynamic disk partioning

Also available in: HTML TXT