Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

keeping two config files in sync

by mhearse (Hermit)
on Sep 12, 2012 at 18:00 UTC ( #993274=perlquestion: print w/ replies, xml ) Need Help??
mhearse has asked for the wisdom of the Perl Monks concerning the following question:

I have two plain configuration files for two environments: production and hot standby. The config files are in git. Users only make changes to the production config file. This of course results in a stale hot standby config. I'm wanting input on various methods to keep these files in sync. They are not identical. Different hostnames/ips/ports/etc. I'm kinda stumped. One method I thought of would be to use a templating system of some sort. These can't go into cms software (puppet/cfengine). Any ideas?

Comment on keeping two config files in sync
Re: keeping two config files in sync
by choroba (Abbot) on Sep 12, 2012 at 18:22 UTC
    What about using git's commit hooks to generate the actual config file? You can even use a templating system in them, but if the config is not too complicated, you might go without it.
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
Re: keeping two config files in sync
by stonecolddevin (Vicar) on Sep 12, 2012 at 18:45 UTC

    Seems to me that I would make config changes on standby/pre-production and promote them to production, as a number of safeguards are enabled by doing that alone.

    Three thousand years of beautiful tradition, from Moses to Sandy Koufax, you're god damn right I'm living in the fucking past

Re: keeping two config files in sync
by ig (Vicar) on Sep 12, 2012 at 20:05 UTC

    I would change the config file so that it contained a section for each environment or server and the servers selected the correct section at runtime. In these sections, I would only put the parameters that are server or environment specific. Any parameters that are common to all environments and servers would be expressed only once. In this way, each server or environment would have its unique configuration but the same config file would be used in each environment. It also makes it easy to see what the differences are between servers and environments.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://993274]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2014-10-25 22:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (149 votes), past polls