Ubuntu Lucid 10.04 Cobbler Kickstart Setup How To
Tags: 10.04, automation, build, cobbler, howto, kickstart, linux, lucid, preseed, pxe, sysadmin, ubunut, unix
Importing the ISO
At the time of this writing the version of cobbler available for CentOS-5 via the EPEL repo was 2.0.3.1. This version doesn’t seem to include proper support for “breeds” other than redhat, allthough it is alluded to in the documentation. So, in order to import the ubuntu media, I had to perform a few extra manual steps.
Copy the ISO contents to a directory that corresponds to the name of your distro
In my case this is Ubunutu-10.04-x86_64. I created the directory /var/www/cobbler/ks_mirror/
To mount an iso file in linux the command is something like
mount -o loop /path/to/lucid.iso /mnt/foo |
Creating the .treeinfo file manually
Once the files have been copied, you should put a .treeinfo file in place too. Koan freaked out when this file wasn’t present when I attempted to perform a –virt install. I think this is safe to omit if you aren’t planning on using Koan.
[general] family = Ubuntu timestamp = 1272326522.13 totaldiscs = 1 version = 10.04 discnum = 1 packagedir = dists arch = x86_64 [images-x86_64] kernel = install/netboot/ubuntu-installer/amd64/linux initrd = install/netboot/ubuntu-installer/amd64/initrd.gz |
Creating the Distro
Now, it’s time to create the cobbler distro manually. This is straightforward enough, just double check all your paths and names to make sure evertyhing matches up.
Here’s what mine looks like:
[[email protected] cobbler]# cobbler distro report --name="Ubuntu-10.04-x86_64" Name : Ubuntu-10.04-x86_64 Architecture : x86_64 Breed : generic Comment : Initrd : /var/www/cobbler/ks_mirror/Ubuntu-10.04-x86_64/install/netboot/ubuntu-installer/amd64/initrd.gz Kernel : /var/www/cobbler/ks_mirror/Ubuntu-10.04-x86_64/install/netboot/ubuntu-installer/amd64/linux Kernel Options : {} Kernel Options (Post Install) : {} Kickstart Metadata : {'tree': 'http://@@[email protected]@/cblr/links/Ubuntu-10.04-x86_64'} Management Classes : [] OS Version : generic26 Owners : ['admin'] Red Hat Management Key : <<inherit>> Red Hat Management Server : <<inherit>> Template Files : {} |
In my case I specificed a Breed of “generic” and an OS Version of “generic26”. Here’s hoping that this gets sorted out formally and makes its way through the EPEL repo soon.
Creating the Ubuntu 10.04 Lucid Kickstart Template
Here’s an example kickstart that is working for automated installes of Ubunutu 10.04 Lucid. It’s not 100% dynamic, but it works well.
#/var/lib/cobbler/kickstarts/lucid.ks # #System language lang en_US #Language modules to install langsupport en_US #System keyboard keyboard us #System mouse mouse #System timezone timezone America/New_York #Root password rootpw --iscrypted $default_password_crypted #Initial user user --disabled #Reboot after installation reboot #Use text mode install text #Install OS instead of upgrade install # Use network installation url --url=$tree #System bootloader configuration bootloader --location=mbr #Clear the Master Boot Record zerombr yes #Partition clearing information clearpart --all --initlabel #Disk partitioning information part swap --size 512 part / --fstype ext3 --size 1 --grow #System authorization infomation auth --useshadow --enablemd5 #Network information network --bootproto=dhcp --device=eth0 #Firewall configuration firewall --enabled --trust=eth0 --ssh #Do not configure the X Window System skipx %pre #services services --enabled=ntpd,nscd,puppet #Package install information %packages ubuntu-standard man-db wget postfix openssh-server sysstat nfs-common nscd postfix quota ntp puppet %post #raw sed -i 's/no/yes/' /etc/default/puppet #end raw |
Creating the Profile
Creating the profile is much like creating the distro, matching up the vairables. I’ve also specified some extra kernel options to output the installer to the serial console (ttyS0) which I find preferable for –virt installs.
[[email protected] cobbler]# cobbler profile report --name="Ubuntu-10.04-x86_64" Name : Ubuntu-10.04-x86_64 Comment : DHCP Tag : default Distribution : Ubuntu-10.04-x86_64 Enable PXE Menu? : False Kernel Options : {'text': '~', 'console': ['tty0', 'ttyS0,9600n8'], 'nofb': '~'} Kernel Options (Post Install) : {'console': ['tty0', 'ttyS0,9600n8'], 'nofb': '~'} Kickstart : /var/lib/cobbler/kickstarts/lucid.ks Kickstart Metadata : {} Management Classes : [] Name Servers : [] Name Servers Search Path : [] Owners : ['admin'] Parent Profile : Red Hat Management Key : <<inherit>> Red Hat Management Server : <<inherit>> Repos : ['ubuntu-lucid-x86_64'] Server Override : <<inherit>> Template Files : {} Virt Auto Boot : 0 Virt Bridge : br345 Virt CPUs : 1 Virt File Size(GB) : 5 Virt Path : Virt RAM (MB) : 512 Virt Type : qemu |
Note: I manually created an apt-mirror named ubunutu-lucid-x86_64. You could use any other ubuntu repo you’d like, local or remote.
Notes & Future Improvements
This should get you going in the right direction towards automating your ubuntu builds with a cobbler install sourcesd from EPEL. Hopefully soon a fix for this will make its way into the EPEL repos.
April 16th, 2011 at 2:40 am
sadly enough the problems still exist just like you described them. it seems cobbler 2 loses a lot of what made cobbler so strong. we can just work to re-submit the 3rd party OS support – very frustrating for me, I’d been using cobbler since 0.3 days and didn’t figure it would make such a massive backward move. but it should get better as ubuntu 11 will use cobbler a lot more.
one question:
“Note: I manually created an apt-mirror named ubunutu-lucid-x86_64. You could use any other ubuntu repo you’d like, local or remote.”
can you give some more info on how you created the repo for ubuntu or how one would specify a off-site apt mirror?
I’m sure I’ll have it working in a few hours but I guess most people will come up with that problem (and a hanging install? 😉
[Reply]
April 21st, 2011 at 7:52 pm
Cobbler’s git version from april has many patches by ubuntu that will fix things.
[Reply]
May 15th, 2011 at 11:00 pm
how do you handle the repository part?
I don`t see your kickstart file giving any information about it!!
[Reply]
November 2nd, 2014 at 2:52 am
I almost never comment, but i did a few searching and
wound up here Ubuntu Lucid 10.04 Cobbler Kickstart
Setup How To › Backdrift Backdrift. And I actually
do have some questions for you if it’s allright.
Could it be only me or does it look as if like some of these responses appear as if they are coming
from brain dead people? 😛 And, if you are writing at other online sites, I’d like to keep up with
everything fresh you have to post. Would you list of the complete urls of your community pages like
your twitter feed, Facebook page or linkedin profile?
[Reply]