Next Previous Contents

4. About the customization scripts

Kadeploy allows the customization of each node by 2 means:

Originally, these two scripts are written in ash, which is a lightweight bash, but the way these scripts are designed could allow to add any script language.

4.1 Preinstallation script

This script is common to all environments, its goal is to prepare the system to the hardware specification and the target hard disk drive for the deployment. It can load a specific IDE controller driver, improve deployment performance or make every kind of checks needed. This script is defined in the configuration file as pre_install_script and the associated archive as pre_install_archive.

Preinstallation archive structure

The preinstallation archive is a gzipped tar archive, containing the pre_install_script in its root directory. Here is an example of a preinstallation archive structure:

/
   init.ash
   lib/
   bin/
      awk
      df
      du
      xargs

The directory structure allows to custom the tasks to your needs. In this example, the pre_install_script is init.ash. Let's have a short look at this structure :

4.2 Postinstallation script

This script is associated to the environment to deploy. Its goal is to adapt the crude system image to a bootable system. It is composed of a gunzipped tar archive that contains all the sites files and a script traitement.ash in the archive's root directory. This archive is sent to the nodes, decompressed in a ramdisk and then the post_install_script is executed on every node. The script name is defined in the configuration file as post_install_script.

Postinstallation archive structure

The postinstallation archive is a gzipped tar archive, containing the post_install_script in its root directory. Here is an example of a postinstallation archive structure:

/
   traitement.ash
   etc/
      fstab
      hosts
      hosts.allow
      hosts.deny
      ntpdate
   authorized_keys

The directory structure allows to custom the configuration script to your needs. Let's have a short look at this structure :

System modifications

  1. /etc/fstab
    
    a site base file should be copied in the postinstall archive so that nfs mounts can be preserved and other site modifications could be preserved
  2. /tmp
    
    should have its rights modified

Administrative aspects

Many other basic files can be handled by putting them in the archive and replace the existing ones. They are not all listed here but only the most important ones :

  1. /root/.ssh/authorized_keys
    
    should contain the administrator's public key and also the public key of user deploy, to allow him to get a root shell on every node to reboot those. In order to do that this authorized_keys file has to be built and put in the archive's root directory
  2. /etc/hosts /etc/hosts.allow /etc/hosts.deny
    
    should be set to fit the cluster's configuration, and ensure network connection within the cluster's network

Numerous modifications can be done here, from authentification server to tailored modification depending on the node's IP. A good idea should be to modify rc scripts to prevent the first boot hard disk drive verification, because it is just a waste of time here, and avoid all the manual intervention that could occur on system boot : for example, by default, many distributions ask the root password before checking a filesystem on boot time.


Next Previous Contents