[Asterisk-Users] Config Revision Control

Tim Panton tim at mexuar.com
Sat Jun 3 06:25:14 MST 2006


On 2 Jun 2006, at 21:42, Douglas Garstang wrote:

> Has anyone got any neat solutions for Asterisk .conf file revision  
> control?
>
> We have multiple Asterisk boxes here, that we'd like to maintain a  
> _mostly_ common set of conf files on. They aren't all the same  
> though. There's subtle differences. For example, in sip.conf,  
> iax.conf etc, the bindaddr setting is different. Dundi.conf is very  
> different between each system.
>
> At the moment I have a file tree on a separate server, and I use  
> the m4 processor to replace certain unique sections of the files. I  
> have a bunch of scripts to build sip.conf etc and then rsync the  
> files out to the servers. It works, mostly, but it isn't elegant.
>
> I'd like to revision control all this. I don't know how it could be  
> done with revision control though. As I said, not all the files are  
> the same. I don't know if we'd run a version control client on each  
> Asterisk box, or if we'd run it centrally, and then use rsync  
> again, to copy the files out.

Here are some general rules we apply to this sort of config/ 
distribution/version-control set up
across multiple non-identical servers
(Mostly learnt in the web-server world, but it applies generally I  
think)

	1) Never check in derived files. Only check in the _inputs_ to M4,  
never the outputs.
	2) do the 'localization' (ie server specific config) on the target  
server itself, ideally
automatically - never depend on user input - get the server to tell  
the install script what
it needs to know.
	3) don't user rsync unless all the files are identical

so you might have
checkitallout.sh
(use appropriate svn stuff - I'm a cvs user, so can't help there)
then a script that customizes and installs the files as needed,
with likes like:

cpp -Dhost=`uname -n` -Darch=`uname -m` iax.conf.generic /etc/ 
asterisk/iax.conf

or even
cpp -I`uname -n` iax.conf.generic /etc/asterisk/iax.conf
with
#include "iax.conf.local"

in iax.conf.generic and subdirectories for each host with their own  
iax.conf.local

Good luck.

Tim Panton
tim at mexuar.com






More information about the asterisk-users mailing list