AUTOINSTALL(8)

NAME
autoinstall - unattended OpenBSD installation and upgrade

DESCRIPTION
autoinstall allows unattended installation or upgrade of OpenBSD by automatically responding to installer questions with answers from a response file. autoinstall uses DHCP to discover the location of the response file and HTTP to fetch the file. If that fails, the installer asks for the location which can either be an url or a local path.

  Autoinstall methods
The first method is to choose '(A)utoinstall' at the install prompt. If there is only one network interface, the installer fetches the response file via that interface. If there is more than one network interface, a selection is presented and the installer fetches the response file via the selected interface.

The second method is to netboot the machine. In this situation the autoinstall feature is invoked if the user does not intervene within a short time. It behaves as if the user selected '(A)utoinstall', but always fetches the response file via the netboot interface.

  Fetching the response file
autoinstall uses HTTP to fetch one of the files install.conf or MAC_address-install.conf for install answers, or one of upgrade.conf or MAC_address-upgrade.conf for upgrade answers. The URL used to fetch the file is constructed from information provided in the dhcpd.conf(5) statements next-server and filename. If the filename is auto_install, then the URLs tried are, in order:

    http://next-server/MAC_address-install.conf
    http://next-server/install.conf

where MAC_address is a string of six hex octets separated by colons representing the MAC address of the interface being used to fetch the files.

If the filename is auto_upgrade, the URLs tried are, in order:

    http://next-server/MAC_address-upgrade.conf
    http://next-server/upgrade.conf

On architectures where the filename statement is used to provide the name of the file to netboot it is necessary to create symbolic links called auto_install and auto_upgrade that point to the expected boot program and to change the value of the filename statement in the dhcpd.conf(5) file to be auto_install or auto_upgrade.

Note that in these cases, the HTTP server and TFTP server must be on the same machine.

  Response file format
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).

If autoinstall does not find an answer in the response file, the default answer as provided by the installer is used.

FILES
/etc/dhcpd.conf
    dhcpd(8) configuration file
install.conf
    response file for unattended installation
upgrade.conf
    response file for unattended upgrade

EXAMPLES
A typical install.conf file will look something like this:

    System hostname = server1
    Password for root = $2a$14$Z4xRMg8vDpgYH...GVot3ySoj8yby
    Change the default console to com0 = yes
    Which speed should com0 use = 19200
    Setup a user = puffy
    Password for user = *************
    Public ssh key for user = ssh-ed25519 AAAAC3NzaC1...g3Aqre puffy@ai
    What timezone are you in = Europe/Stockholm
    Location of sets = http
    HTTP Server = ftp.eu.openbsd.org

The same file could be used for upgrades by creating a symbolic link called upgrade.conf that points to install.conf. The upgrade process will only use the answers it needs.

And an example dhcpd.conf(5) host declaration:

    host foo {
      hardware ethernet 00:50:60:49:8b:84;
      fixed-address 192.168.2.180;
      filename "auto_install";
      option host-name "foo";
    }

SEE ALSO
dhcpd.conf(5), diskless(8)

HISTORY
The autoinstall feature first appeared in OpenBSD 5.5.

AUTHORS
Robert Peichaer <rpe@openbsd.org>