1.\" $OpenBSD: autoinstall.8,v 1.8 2014/05/09 21:16:54 rpe Exp $ 2.\" 3.\" Copyright (c) 2013 Robert Peichaer <rpe@openbsd.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: May 9 2014 $ 18.Dt AUTOINSTALL 8 19.Os 20.Sh NAME 21.Nm autoinstall 22.Nd unattended OpenBSD installation and upgrade 23.Sh DESCRIPTION 24.Nm 25allows unattended installation or upgrade of 26.Ox 27by automatically responding to installer questions with 28answers from a response file. 29.Nm 30uses DHCP to discover the location of the response 31file and HTTP to fetch the file. 32.Ss AUTOINSTALL METHODS 33The first method is to choose '(A)utoinstall' at the install prompt. 34If there is only one network interface, the installer will fetch the response 35file via that interface. 36If there is more than one network interface, a selection is presented 37and the installer fetches the response file via the selected interface. 38.Pp 39The second method is to netboot the machine. 40In this situation 41.Nm 42feature will be invoked if the user does not intervene within 43a short time. 44It will behave as if the user selected '(A)utoinstall', but will 45always fetch the response file via the netboot interface. 46.Ss FETCHING THE RESPONSE FILE 47.Nm 48will use HTTP to fetch one of the files 49.Ql install.conf 50or 51.Ql <MAC address>-install.conf 52for install answers, and one of 53.Ql upgrade.conf 54or 55.Ql <MAC address>-upgrade.conf 56for upgrade answers. 57The URL used to fetch the file is constructed from information provided in 58the DHCP options 59.Ql next-server 60and 61.Ql filename . 62If 63.Ql filename 64is 65.Ql auto_install 66then the URLs tried are, in order: 67.Bd -literal -offset indent 68http://<next-server>/<MAC address>-install.conf 69http://<next-server>/install.conf 70.Ed 71.Pp 72where <MAC address> is a string of six hex octets separated by colons 73representing the MAC 74address of the interface being used to fetch the files. 75.Pp 76If 77.Ql filename 78is 79.Ql auto_upgrade 80the URLs tried are, in order: 81.Bd -literal -offset indent 82http://<next-server>/<MAC address>-upgrade.conf 83http://next-server/upgrade.conf 84.Ed 85.Pp 86On architectures where 87.Ql filename 88is used to provide the name of the file to netboot it is necessary to 89create symbolic links called 90.Ql auto_install 91and 92.Ql auto_upgrade 93that point to the expected boot program 94and to change the value of the filename option in the dhcpd.conf file 95to be auto_install or auto_upgrade. 96.Pp 97Note that in these cases, the HTTP server and TFTP server must 98be on the same machine. 99.Ss RESPONSE FILE FORMAT 100The format of a response file is: 101.Bd -literal -offset indent 102question = answer 103.Ed 104.Pp 105.Ql question 106is an installer question (up to the question mark) or a non-ambiguous 107part of it, consisting of whitespace separated words. 108.Ql answer 109is the answer to the question. 110Passwords may be in plaintext, encrypted with 111.Xr encrypt 1 , 112or set to 113.Ql ************* 114(13 '*'s) to disable password logins, only permitting alternative access methods 115(for example, 116.Xr ssh 1 117keys). 118.Pp 119If 120.Nm 121does not find an answer in the response file, the default answer as 122provided by the installer is used. 123.Sh FILES 124.Bl -tag -width "/etc/dhcpd.confXXX" -compact 125.It Pa /etc/dhcpd.conf 126dhcpd(8) configuration file 127.It Pa install.conf 128response file for unattended installation 129.It Pa upgrade.conf 130response file for unattended upgrade 131.El 132.Sh EXAMPLES 133A typical install.conf file will look something like this: 134.Bd -literal -offset indent 135System hostname = server1 136Password for root = $2a$14$Z4xRMg8vDpgYH...GVot3ySoj8yby 137Change the default console to com0 = yes 138Which speed should com0 use = 19200 139Setup a user = puffy 140Password for user = ************* 141Public ssh key for user = ssh-ed25519 AAAAC3NzaC1...g3Aqre puffy@ai 142What timezone are you in = Europe/Stockholm 143Location of sets = http 144HTTP Server = ftp.eu.openbsd.org 145.Ed 146.Pp 147The same file could be used for upgrades by creating a symbolic link called 148upgrade.conf that points to install.conf. 149The upgrade process will only use the answers it needs. 150.Pp 151And an example 152.Xr dhcpd.conf 5 153host entry: 154.Bd -literal -offset indent 155host foo { 156 hardware ethernet 00:50:60:49:8b:84; 157 fixed-address 192.168.2.180; 158 filename "auto_install"; 159 option host-name "foo"; 160} 161.Ed 162.Sh SEE ALSO 163.Xr dhcpd.conf 5 , 164.Xr diskless 8 165