[asterisk-users] Parameterize asterisk config files

Ishfaq Malik ish at pack-net.co.uk
Wed Oct 3 03:26:33 CDT 2012


On Tue, 2012-10-02 at 19:34 -0400, Paul Belanger wrote:
> On 12-10-02 06:39 PM, Mitch Claborn wrote:
> > Asterisk 1.8 on Ubuntu
> >
> > We store the configuration files in CVS.  We have a development, QA and
> > production environments. 90% of the config files are the same across all
> > 3 environments, but there are some differences in sip.conf and
> > extensions.conf (environment specific voip providers and/or
> > analog/digital lines).  I'd like to be able to use the same config files
> > in CVS and have the differences resolved at run time, based on host name
> > of the asterisk server.
> >
> > Any ideas how to do this?
> >
> > I looked at STS, but it appears to be Mac only.
> >
> > One idea would be to use something like
> >
> > #include sip-$$$hostname$$$.conf
> >
> > and then use sed or similar in the startup script to replace
> > $$$hostname$$$ with the actual host name.  Then each host/environment
> > would have it's own include file as needed.
> >
> > Another idea would be to write a simple perl or other program to
> > pre-process the files and put some markers in the files themselves.
> > ; onlyif host=abc
> > ; /onlyif
> > The pre-processor would delete lines between the tags that didn't match
> > the currently running host.
> >
> If you are going to astricon you'll want to show up for my talk.  This 
> is basically what Leif and I will be talking about.
> 
> I use puppet to help manage our 3 environments (test, stage and 
> production). Along side it I use a the following configuration setup[1] 
> plus some Debian packaging scripts[2].
> 
> With this, I can quickly spin up instances which are provisioned to a 
> base. Then, depending on puppet manifests[3] for each node, it defines 
> how the system is then provisioned.
> 
> If more per-site settings are required, I'll roll them into Debian 
> packages (we use Ubuntu 12.04) and have each site subscribe to a 
> customer repo.
> 
> [1] 
> https://github.com/kickstandproject/asterisk/tree/master/debian/ast_config
> [2] 
> https://github.com/kickstandproject/astricon-2012-presentation/tree/master/debian
> [3] 
> https://github.com/kickstandproject/puppet-modules/tree/master/modules/asterisk/manifests

This is how we do it as well, and then control the puppet config files
using GIT

Ish
-- 
Ishfaq Malik <ish at pack-net.co.uk>
Department: VOIP Support
Company: Packnet Limited
t: +44 (0)845 004 4994
f: +44 (0)161 660 9825
e: ish at pack-net.co.uk
w: http://www.pack-net.co.uk

Registered Address: PACKNET LIMITED, 2A ENTERPRISE HOUSE, LLOYD STREET
NORTH, MANCHESTER
SCIENCE PARK, MANCHESTER, M156SE
COMPANY REG NO. 04920552




More information about the asterisk-users mailing list