0

I am trying to learn kitchen/chef and I am following the tutorial provided here

http://kitchen.ci/docs/getting-started/installing

Right now I am stuck at question rather than a problem. The given tutorial creates a git-cookbook. Now what i want to know that we are we telling the kitchen to create a box with "git" installed ?

I re-did the whole tutorial without an empty metadata.rb instead of providing anything in it (as per tutorial), i left it empty and ran kitchen init --driver=kitchen-vagrant. As expected, it created the cookbook/box without git installed on it.

I then added following line in metadata.rb

name "git"
version "0.1.0"

And then ran kitchen converge default-ubuntu-1204. What i was expecting that it will update my cookbook/box with git installed on it but it didn't.

Do i have to do kitchen init again ? wouldn't it overwrite my existing .kitchen.yml file and all the changes i have done in it ? What is best way to install a tool in an already created cookbook/box ?

Em Ae
  • 8,167
  • 27
  • 95
  • 162

1 Answers1

1

It sounds like you need to actually use the git recipe somewhere to get the changes you're looking for. Either with an

include_recipe 'cookbookname::recipename' 

EDIT: The include_recipe resource goes in a recipe you're using in your runlist. Think of it as copy/pasting the entire recipe you're including into the file you include it in.

or by adding it to the runlist of the suite in your .kitchen.yml

suites:
- name: <suite name>
  run_list:
  - recipe[<cookbookname::recipename>]
  - recipe[<cookbookname::recipename>]...

When you converge kitchen will pick up the difference in your configuration and add new things in if you told it to but it wont remove items without explicit instruction.

JackChance
  • 520
  • 3
  • 11