Documentation for a newer release is available. View Latest

Automatizar la Instalación con Kickstart

Las instalaciones Kickstart ofrecen un medio para automatizar el proceso de instalación, ya sea parcial o totalmente. Los archivos Kickstart contienen respuestas a todas las preguntas que suele plantear el programa de instalación, como la zona horaria que desea que use el sistema, cómo se deben particionar las unidades o qué paquetes se deben instalar. Proporcionar un archivo Kickstart preparado al inicio de la instalación permite realizarla automáticamente, sin necesidad de intervención del usuario. Esto es especialmente útil al implementar Fedora en varios sistemas simultáneamente.

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.

Cómo Llevar a Cabo una Instalación Kickstart

Las instalaciones Kickstart se pueden llevar a cabo usando un DVD local, un disco duro local o por medio de NFS, FTP, HTTP o HTTPS.

Para usar Kickstart, debe:

  1. Crear un archivo Kickstart.

  2. 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.

  3. Hacer disponible el archivo Kickstart en el medio extraíble, una unidad dura, o un lugar de red.

  4. Comience la instalación Kickstart arrancando el instalador y utilizando una opción de arranque para decirle al instalador donde encontrar el archivo Kickstart.

Este capítulo explica estos pasos en detalle.

Crear un Archivo Kickstart

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.

The recommended approach to creating Kickstart files is to perform a manual installation on one system first. After the installation completes, all choices made during the installation are saved into a file named anaconda-ks.cfg, located in the /root/ directory on the installed system. You can then copy this file, make any changes you need, and use the resulting configuration file in further installations.

Cuando cree un archivo Kickstart, mantenga en mente lo siguiente:

  • Las líneas comenzando con un signo de estrella (#) son tratados como comentarios y son ignorados.

  • Las secciones deben estar especificadas ordenadas. Los elementos con las secciones NO tienen que estar dentro de un orden específico en otro caso especificado. Esta sección correcta el orden es:

    • 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.

      The %packages, %pre and %post sections must end with %end, otherwise the installation program will refuse the Kickstart file. The main command section has no special ending statement.

  • Omitting any required item results in the installation program prompting the user for an answer to the related item, just as the user would be prompted during a typical installation. Once the answer is given, the installation will continue. Note that if the system you are installing has no display, you will not be able to see the prompt, and the installation will appear to have failed.

Verificar el Archivo Kickstart

When creating or customizing your kickstart file, it is useful to verify that it is valid before attempting to use it in an installation. Fedora includes the ksvalidator command line utility which can be used to do this. This tool is a part of the pykickstart package. To install this package, execute the following command:

# dnf install pykickstart

Tras la instalación del paquete, puede validar un archivo Kickstart utilizando la instrucción siguiente:

$ ksvalidator /ruta/para/kickstart.ks

Sustituye /ruta/a/kickstart.ks con la ruta para el archivo Kickstart que desea verificar.

Para más información sobre esta herramienta, consulte la página man ksvalidator(1).

Keep in mind that the validation tool has its limitations. The Kickstart file can be very complicated; ksvalidator can make sure the syntax is correct and that the file does not include removed options, but it cannot guarantee the installation will be successful. It also does not attempt to validate the %pre, %post and %packages sections of the Kickstart file.

Hacer Disponible el Archivo Kickstart

Una vez que cree un archivo Kickstart, puede ponerlo en uno de los lugares siguientes:

  • En medio extraíble, tal como un DVD o unidad flash USB conectada al sistema de instalación

  • En una unidad de disco conectada al sistema de instalación

  • En una red compartida disponible desde el sistema de instalación

Normally, a Kickstart file is copied to removable media or a hard drive, or made available on the network. Placing the file in a network location complements the usual approach to Kickstart installations, which is also network-based: the system is booted using a PXE server, the Kickstart file is downloaded from a network share, and software packages specified in the file are downloaded from remote repositories.

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.