Open main menu

CDOT Wiki β

Changes

Bcfg2 Configuration

943 bytes added, 11:21, 30 October 2012
no edit summary
<pre>bcfg2 -vqn </pre>
 
===Client Daemon===
 
Although BCFG2 ships with a systemd unit and a SYSV init script, this is not the method for daemonizing the client software. The crontabs and cron-utils packages must be installed on the client for automatic checking in to occur. Additionally, the file /etc/sysconfig/bcfg2 can be modified to set the frequency of the cron tasks. This file contains documentation in the comments and does not need to be explained here.
==The BCFG2 Configuration Management System==
H file specify a file meant for a specific host. H files are used by creating a file called <filename>.H_<FQDN>. H files should only be files who's content are totally unique to that file, such as certificates or keys. If there are minor changes required, such as usernames, hostnames or the like the better option is to use a templating system such as [[#TCheetah|TCheetah]]. H files always take priority over G files.
 
====Info Files====
If you wish bcfg2 to push out executable scripts, or have specific permissions applied to files, the directory that contains the file must have a :info file.
 
Common entries for :info files include:
* Owner: the file owner
** Syntax-> owner: apache
* Group: The group ownership for the file
** Syntax-> group: libvirt
* Perms: File permissions
** Syntax-> perms: 755
===Metadata===
Metadata is where the [[#Configuring Clients|clients.xml ]] and [[#Configuring Groups|groups.xml ]] files reside. These have already been discussed previously in this documentation and this entry is here only for completeness' sake.
===Packages===
The Packages Plugin as implemented on the Armory Build farm has three prerequisites:
* A sources.xml file
* An architecture [[#Probes|probe]]
* [[#Package Bundles|Package Bundles]]
TCheetah is a python based templating system that can be used in bcfg2. To enable TCheetah to be used in bcfg2, add the entry "Metadata,TCheetah" to the end of the plugins line in /etc/bcfg2.conf on the server. This will enable the TCheetah plugin and the Metadata plugin, which allows TCheetah to access elements of the client's Metadata.
The main purpose of TCheetah is to enable dynamic file content to be generated based off of client details, say if a particular configuration file needs a hostname. The /var/lib/bcfg2/TCheetah directory uses a similar structure to the [[#Cfg|Cfg]] plugin, and can use [[#G Files|G]] and [[#H Files|H]] files. However, the template files must be named template. TCheetah can also use [[#Info Files| info files]].
The contents of the files themselves are similar to configuration files, however there are a number of variables that can be used in the files themselves. These variables all start with "$self.metadata" and are discussed in greater detail in the official documentation. The more commonly used ones are:
1
edit