The Class Based Auto Install System or CBAIS is a tool for installing and managing the ongoing configuration of unix hosts across a network. Amongst other features it provides
CBAIS-V1_0a is an alpha release. It has been tested on RedHat Linux 7 and 7.1, and Solaris 5.7 and 5.8. It should run on any unix system (with perl installed). See the support section below for more information or help in using CBAIS on other unix platforms.
[mos@avalon mos]$ mkdir cbais [mos@avalon mos]$ cd cbais [mos@avalon cbais]$ tar -zxf ../latest.tar.gz [mos@avalon cbais]$ tar -zxf ../perl-libs.tar.gz [mos@avalon cbais]$ ll total 36 drwxrwxr-x 7 mos mos 4096 Jun 21 13:08 . drwxr-xr-x 20 mos mos 4096 Jun 21 13:08 .. -rw-rw-r-- 1 mos mos 795 Jul 21 14:51 .example_env -rw-r--r-- 1 mos mos 1455 Jun 20 16:01 LICENSE drwxrwxr-x 5 mos mos 4096 Jun 14 14:55 RedHat drwxrwxr-x 5 mos mos 4096 Jun 14 14:55 Solaris drwxr-xr-x 5 mos mos 4096 Jun 15 11:14 cbais-1.0b drwxrwxr-x 2 mos mos 4096 Jun 20 14:41 conf lrwxrwxrwx 1 mos mos 12 Jun 21 13:08 current -> cbais-1.0a drwxr-xr-x 8 mos mos 4096 Jun 20 12:05 example -rw-rw-r-- 1 mos mos 188 Jun 20 14:54 .example_env
[mos@avalon cbais]$ . .example_env [mos@avalon cbais]$ cbais show example_host Loaded example_class config (4) actions) Loaded local_accounts config (5) actions) Loaded auto_mounter config (5) actions) Class example_class =================================================== append /home/mos/cbais/example/append/example_class/etc/system -> /tmp/etc/system cd /tmp/etc; tar -zxf /home/mos/cbais/example/pkgs/example_class/tarball.tar.gz cchmod /tmp/etc/tarball/file* you.you 0644 Class local_accounts =================================================== mkdir /tmp/etc root.root 0755 copy /home/mos/cbais/example/copy/local_accounts/etc/passwd /tmp/etc/passwd root.root 0644 copy /home/mos/cbais/example/copy/local_accounts/etc/group /tmp/etc/group root.root 0644 copy /home/mos/cbais/example/copy/local_accounts/etc/shadow /tmp/etc/shadow root.root 0600 Class auto_mounter =================================================== copy /home/mos/cbais/example/copy/auto_mounter/etc/auto.master /tmp/etc/auto.master root.root 0644 copy /home/mos/cbais/example/copy/auto_mounter/etc/auto.misc /tmp/etc/auto.misc root.root 0644 copy /home/mos/cbais/example/copy/auto_mounter/etc/auto.home /tmp/etc/auto.home root.root 0600 automount -vNow you can execute the cbais configuration for host example_host. Note that because we have the environment variable CBAIS_INSTALL_ROOT (look in the .example_env file) set to /tmp, all operations will effectively be chrooted i.e. not be performed on your host in place.
[mos@avalon cbais]$ cbais execute example_host Loaded local_accounts config (5) actions) Loaded example_class config (4) actions) Loaded auto_mounter config (5) actions) Processing Class local_accounts =================================================== mkdir /tmp/etc root.root 0755 succeeded copy /home/mos/cbais/example/copy/local_accounts/etc/passwd /tmp/etc/passwd root.root 0644 succeeded copy //home/mos/cbais/example/copy/local_accounts/etc/group /tmp/etc/group root.root 0644 succeeded copy /home/mos/cbais/example/copy/local_accounts/etc/shadow /tmp/etc/shadow root.root 0600 succeeded Processing Class example_class =================================================== append /home/mos/cbais/example/append/example_class/etc/system -> /tmp/etc/system succeeded cd /tmp/etc; tar -zxf /home/mos/cbais/example/pkgs/example_class/tarball.tar.gz succeeded cchmod /tmp/etc/tarball/file1,/tmp/etc/tarball/file2 you.you 0644 succeeded Processing Class auto_mounter =================================================== copy /home/mos/cbais/example/copy/auto_mounter/etc/auto.master /tmp/etc/auto.master root.root 0644 succeeded copy /home/mos/cbais/example/copy/auto_mounter/etc/auto.misc /tmp/etc/auto.misc root.root 0644 succeeded copy /home/mos/cbais/example/copy/auto_mounter/etc/auto.home /tmp/etc/auto.home root.root 0600 succeeded Linux automount version 3.1.7 automount -v succeeded
[mos@avalon cbais]$ cbais -c auto_mounter -acopy verify example_host Loaded auto_mounter config (4) actions) Class auto_mounter =================================================== copy /home/mos/cbais/example/copy/auto_mounter/etc/auto.master /tmp/etc/auto.master root.root 0644 OK copy /home/mos/cbais/example/copy/auto_mounter/etc/auto.misc /tmp/etc/auto.misc root.root 0644 OK copy /home/mos/cbais/example/copy/auto_mounter/etc/auto.home /tmp/etc/auto.home root.root 0600 OK [mos@avalon cbais]$If a file has been editted directly on a host the verify operation will report the differences.
[mos@avalon cbais]$ cbais -c auto_mounter -M auto.master verify example_host
Loaded auto_mounter config (2) actions)
Class auto_mounter ===================================================
Files /export/home/mos/cbais/example/copy/auto_mounter/etc/auto.master /tmp/etc/auto.master differ:
1a2
> some one editted this file directly!
diff returned : 1
[mos@avalon cbais]$
CBAIS is only as good as the configurations it is implementing. Understanding the configuration setup and the things you can do with it is fundamental to getting the most out of CBAIS.
The primary aim is to reuse units of configuration logic. These are encapsulated in a class. Classes are applied to a machine, or more usually machines. Classes may be grouped together, to form higher levels of configuration logic. The ability to specialise instances of classes (by host and architecture specific data files, and project search paths) allows CBAIS to provide automation, reuse, and audit capability for machines across networks, while reducing the workload on the administrator.
The directory layout of a CBAIS project config and data tree is as follows.
| Directory | Content |
|---|---|
| conf/Classes | dir tree for class (config) files |
| append/classname/filename.suffix | dir tree for append data files |
| copy/classname/filename.suffix | dir tree for copy data files. |
| packages | dir tree for SVR4 package data files. |
| pkgs | dir tree for tarball data files. |
| rpms | dir tree for RPM data files. |
Individual hosts can be configured to search through multiple directory trees (i.e. projects).
A class is a collection of actions, grouped together (hopefully) in a unit
of configuration logic (e.g. set up local automounter maps). Actions can be one
of any listed on the CBAIS.conf file (L
On its own, the ability to reuse Classes by applying them to multiple machines would not be of great use. CBAIS provides a mechanism which allows the logic of a class to be reused with instance specific data. The Host Specifier Engine allows specific versions of files (both config and data) to be loaded based on the operating system (type and version), architecture, hostname (and aliases), domainname (DNS, nis, ...) and network of a host.
The host specifier engine allows specifi versions of files to be loaded using a a directory tree and file suffix based search path. An example is probably the best way to start.
Whenever B
Say we have a class I
#
# local_accounts.cf
return [
{
action => 'copy',
owner => 'root',
group => 'root',
mode => '0644',
file => '/etc/passwd',
dont_remove => 'yes',
},
{
action => 'copy',
owner => 'root',
group => 'root',
mode => '0600',
file => '/etc/shadow',
dont_remove => 'yes',
},
{
action => 'copy',
owner => 'root',
group => 'root',
mode => '0644',
file => '/etc/group',
dont_remove => 'yes',
},
];
Our data tree would look like this
local_accounts/etc/passwd local_accounts/etc/passwd.bart local_accounts/etc/shadow local_accounts/etc/shadow.bart local_accounts/etc/group local_accounts/etc/group.bart
with the filename.bart files containing the versions for host bart. Now when a cbais show is done on bart we see
[root@bart /cbais]# cbais -M passwd show copy /cbais/default/copy/local_accounts/etc/passwd.bart /etc/passwd root.root 0644
whereas on larry (or lenny or bobby) we see
[root@bart /cbais]# cbais -M passwd show copy /cbais/default/copy/local_accounts/etc/passwd /etc/passwd root.root 0644
Managing multipe machine configurations can be further streamlined by grouping class configs together. The suggestion for this is to have a Classes.cf file which defines lists of classes which are reused. For example
#
# Classes.cf
@Local_Client = ("automounter", "local_accounts", "mail_client", "print_client" );
@Firewall = ("local_accounts", "fw", "mail_bastion", );
Now in our host config file we just require the Classes.conf file.
[mos@newtown conf]$ cat larry.conf
# -*- perl -*-
require 'Classes.conf';
# return
{
ethernet => '00:00:21:FF:27:21',
ip_address => '192.168.0.100',
kickstart_file => '/cbais/RedHat/ks/larry,
classes => [ @Local_Client, ],
};
[mos@newtown conf]$ cat lenny.conf
# -*- perl -*-
require 'Classes.conf';
# return
{
ethernet => '00:00:21:FF:27:25',
ip_address => '192.168.0.100',
kickstart_file => '/cbais/RedHat/ks/lenny,
classes => [ @Local_Client, ],
};
If you have run the demonstration configs and are thinking about using CBAIS in earnest, its time to look at some of the reference documentation. The manual pages can be viewed online here.
Copyright (c) 2001, i3SP Pty Ltd (ABN 40 092 302 237) All rights reserved. Redistribution and use, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions must retain the above copyright notice, this list of conditions and the following disclaimer. 2. All advertising materials mentioning features or use of this software must display the following acknowledgement: This product includes software developed by i3SP Pty Ltd and its contributors. 3. Neither the name of the i3SP Pty Ltd nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY i3SP Pty Ltd AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL i3SP Pty Ltd OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
cbais-1_0b is an beta release. It has been tested on RedHat Linux 7 and 7.1. Future releases will add a number of features including
If you woud like to provide feedback, submit bugs, feature requests or ideas for CBAIS, send email to cbais@i3sp.com.
If you would like to purchase support or obtain help in setting up a CBAIS deployment, please contact i3sp.
CBAIS is a result of
Finally, with ongoing management being as important a feature as hands free installation CBAIS should probably have another M for management in its name but if you do a search for CBAIMS you'll see why it doesn't.