Managing git repos with gitosis and puppet


In git update hook to mcollective I described pushing to multiple nodes via a git push by using a hook that pushed a repository artifact to s3 and then used mcollective to tell target nodes to download and deploy that artifact.

That’s all great, but I still needed a way to manage the git repositories. The usual candidates for git are gitosis and gitolite. There were a few hurdles to get this working so that repos could be managed out of puppet with all node and user information kept in couchdb. I earlier described Keeping puppet node definitions in CouchDB.

First of all, git should be managed through puppet. In addition, the update hook needed to get pushes out via mcollective needs to set as a template. An easy way to do this is just by having puppet manage the file at /usr/share/git-core/templates/hooks/post-update.

Managing gitosis through puppet was not a whole lot of fun. I start here with the module definition for puppet. Here be dragons: