Sun Management Center Change Manager 1.0 Administration Guide

Creating a Customizable Solaris Flash Archive

An archive might require that the user deploying it supply the information required to customize the archive for its production environment. To accomplish this, when you create the archive, include a special section that describes the required parameters, archive parameters. Also include custom JumpStart finish scripts to process the supplied values and modify the system accordingly.

Archive parameters are name=value pairs that are associated with the integrated software stack. These parameters provide the data to be processed by the finish scripts that are invoked to customize the software stack for the managed host. Custom JumpStart finish scripts are written by the stack creator. These scripts perform host-specific customizations on the managed host as part of the deployment process. Archive parameters obtain host-specific values through the Change Manager interface.

Creating the Archive Parameters File

An archive parameters file specifies application-specific parameters and default values. The archive parameters file contains entries in the following format:

The archive parameters file can be created by any text editor capable of saving files as plain ASCII text.

Following is a simple example of an archive parameter file:

name=telnet label="Do you want to enable telnet?" default=yes
name=ftp label="Do you want to enable ftp?" default=yes
name=finger label="Do you want to enable finger?" default=yes

Archive parameters must be described in a text file called ic_cfgparams. The file must be located in the directory from which the flar create command is invoked. This file must also be specified as a "user-defined section" of the Solaris Flash archive by using the -u option to the flar create command.

Processing the Archive Parameters File With Finish Scripts

As the final step in software stack deployment, Change Manager runs the finish scripts contained in the Solaris Flash archive. Change Manager provides a driver script that executes all user-supplied finish scripts that it finds in the /etc/ichange.d directory of the newly deployed software stack. This driver script provides access to the values specified in the archive parameters file, as supplied by the user.

Following is an example of a finish script that processes the archive parameters file created in the previous section:

#! /bin/sh

case `cmgetprop telnet` in
[Nn]*)  telnet='#'      ;;
*)      telnet=         ;;
esac

case `cmgetprop ftp` in
[Nn]*)  ftp='#'         ;;
*)      ftp=            ;;
esac

case `cmgetprop finger` in
[Nn]*)  finger='#'      ;;
*)      finger=         ;;
esac

ed $SI_ROOT/etc/inetd.conf <</
/^#*telnet/s/^#*/$telnet/
/^#*ftp/s/^#*/$ftp/
/^#*finger/s/^#*/$finger/
w
q
/

exit 0

When two or more finish scripts are included in the /etc/install.d directory, ensure that the ic_cfgparams file contains all of the parameters that the scripts process.

Store the finish scripts in the /etc/ichange.d directory prior to creating the Solaris Flash archive of the master system. The finish scripts must be part of the archive. If you have more than one finish script, they are processed in lexical order by file name.


Note -

The finish scripts must have permissions set to 755. If the scripts are not executable, then the Solaris Flash archive is not customizable.


Finish scripts use an environment variable called $SI_ROOT and a $PATH that includes the cmgetprop command.

Using flar create to Create a Customizable Solaris Flash Archive

Use the flarcreate(1M) command to create the Solaris Flash archive. The -u option includes the archive parameter file in the user section of the Solaris Flash archive.

For example, to create a customizable Solaris Flash archive named 082202.apache.flar, type the following:


# /usr/sbin/flar create -n apacheServer -u ic_cfgparams \
-c /flarchive/082202.apache.flar

/flarchive is the target directory name in which the Solaris Flash archive is created. The example command line creates an archive named 082202.apache.flar in the target directory.