CFEngine controls the configuration of many systems in the aglt2 cluster. The configuration settings are stored in an svn repository to aid in versioning and multiple user collaboration. The repository can be viewed online at https://ndt.aglt2.org/viewvc/cfengine/
Modifying existing configuration
In this tutorial we will modify the CFEngine configuration for the DNS servers by adding entries for a new UPS and push the results to them. The configuration is stored in an SVN repository. The SVN repository can be checked out and modified from any machine in the aglt2 cluster.
svn co svn+ssh://email@example.com/cfengine/trunk
In this example we will use a copy of the repository that is already checked out. ssh into the cfengine server and enter the cfengine directory.
Here there are several directories. Here we are interested in masterfiles and tools.
First we enter the directory of the files of interest and edit them
Add the following line to rocks.domain (Note that it is ordered alphabetically by hostname):
ups-118-1 A 10.10.142.148
Then add the following line to reverse.rocks.domain.142.10.10
148 PTR ups-118-1.msulocal.
The serial number must be updated. Run the following script to automatically update it based on the date and time:
Now we can push the changes to the server.
CFEngine should pull the new configuration to the DNS server within a couple of minutes, but a pull can also be initiated manually. In another terminal, ssh into the DNS server
The CFEngine log file can be checked in /var/cfengine/promise_summary.log
To force an update, use
Now in the original terminal, check that the DNS is working properly.
When you have verified that the changes have been successful, commit the changes to SVN.
svn commit -m "Added DNS entry for rack 118 UPS"
Pushing changes to the server
The CFEngine server itself requires a slightly different process to commit changes to. Begin by logging in as root.
> $ ssh root@msucfe
> # sh /var/cfengine/svn-trunk/tools/make-master.sh
> # cf-agent -K
Needs a better way to test updates before production deployment.
- 09 Nov 2012