Unattended installations

Version 3 (Ohad Levy, 09/08/2009 05:37 am)

1 1
h1. How do I use unattended installations (Kickstart, jumpstart, preseed)?
2 1
3 1
Torque automates network boot processes using PXEboot (or native Solaris net:dhcp)
4 1
5 1
At this time, Torque does not support DHCP and DNS alteration, you would need to do those steps manually.
6 1
7 1
h2. TFTP
8 1
9 1
Torque has currently limited support for TFTP- that means it require the TFTP server to be accessible via the local file system.
10 1
future versions of Torque would allow remote TFTP servers as well.
11 1
12 1
make sure you add into your config/settings.yml
13 1
<pre> :tftppath: /var/lib/tftpboot/pxelinux.cfg</pre>
14 1
replace the value with your actual TFTP directory and ensure that the *user which executes Torque  have write access*.
15 1
16 1
17 1
h3. How does Torque manages TFTP?
18 1
19 1
When clicking on the Build button (in the host list), Torque would generate a link which will be automatically read by pxelinux,
20 1
This link would point to a predefined syslinux(pxelinux) boot file which would be based on the Operating System used.
21 1
22 1
after a successful OS installation, that link will be removed, and your default PXE settings will be served.
23 1
The idea behind it is to set the boot order on each host to always boot from network, and then change the settings via Torque.
24 1
25 1
This avoids the need to press F12 on each machine just to reinstall it, Clicking on Build in Torque will trigger a host re-installation upon the next server reboot if default boot order is PXE 
26 1
27 1
an example of a such a file for CentOS 5 32bit:
28 1
<pre>default linux
29 1
label linux
30 1
kernel boot/centos-5-32.vmlinuz
31 2 Ohad Levy
append initrd=boot/centos-5-32.initrd.img ks=http://torquehost/unattended/kickstart ksdevice=eth0 network kssendmac
32 1
</pre>
33 1
34 1
and another example for Ubuntu 9.04 32bit
35 1
<pre>default preseed
36 1
label preseed
37 1
kernel boot/ubuntu-9.04-32.linux
38 2 Ohad Levy
append initrd=boot/ubuntu-9.04-32.initrd.gz ramdisk_size=10800 root=/dev/rd/0 rw auto preseed/url=http://torquehost/unattended/preseed console-keymaps-at/keymap=us locale=en_US interface=eth0 DEBCONF_PRIORITY=critical netcfg/dhcp_timeout=60 --
39 1
</pre>
40 1
41 3 Ohad Levy
h2. PuppetCA
42 3 Ohad Levy
43 3 Ohad Levy
Torque will enable host autosign during provisioning time, that means, the user which executes Torque must have:
44 3 Ohad Levy
1. write access to /etc/puppet/autosign.conf
45 3 Ohad Levy
2. sudo access to run puppetca
46 3 Ohad Levy
47 3 Ohad Levy
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.
48 3 Ohad Levy
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 Torque that it has finished the installation, and Torque will remove the entry from the autosign file automatically.
49 3 Ohad Levy
50 3 Ohad Levy
51 1
h2. Whats inside the Kickstart / jumpstart /preseed ?
52 1
53 1
These files are all generated dynamically based on the setting of each host in Torque, things like partition tables and root password can be unique per server.
54 1
 
55 1
if you want to see the kickstart/preseed etc you may use the spoof parameter, just point your browser to:
56 1
57 3 Ohad Levy
<pre>http://torquehost:3000/unattended/kickstart?spoof=123.321.123.321</pre>
58 1
 
59 1
* 123.321.123.321 is the hosts IP Address (the one you want to build).
60 1
* usually you want to see the page source, the browser might display the file in html which will result in hard to read output.
61 1
* if you are using passenger please remove the ":3000" from the URL.
62 1
63 1
h2. Modifying the unattended template
64 1
65 1
You probably want to do minor teaks to your kickstart/jumpstart/preseed template (yeah the same kind puppet uses).
66 1
the template for can be found at:
67 1
RedHat based installation
68 1
<pre>app/view/unattended/kickstart.rhtml</pre>
69 1
Debian/Ubuntu installations 
70 1
<pre>app/view/unattended/preseed.rhtml</pre>
71 1
and a finish script
72 1
<pre>app/view/unattended/preseed_finish.rhtml</pre>