Automating the Installation with Kickstart
Kickstart installations offer a means to automate the installation process, either partially or fully. Kickstart files contain answers to all questions normally asked by the installation program, such as what time zone do you want the system to use, how should the drives be partitioned or which packages should be installed. Providing a prepared Kickstart file when the installation begins therefore allows the you to perform the installation automatically, without need for any intervention from the user. This is especially useful when deploying Fedora on a large number of systems at once.
Todos los script de Kickstart y los archivos de registro de su ejecución se almacenan en el directorio /tmp
para ayudar con la depuración de problemas de instalación.
How to Perform a Kickstart Installation
Kickstart installations can be performed using a local DVD, a local hard drive, or via NFS, FTP, HTTP, or HTTPS.
To use Kickstart, you must:
-
Create a Kickstart file.
-
Create boot media or configure a network boot (PXE) server which will be used to begin the installation. Note that live media cannot be used for Kickstart installations - use installation media that can boot directly into the installer, such as the standard or netinstall ISO image from the Server edition.
-
Make the Kickstart file available on removable media, a hard drive, or a network location.
-
Start the Kickstart installation by booting the installer and using a boot option to tell the installer where to find the Kickstart file.
This chapter explains these steps in detail.
Creating a Kickstart File
The Kickstart file itself is a plain text file, containing keywords listed in Kickstart Syntax Reference, which serve as directions for the installation. Any text editor able to save files as ASCII text (such as Gedit or vim on Linux systems or Notepad on Windows systems) can be used to create and edit Kickstart files.
El enfoque recomendado para crear archivos Kickstart es realizar primero una instalación manual en un sistema. Una vez finalizada la instalación, todas las opciones seleccionadas se guardan en un archivo llamado anaconda-ks.cfg
, ubicado en el directorio /root/
del sistema instalado. Puede copiar este archivo, realizar los cambios necesarios y usar el archivo de configuración resultante en posteriores instalaciones.
When creating a Kickstart file, keep in mind the following:
-
Lines starting with a pound sign (
#
) are treated as comments and are ignored. -
Sections must be specified in order. Items within the sections do not have to be in a specific order unless otherwise specified. The correct section order is:
-
The command section which contains actual Kickstart commands and options as listed in Kickstart Syntax Reference. Note that some commands, such as install, are mandatory, but most commands are optional.
-
The %packages section which contains a list of packages and package groups to be installed. See %packages (required) - Package Selection for details.
-
The %pre and %post sections, containing a pre-installation and post-installation scripts. These two sections can be in any order and are not mandatory. See %pre (optional) - Pre-installation Script and %post (optional) - Post-installation Script for details.
Las secciones %packages, %pre y %post deben terminar con %end; de lo contrario, el programa de instalación rechazará el archivo Kickstart. La sección principal de comandos no tiene una declaración final especial.
-
-
Si omite algún elemento obligatorio, el programa de instalación solicitará al usuario una respuesta al elemento correspondiente, tal como se le solicitaría durante una instalación típica. Una vez proporcionada la respuesta, la instalación continuará. Tenga en cuenta que si el sistema que está instalando no tiene pantalla, no podrá ver la solicitud y la instalación parecerá haber fallado.
Verifying the Kickstart File
Al crear o personalizar su archivo kickstart, conviene verificar su validez antes de intentar usarlo en una instalación. Fedora incluye la utilidad de línea de instrucciones ksvalidator, que permite realizar esta tarea. Esta herramienta forma parte del paquete pykickstart. Para instalar este paquete, ejecute el siguiente instrucción:
# dnf install pykickstart
After installing the package, you can validate a Kickstart file using the following command:
$ ksvalidator /path/to/kickstart.ks
Replace /path/to/kickstart.ks with the path to the Kickstart file you want to verify.
For more information about this tool, see the ksvalidator(1)
man page.
Conservar en mente que la herramienta de validación tiene sus limitaciones. El archivo Kickstart puede ser muy complicado; ksvalidator puede asegurarse que el sistema está correcto y que el archivo no incluye opciones retiradas, pero no puede garantizar la instalación sea lograda. Además no intenta validar el %pre, [command]%post# y %packages secciones del archivo Kickstart. |
Making the Kickstart File Available
Once you create a Kickstart file, you can place it in one of the following locations:
-
On removable media, such as a DVD or USB flash drive connected to the installation system
-
On a hard drive connected to the installation system
-
On a network share reachable from the installation system
Normalmente, un archivo Kickstart se copia a un medio extraíble o a un disco duro, o se pone a disposición en la red. Colocar el archivo en una ubicación de red complementa el enfoque habitual de las instalaciones Kickstart, que también está basado en red: el sistema se inicia utilizando un servidor PXE, el archivo Kickstart se descarga desde un recurso compartido de red y los paquetes de software especificados en el archivo se descargan desde repositorios remotos.
Setting Up an Installation Server offers some additional information about preparing for a network-based installation.
Iniciar la Instalación Kickstart
Once you have everything ready - you have created a valid Kickstart file and you have either local boot media or a PXE server available, you can start the Kickstart installation. You need to use the inst.ks= boot option either in the boot menu (when booting from local media), or add this option to your PXE server configuration. For information about boot options used in Kickstart installations, see Kickstart Boot Options.
Want to help? Learn how to contribute to Fedora Docs ›