4

Are there any solutions for OpenBSD to just:

Insert the custom installer CD, press enter (like: "are you sure?" - message), then the installer automatically partitions the disk/installs OpenBSD, and then customize it a little (ex.: install a few apps from ports)?

This can be done using Kickstarter for RHEL. But can it be done for OpenBSD? I googled for it and didn't found any good answer yet (only that needs bigger programming skills..).

1

2 Answers 2

5

An OpenBSD install does most of that currently, but you just have to press "enter" a lot. As for doing the pkg_installs and other customizations, there is (and has been for a long time) a mechanism to do that, although it's harder to track down the documentation if you don't know what you are looking for. The installer will pull a sitexx.tgz or sitexx-hostname.tgz install set if it is on your installer source.

The FAQ has a lot of details here: http://www.openbsd.org/faq/faq4.html#site

The one other big tip I'll give you that is also mentioned there is the rc.firsttime(8) script mechanism. If you drop a file at /etc/rc.firsttime, those commands will be run at the next boot and then the file is deleted. If doing so in the installer, append to that file, since the installer uses it to.

I saw some rumblings on the mailing lists that a developer is working on an even more automated mechanism for the installer too...

UPDATE 2014-05-01 - autoinstall(8) Automatic Install ability included in 5.5: http://www.openbsd.org/55.html

1

autoinstall(8) is your tool to do this task since OpenBSD 5.5. Using dhcp+pxe and a http server you are good enough to deploy an automated install infrastructure. This topic is well explained on this bsdnow.tv how-to, but I will make some comments on this how-to:

Create a dhcp pxe entry. The example below, will search for the auto_install file instead of pxeboot

option domain-name-servers 192.168.1.1;
subnet 192.168.1.0 netmask 255.255.255.0 {
    option routers 192.168.1.1;
    filename "auto_install";
    next-server 192.168.1.1;
    range 192.168.1.8 192.168.1.254;
[..other stuff..]
} 

Using a tftp server, host the needed files to boot using pxe. You will also need to enable pxe-boot at the client site on its bios:

# ls -l /tftp

total 12896
lrwxr-xr-x  1 root  wheel        7 Feb 22 21:37 auto_install -> pxeboot
-rw-r--r--  1 root  wheel  6501415 Feb 22 12:49 bsd
-rw-r--r--  1 root  wheel    80524 Feb 22 12:50 pxeboot

Host all the installation packages inside your htdocs root directory, and configure your httpd.conf accordingly :

# ls /var/www/htdocs/pub/OpenBSD/5.5/i386/

SHA256       bsd          comp55.tgz   index.txt    xetc55.tgz   xshare55.tgz
SHA256.sig   bsd.mp       etc55.tgz    man55.tgz    xfont55.tgz
base55.tgz   bsd.rd       game55.tgz   xbase55.tgz  xserv55.tgz

Inside your httpd root directory, create an install.conf file with all the answers to the questions asked by the installer.

# cat /var/www/htdocs/install.conf

System hostname = bsdnow.tv
Password for root = ThePlaceToBe...SD
Network interfaces = em0
IPv4 address for em0 = dhcp
Setup a user = puffy
Password for user = whywasibornasafish
What timezone are you in = US/Eastern
Location of sets = http
Server = 192.168.1.1

Note that you could be also using nginx here. The important thing here is that it needs to be placed at the server root with the install.conf name. Also, there is no comprehensive list of the parameters that can be used at autoinstall so, do your search to find good examples like here. Quoting autoinstall manpages:

The response file is a line-oriented ASCII text file. The format of each line is:

question = answer

question is an installer question (not including the question mark) or a non-ambiguous part of it, consisting of whitespace separated words. answer is the answer to the question. Passwords may be in plaintext, encrypted with encrypt(1), or set to ‘*************’ (13 '*'s) to disable password logins, only permitting alternative access methods (for example, ssh(1) keys).

You can also use MAC_address-install.conf or hostname-install.conf(if hostname is defined at dhcpd.conf) to create an install routine to just one host.

Just boot up the machine, and wait for the installation job to finish.

Also, sky is the limit here. Take a look at this Complicated Example from CoBUG that will create a vm dinamically, feed database and httpd files to configure it and start the installation. All with just one command ;)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .