Customizing the Provisioning Process
After provisioning templates and roles have been created, the provisioning process can be tuned and enhanced to include the installation of applications, the execution of scripts and the copying of files onto the system being provisioned.
Customizing the provisioning process is done by editing the control (configuration) file kickstart.cfg
| • | MAC-Specific Provisioning: |
There are 2 ways to customize the provisioning process:
| 1) | For a given Provisioning Role Template, edit the Template data in the GUI: |

| 2) | To customize the master Template that builds all GUI templates, edit the file directly: |
/home/tftpboot/templates/rhel5_5_x86_64ks.tmpl
After you have edited this file, all GUI templates you create will be populated with the file that you edited. Be sure to make a backup copy of the .tmpl file before you edit it.
Caution: If you alter any line containing either ";;" or "$", you may corrupt the template. Below are sample lines that should not be modified:
# ;;distro_template_file="rhel5_5_x86_64ks.tmpl"
# machine_name......................$machine_name
# ip_address........................$node_ip_address
| • | MAC-Independent Provisioning |
MAC-Independent configuration files are located in the pub/ directory under the Linux distribution directory. For example:
/home/tftpboot/pub/rhel5_5_x86_64/rhel5_5_x86_64.cfg
Caution: back up any modifications you make to these control files because when you upgrade your LinMin Server or when you run setup.pl to change the default host name, password and other parameters, your changes will be overwritten!
Forcing the use of a specific NIC (e.g. eth0) during provisioning
To force the use of a specific NIC during provisioning, use the "ksdevice" kernel parameter: For example, for eth0 to be used, in the GUI (MAC-Spec Template or MAC-Indy Role), enter into the "Kernel Parameter" field: ksdevice=eth0 |
Customizing the kickstart file
Whether it's a .cfg (MAC-Indy) or .tmpl file or it's modified in the GUI (MAC-Spec), customizing the provisioning of Red Hat-based Linux distributions follows the "kickstart" methodology.
For more information on Anaconda/kickstart options, go to http://fedoraproject.org/wiki/Anaconda/Options
To change what packages get installed when the operating system gets installed, locate the section that begins with the following designation: %packages All user-defined software that is to be installed during provisioning must be entered under this %packages section of the profile template. Individual packages are listed by name with no symbol or space in front, as is shown for the dhcp package in screen shot below. Groups are listed with the @ symbol and one space in front of the group name as is shown for the GNOME Desktop Environment package below. (The groups that the Kickstart control file recognizes are listed in the Red Hat--or Red Hat-based--distribution's comps.xml file.)
Use the "#" symbol to comment out names of packages you do not wish to have installed.
Further options available with the Kickstart control file's %packages installation are:
Install the listed packages and automatically resolve package dependencies. If this option is not specified and there are package dependencies, the automated installation pauses and prompts the user: %packages --resolvedeps
Ignore the unresolved dependencies and install the listed packages without the dependencies: %packages –ignoredeps
Ignore the missing packages and groups instead of halting the installation to ask if the installation should be aborted or continued: %packages –ignoremissing
More information is available at: http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/s1-kickstart2-packageselection.html
Note: The RHEL 5.3 and CentOS 5.3 ISOs have a bug https://bugzilla.redhat.com/show_bug.cgi?id=483094 whereby GMT time zones were omitted from the release. The workaround to avoid having to manually enter the time zone during provisioning is to edit the template control files (.tmpl). For example, to enter your correct time zone edit the file: /home/tftpboot/templates/rhel5_3_x86_64ks.tmpl Locate in the file: timezone --utc $node_time_zone and replace it with: timezone --utc America/Los_Angeles |
Installing application software including Third Party Agents during provisioning can be done as described in this section. For illustration purposes only, “Agent” in a “.exp” format will be used in this User's Guide as an example. Substitute your own Agent (IBM Tivoli, HP OpenView, BMC, etc.) and your other applications and installation mechanisms in the instructions provided below.
Copy the applications to be installed to the LinMin Server: Repeat the steps in this section for each Linux distribution with which Third Party Agents will be installed during provisioning: R Step 1 – Obtain the linmin-install.exp program Download the Agent installation program from your Agent vendor's download site. R Step 2 – Execute the extract-for-provision program Change to the directory where you downloaded the linmin-install.exp program and execute the following command: ./linmin-install.exp extract-for-provision <agent.os> Executing the linmin-install.exp command creates the provisioning program, which is named: linmin-provision-<agent.os>.exp. R Step 3 – Copy the linmin-provision-<agent.os>.exp program to the correct directory Copy linmin-provision-<agent.os>.exp to the /home/tftpboot/pub/linmin directory
Edit the Kickstart file: The Red Hat-based control file (the Kickstart control file) has the extension ".cfg" (for example, rhel.cfg). Import the control file for your Red Hat-base distribution into the LinMin Server's Profile Template Edit page, and locate the section that begins with the following designation: %packages Immediately following the last package/file name in the %packages section, add the following section to your Kickstart control file. For <agent.os>, use the name of your application. The value for <group_name> must match the LinMin Server group in which the Agent(s) will be installed.
%post #----------------------------------------------------------------- # #We are chrooted when this part runs. #This post-install installs Agent on the system being provisioned. #------------------------------------------------------------------- touch /root/postinstall.log #change for correct rsync launch chkconfig --level 345 rsync on # Acquire installation data cd /root wget -r -nv -nH -–cut-dirs=2 http://<your_LinMin Server_ip_address>/tftpboot/pub/linmin/linmin-provision- \ <agent.os>.exp # Install agent cd /root/LinMin chmod 755 linmin-provision-<agent.os>.exp ./linmin-provision-<agent.os>.exp <group_name> >& /root/postinstall.log # Place configuration files #chkconfig --add linminagent chkconfig --level 345 linminagent on echo "Received and placed config files." >>/root/postinstall.log echo "Finished." >>/root/postinstall.log cat > /etc/sysconfig/network << EOF NETWORKING=yes HOSTNAME=<hostname_of_local_machine> EOF When all information has been added, save and close your Kickstart file.
If you are installing Agents on RHEL. 4.1, RHEL 4.2, or CentOS 4.2, ensure the Kickstart file contains an instruction to disable SELinux. Examine the Kickstart file for the following line: (It is frequently located under the #Firewall configuration section.) selinux –-disabled If this line is not present, add it to the file. |
The following example show how to run scripts immediately after installing a Red Hat-based Linux distribution. We will use a LinMin-supplied script that captures major system settings and places them in a text file.
On the LinMin Server:
# make a script available via wget mkdir /home/tftpboot/www/postscripts cp -p /usr/local/linmin/lbmp-boxinfo.sh /home/tftpboot/www/postscripts/
Modify the kickstart control file to “wget” and execute the lbmp-boxinfo.sh script:
%post cd /tmp wget http://192.168.1.54/tftpboot/www/postscripts/lbmp-boxinfo.sh ./lbmp-boxinfo.sh > lbmp-boxinfo.sh-txt
After having provisioned a system, note the files copied and created by LBMP:
[root@PXE_Provisioned_Client ~]# ll /tmp/lbmp-boxinfo* -rw-r--r-- 1 root root 76851 Jan 18 03:02 /tmp/lbmp-boxinfo_MAC-00-0C-29-92-1C-87_IP-192-168-1-99_20090118-030120.txt -rw-r--r-- 1 root root 6089 Jan 17 20:32 /tmp/lbmp-boxinfo.sh -rw-r--r-- 1 root root 77125 Jan 18 03:02 /tmp/lbmp-boxinfo.sh-txt
|
Post-Install Package Installation & Updates
Assuming the client system has access to a yum or Red Hat repository, edit the %post portion of the control file to install or update packages. Alternatively, use wget to first copy files from your LinMin Server to the client system:
# Check the remote repository for updates to specific packages yum update packageName
# Install specific RPM packages rpm -ivh package1Name.rpm package2Name.rpm
# Update specific RPM packages rpm -Uvh package1Name.rpm package2Name.rpm |
If wish to provision a version of Linux that is not supported by LinMin and you have used "loadlinux.pl" to place an unsupported ISO into a supported OS directory, please note the paths and file names for the kernel (“vmlinuz”) and ramdisk (initrd), as well as the control file (*.cfg) in the image above (and use the "Browse" buttons to navigate to the appropriate files.)