[NZLUG] Managing multiple-machine application configs with DVCS

Tom Skunca tomislav.skunca at gmail.com
Tue Jun 4 17:35:08 NZST 2013


On Tuesday 04 June 2013 16:52:00 Jim Cheetham wrote:
> I'm looking for some advice on ways to manage the operational configs
> of a bunch of almost-completely-the-same machines, in this case using
> git but I expect working patterns from other DVCSs will apply well
> enough ... (No, puppet and friends are not currently a useful answer)
> 
> So, I have a bunch of machines with the same app on each, where the
> app config directories are 99% the same. It seems to make sense to
> have each machine's directory in git, and have a single upstream copy
> of the repository. Some files are volatile; I can ignore those OK.
> When I make a change to the config to one host, I can push it to the
> central repo, and from there get it to the other hosts.
> 
> My current problem however is that some files have unique lines, e.g.
> http config files with ServerName lines. I'd like to be able to track
> the file for changes to the other lines in the config, which are
> significant, but to allow local differences on specific lines.
> 
> I originally thought I'd be able to use branches (i.e. each machine's
> working copy is on its own branch) but that doesn't seem flexible
> enough. Perhaps I need to do something like maintain a set of patch
> files that get applied to each host's working directory, the changes
> are consistent and fixed ... but I don't know whether that's a good
> idea.
> 
> Comments welcome ... :-) But I'm not going to move to puppet in the
> short term ...
> 
> -jim

I'm wondering, what's the problem when using branches for this?

  master -> default tree
  web-5  -> apache conf modification
  web-10 -> apache and PHP conf modifications

Seems simple enough. What sort of extra functionality do you need? To augment 
this and automate it further you could use Fabric for remote deployments. Then 
a simple 'fab deploy:web-5' could do a local 'git tag -a ...; git push' and 
after that a remote 'git branch --set-upstream... ; git pull'


More information about the NZLUG mailing list