Hey, All –
I’m working on figuring out how I’m going to implement Chef with git, and my
Google foo seems to be failing me. I know roughly how I want things to
work, but I’m not sure whether it’s possible, and I’m wondering if anyone
has links/pointers/experiences that they can share.
Here’s what I would like to be able to do
- Have a single git repository, with the following branches
- QA branch
- production branch
- Have any given change be made exactly once. That is, /etc/config.file
will only be edited by hand once, that edit will be applied via git merges
to every environment where it needs to be distributed.
This results in a standard workflow that looks like this:
- Changes are made in a local branch, and merged into QA
- QA chef server pulls down the changes, and applies them somehow
(knife cookbook upload -a /path/to/local/repo
presumably, or at least
that’s the only option that I’ve found so far – it was pointed out to me on
the IRC channel.)
- Once changes have been validated in QA, they are merged from the QA
branch to the production branch
- Production chef servers pull down the changes, and apply them somehow
(presumably the same knife cookbook upload....
command)
I’m running into issues with this work flow, though, and I’m not sure if its
because I’m trying to do something that can’t be done, or simply because I’m
doing things in the wrong way, or what. Specifically:
- This doesn’t handle anything other than cookbooks – data_bags get
ignored, for example - Because pulling a delete in git doesn’t remove anything from the
filesystem, old cookbooks stick around
Obviously, there are ways to work around both of these issues, but I don’t
want to invent the wheel if someone else has already dealt with this. So,
my questions:
Are other people using chef/git in this way (where git comes before, as
opposed to after, chef)?
If so, what’s the secret sauce? Are there scripts that I need to be looking
for that’ll make this all easy? Documentation that I can follow?
Am I totally misunderstanding anything about how Chef works, given what I’m
trying to do?
Thanks for any advice/pointers,
- Ian