Setting of my chef cookbooks, how to link to other cookbooks when using git?


#1

So I’m setting up a simple chef solo repository, and confused how I can
pull-in cookbooks from opscode etc.

Say my structure is like:

/project/chef
/project/chef/conf/solo.rb
/project/chef/cookbooks/

Now my git repository is under /project:

/project/.git

When I download other cookbooks, like if I clone opscode cookbooks from
github the folder structure is:

/cookbooks/
/cookbooks/activemq

So if I want a specific cookbook, I have to copy the folder over to my
/cookbooks folder, but then I update the cookbook using git.

Other individual cookbooks are see around are named like: someapp-cookbook

I’m sure I’m thinking of this the wrong way, but how can I pull down
cookbooks into my cookbooks directly while being able to update them from
their git repo?


#2

Have a look at Librarian, it’s designed for managing this.

Knife also has some built in tools for managing cookbooks – knife
cookbook site download, knife cookbook site install, knife-github
plugin, etc.

–AJ

On 12 April 2012 09:53, S Ahmed sahmed1020@gmail.com wrote:

So I’m setting up a simple chef solo repository, and confused how I can
pull-in cookbooks from opscode etc.

Say my structure is like:

/project/chef
/project/chef/conf/solo.rb
/project/chef/cookbooks/

Now my git repository is under /project:

/project/.git

When I download other cookbooks, like if I clone opscode cookbooks from
github the folder structure is:

/cookbooks/
/cookbooks/activemq

So if I want a specific cookbook, I have to copy the folder over to my
/cookbooks folder, but then I update the cookbook using git.

Other individual cookbooks are see around are named like: someapp-cookbook

I’m sure I’m thinking of this the wrong way, but how can I pull down
cookbooks into my cookbooks directly while being able to update them from
their git repo?


#3

Hi,

On Thu, Apr 12, 2012 at 7:53 AM, S Ahmed sahmed1020@gmail.com wrote:

I’m sure I’m thinking of this the wrong way, but how can I pull down
cookbooks into my cookbooks directly while being able to update them from
their git repo?

I highly recommend braid [1] - we use it and are very happy with it.

The way we do things is something like

Import a remote repository into our local one

braid add git://github.com/realityforge-cookbooks/glassfish.git
cookbooks/glassfish

Update local tree based on changes in remote repo

braid update cookbooks/glassfish

Produce a diff of local dir to remote repo

braid diff cookbooks/glassfish

[1] https://github.com/evilchelu/braid/wiki/usage-and-examples


Cheers,

Peter Donald


#4

Peter, thanks braid looks interesting.

Actually, if I want to keep things simple, I can just pass an array to my
cookbook_path it seems.

On Wed, Apr 11, 2012 at 6:40 PM, Peter Donald peter@realityforge.orgwrote:

Hi,

On Thu, Apr 12, 2012 at 7:53 AM, S Ahmed sahmed1020@gmail.com wrote:

I’m sure I’m thinking of this the wrong way, but how can I pull down
cookbooks into my cookbooks directly while being able to update them from
their git repo?

I highly recommend braid [1] - we use it and are very happy with it.

The way we do things is something like

Import a remote repository into our local one

braid add git://github.com/realityforge-cookbooks/glassfish.git
cookbooks/glassfish

Update local tree based on changes in remote repo

braid update cookbooks/glassfish

Produce a diff of local dir to remote repo

braid diff cookbooks/glassfish

[1] https://github.com/evilchelu/braid/wiki/usage-and-examples


Cheers,

Peter Donald