Diffing Files Over Multiple Servers - rd-differ

Adhoc changes are a very bad thing in many ways, one of the worst is how often they are not fully implemented across all the servers or even pulled back to staging. In an attempt to sanity check the config files when we have to make these little hacks I oddly-proudly present - rd-differ. A tool for diffing config files over multiple machines.

The idea is simple, you tell it the file or directory you’re interested in, specify a single machine as the baseline and then specify a number of others as the machines to check against it. A sample invocation looks like this rd-differ /etc/apache2 10.10.100.111 10.10.100.112 10.10.100.113 and the output is show as a diff.

The files are rsynced down using ssh so your usual keys will work and while the normal output is that of the raw diff it’s very easy to wrap the results and add other checks on top of it. The shell’s not written to be very defensive (unusual for me) but the code is short enough that it’s worth the compromise.