Configuration and change management with Bcfg2

Making Packages

Bundles can be broken down still further: Bcfg2 groups the configuration files and software packages belonging to a specific system service in a file below the Bundler directory. For example, the Bundler/motd.xml file defines the configuration bundle for the /etc/motd welcome message:

<Bundle name='motd' version='2.0'>
   <Package name='login' />
   <ConfigFile name='/etc/motd' />
</Bundle>

Some nicely commented examples of bundles are available from the project's wiki [5]. Bundles contain a number of configuration items, which Bcfg2 aptly refers to as entries.

The system defines six different entry types (see Table 1): The ConfigFile type manages a file and its content; the Directory, Permission, and SymLink types let administrators manage or monitor objects. The Package and Service types of entries have more in the way of artificial intelligence.

Bcfg2 abstracts the distribution-specific methods used to, for example, install a package on a client; that is, it will call aptitude on a Debian system and rpm or yum on an openSUSE system. The same principle applies to system services that are typically listed in /etc/init.d.

Installing the Server

The abstract structure that describes the client is managed entirely on the server side. Typing bcfg2-admin init initializes a new configuration.

First, you are prompted for the details of the repository path, an SSL certificate for secure communications with the clients, and an access password. The Bcfg2 admin script then goes on to create several files and directories and populate the /etc/bcfg2.conf configuration file with meaningful defaults. You might need to modify the entry in the [components] section to match the hostname, which your clients can resolve with DNS.

This name is also the perfect choice for the Common Name when you generate a certificate. bcfg2-admin might create the file with world-readable permissions, but you will want to change this because it contains the client access password.

Additionally, the tool sets up an empty configuration repository below /var/lib/bcfg2. Calling /etc/init.d/bcfg2-server start launches the server.

Client Configuration

The only component you need to install on the client is the bcfg2 client package. Additionally, you need to store the configuration file in /etc/bcfg2.conf.

The next step is to add each Bcfg2 client to the Metadata/clients.xml file on the server (Listing 2). All specifications use the XML format. The administrator can later assign profiles to hosts by using this file.

Listing 2

Registering Clients

01 01 <Clients>
02 02   <Client profile="desktop"
03              name="alpha.example.com" pingable="N"/>
04 03   <Client profile="desktop"
05              name="beta.example.com"  pingable="Y"/>
06 04   <Client profile="webserver"
07              name="gamma.example.com" pingable="N"/>
08 05   <!-- .. --!>
09 06 </Clients>

Bcfg2 identifies clients by their DNS names, which makes it important to have a working DNS system. The example assigns the desktop profile to the hosts alpha and beta.example.com and webserver to gamma.example.com. Bcfg2 is now ready for action.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Network Management Intro

    Professional admins with tightening IT budgets are always looking for new tools that will help them do more with less. This month we feature some popular open source applications for deploying, configuring, updating, and monitoring software and systems on the network.

  • Cfengine 3

    Automate admin tasks with the powerful Cfengine framework.

  • SCPM

    SCPM lets you switch your network configuration when your portable moves to a different network. Read on to learn more about deploying the SCPM profile manager with Suse Linux.

  • Radius and 802.1X

    The Radius protocol is typically used to authenticate users in dial-up scenarios. But Radius is also useful in LAN environments: in combination with 802.1X, Radius forces users to authenticate at a low level before the switch opens up a port.

  • FAI

    FAI helps you automate the process of installing and configuring new Debian systems.

comments powered by Disqus

Direct Download

Read full article as PDF:

030-035_bcfg.pdf  (884.49 kB)

News

njobs Europe
What:
Where:
Country:
Njobs Netherlands Njobs Deutschland Njobs United Kingdom Njobs Italia Njobs France Njobs Espana Njobs Poland
Njobs Austria Njobs Denmark Njobs Belgium Njobs Czech Republic Njobs Mexico Njobs India Njobs Colombia