Ok ok, I admit… I tried to stay away from hacks and non-package things but I was just lazy about trying to find out the best configuration manager while I needed to distribute my files around and execute the same command on all nodes of the cluster so I cheated!

At least was a very small cheat and I still want to do the right way, someday…. πŸ˜€

I needed multiple execution and multiple copy, so I’ve created a file called /etc/cluster that contained all my node’s names:

frodo
sam
merry
pippin

Than, I made a extremely simple script to read it and execute a command on every node:

CMD="$*"
for node in `cat /etc/cluster`; do
    ssh -t $node $CMD
done

I did also the same using scp and the joy of the day: patch! Yes, I quite liked it, a script that you provide the original path on nodes and the patch file. It’ll copy to your home directory and apply the patch on the original file using both simple scripts previously made to copy and run.

Than it became easy to admin the config of the cluster:

$ diff -e /etc/mon/mon.cf /etc/mon/mon.cf.original > ~/mon.patch
$ cpatch /etc/mon/mon.cf ~/mon.patch
$ cexe /etc/init.d/mon restart

Ludicrously simple, isn’t it?!?! πŸ˜€

Of course, to do that I needed to create two things: passwordless ssh and passwordless sudo on each node. But that’s another story.