How to store etckeeper repositories on a central server via git

I would like to have one central git repository for all my servers’ etckeeper .git repos. Here the suggestion was to use a file in /etc/etckeeper/commit.d, which basically looks like this, assuming that a git repo had been set up in somedir on somehost:

#!/bin/sh
cd /etc
git push faruser@farhost:somedir

The problem with this is, that it would be really nice to have all servers in the same repo on the central server. I tried

git push faruser@farhost:somedir/server1

but that failed.

As you can see, I’ve never worked with git before … Any ideas on how this can be accomplished is greatly appreciated 🙂

Cheers,

Andreas

Answer

I can understand wanting a central place with all your config info, but you probably want them to still be their own separate repositories, just in a central location. To do so, lookup how to push to remote locations in git (using git push). Then you’ll need to set up access to that location from all your servers, at which point you can push from all of them. At which point the suggestion you pointed to should work.

Attribution
Source : Link , Question Author : andreas-h , Answer Author : pjz

Leave a Comment