cbais_conf - CBAIS configuration files
There are a number of configuration files in the CBAIS application. The
CBAIS.conf file is the global configuration file. It defines site wide
settings, options, the local projects.
Each host in the system may have a CBAIS host config file (usually
hostname.conf. This file defines the actual disk partitioning, operating
system, and application configurations for the host.
The CBAIS.conf config file contains the following sections. Each section
corresponds to a named scalar reference to perl anonymous hash.
The Options section defines the settings of optional parameters used
throughout CBAIS. They are listed below
- PathSeparator
-
The string to use for seperating search path elements in the specific file
matches. Usually set to '::'. Setting to a / will result in host specific
files being stored in directory trees. The characters used must not occur in
ARCHITECTURE, OS_RELEASE, or OS names.
- DNSLookups
-
May be set to one of ``on'' or ``off''. Defines whether hostnames will be
resolved using dns when CBAIS is loading its host specifier modules.
- ClassFileSpecifiers, DiskSetFileSpecifiers, CopyFileSpecifiers,
AppendFileSpecifiers, PkgFileSpecifiers
-
Defines the degree of host specifier to use for the various files types in
CBAIS - config files: class, diskset, and os profile, and data:
copy, append, and pkgs. The example below demonstrates directory
structure and filename suffixes for a class (config) file for each of the
possible settings.
- Arch
-
Files are located in an architecture (and Operating system) dependent
directory tree. e.g. conf/Classes/Linux::2.2.16-22::i686/Class.cf
- Host
-
Files are located in directory tree with host specific suffix qualifiers
only. e.g. conf/Classes/Class.cf.{hostname,domain,alias}.
- All
-
Files are located in a directory tree with architecture (and Operating
system) dependent directory tree with host specific qualifiers.
e.g.conf/Classes/<OS::<OS_RELEASE>::<ARCH>/Class.cf.{hostname,domain,alias}>
- None
-
No specifiers are used. e.g. conf/Classes/Classfile.cf.
- LocalSpoolDir
-
The directory to use on client machines to store serialised action files,
or unpack data files when operating in push mode. If it does not exist it
will be created as required.
The Actions section defines an anonymous hash which maps the valid actions
and the perl packages which implement them. The classes must implement the
CBAIS::Actions:Action interface. There is also an ability to specifiy filters
to operate on the class config files before they are passed to the action
object constructors (via the filters section).
e.g.
$Actions = {
append => { package => 'CBAIS::Actions::Append', },
cmd => { package => 'CBAIS::Actions::Cmd', },
copy => { package => 'CBAIS::Actions::Copy',
filters => [ 'CBAIS::Config::UIDFilter', ], },
...
};
The Projects section defines the projects and their specific
configurations which are valid for this site. A project is a directory
tree of CBAIS configs and data. Individual hosts can be configured to look
for their configuration and data in different projects (in a defined search
order). Thius enables administrators to segregate control of machines to
different user groups. An example projects definition is shown below.
$Projects = {
project2 => {
root => "$ENV{CBAIS_ROOT}/project2",
},
project1 => {
root => "$ENV{CBAIS_ROOT}/project1",
},
default => {
root => "$ENV{CBAIS_ROOT}/default",
},
};
The CBAIS host config file is used to define the actual configuration of a
host. This includes the configuration of disks, operating system, and
applications which are installed on the host. The file must be a valid perl
script which returns an anonymous hash. The following keys are recognised in
the CBAIS host config file.
- cbais_options
-
array of cbais comand line options which are to be passed to cbais when
running.
- classes
-
Defines the CBAIS configuration. A list of CBAIS classes to install on the
host.
=item B<ethernet>
The ethernet address of this host. If the host has multiple interfaces this
should be the primary interface's address.
- ip-address
The ip address of this host. If the host has multiple interfaces this
should be the primary interface's address.
-
- kickstart_file
-
The kickstart file to use for this host. If not defined defaults to
$CBAIS_ROOT/RedHat/ks.cfg/<hostname>.
- aliases
-
The aliases for this host. These will be used in locating host specific files
as well as for generation of dns and dhcp configuration files.
- keyboard
-
the keyboard type for this host. May be set to none.
- lang
-
the language to set for this host (e.g.en_US).
- mouse
-
the mouse type for this host (e.g. generic3). maybe be set to none.
- timezone
-
the timezone for this host (e.g. Australia/Sydney). maybe be set to none.
- install_server
-
the install server for this host.
An example file is shown below
require 'Classes.conf';
# return
{
ethernet => '00:a0:24:76:f4:70',
ip-address => '192.168.0.33',
kickstart_file => '/export/cbais/RedHat/ks/zetland',
aliases => [ 'ldap' ],
cbais_options => ['-a!patches', '-v' ],
classes => [ 'I3SP_CLIENT', ],
};
There are a number of environment variables which may be used to alter CBAIS
default behaviours.
- CBAIS_ROOT
-
The root of the cbais directory tree. Must contain a conf, misc_perl and
current symlink pointing at CBAIS version to use.
- CBAIS_VERSION
-
If set, indicates that this version of CBAIS should be used rather than the
one pointed to by the current symlink in $CBAIS_ROOT.
- CBAIS_CONF
-
The name of the CBAIS master config file to load. If not set the file
CBAIS.conf is loaded.
- CBAIS_ENABLE_RPM
-
enables the rpm action. BY default it is not enabled unless the operating
system is alinux derivative ($^O eq 'linux').