4

I recently started using chef and I love it for provisioning my vagrant boxes and quickly spawning new machinges.

Now I started using a hosted chef server.

It's pretty easy to manage my cookbooks using Berkshelf with all needed cookbooks distributed over several git repositories.

But now I want to have a neat management for my databags/environments/nodes/roles etc... as well.

I want to keep json files holding these configurations in sync with the chef server.

The only way to do that is using knife upload. I don't want to end up writing a bunch of scripts to upload local files to my chef server.

So is there a solution that lets me easily upload all my stuff to chef server? Preferably tied to a git push (so that all my stuff will be updated on chef, after I push the git repo)

leifg
  • 171
  • 1
  • 8

2 Answers2

2

I recently found spiceweasel which lets you setup a chef infrastructure using YAML files.

leifg
  • 171
  • 1
  • 8
1

You could create a post-push git hook that uploads everything:

#!/bin/bash
knife cookbook upload --all
knife role from file roles/*.rb
knife data bag from file --all

But since git does not have post-push local hook you have to hook it to something else.

Draco Ater
  • 357
  • 3
  • 12
  • I thought of that, however I don't want to set up an extra server to manage my git hooks for one repository. – leifg Apr 15 '13 at 08:03