[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Automating installs



Hello,

Keith Edmunds a écrit :
The new Debian installer makes automated installs fairly
straightforward.

This is something I've just started looking into. Any pointers to documentation on automating (and customising) Debian installs?

FAI as said is one solution. It seems to be very powerful, but learning
curve could be an issue. For just a handful of servers, this could be
time consuming.

The new Debian installer uses debconf preseeding to automate installs.
There is an example of a preseed file in the appendix of the Sarge
Installation Manual (i. e. for i386):

  http://www.debian.org/releases/stable/i386/apcs01.html.en

Other useful resources on this topic: the Debian installer wiki:

  http://wiki.debian.org/DebianInstallerPreseed
  especially http://hands.com/d-i/

What is handy is that you have hooks for scripts at the beginning
and end of both installer stages:

d-i         preseed/early_command     string somecommand
d-i         preseed/late_command      string somecommand
base-config base-config/early_command string  somecommand
base-config base-config/late_command  string  somecommand

I use base-config/late_command to call a script that in turn
triggers some other scripts to finish the installation (MTA,
basic hardening, new kernel and packages, etc.).

Using debconf can ease the automation a lot (for packages
that use debconf to do the config, of course).

apt-get install debconf-utils
man 1 debconf
man 7 debconf
man debconf-set-selections
man debconf-get-selections

Just a note:

Using the official sarge install CD, I had an issue:
when using static IP address and when the DNS server address
is not the same as the gateway address (pretty often, I think),
there's bug #315030
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=315030

In short: in /etc/resolv.conf, you have the gateway address
in place of the DNS server address. For example:

d-i    netcfg/get_gateway        string 10.0.0.1
d-i    netcfg/get_nameservers    string 10.0.0.2

You will have /etc/resolv.conf:

search domaine.org
nameserver 10.0.0.1

A nasty workaround: use base-config/early_command to patch
/etc/resolv.conf early in the second stage:

base-config     base-config/early_command       string sed \
-i.buggy -e 's/10\.0\.0\.1/10.0.0.2/g' /etc/resolv.conf

HTH,

--
Emmanuel Halbwachs              Labo. de Photonique et Nanostructures
tel      : (+33)1 69 63 61 34                             CNRS UPR 20
fax      : (+33)1 69 63 60 06       Route de Nozay F 91460 Marcoussis



Reply to: