[chef] Re: Re: Re: Using kitchen override/stub a cookbook


Chronological Thread 
  • From: Bill Warner < >
  • To: chef < >
  • Subject: [chef] Re: Re: Re: Using kitchen override/stub a cookbook
  • Date: Fri, 7 Aug 2015 08:55:37 -0700

It's actually a wrapper cookbook that I'm testing.  the cookbook includes my base cookbook for internal standards configuration which has a few community cookbooks as well as a few in house ones to get the base configs, users, monitoring, dns, host etc all set up.  then it includes some community and in house cookbooks to personalize the target application such as kafka, cassandra or our in house apps.

I have all the tests running with Vagrant now but due to some minor incompatibilities with docker (mainly not being able to write to /etc/hosts or /etc/resolv.conf, some of the cookbooks in the runlist always fail.  if there was a way I could blacklist or stub those cookbooks I'd still be able to get a nearly full test much faster than I can currently with Vagrant.

I may be able to do a custom rake task that would rewrite the Berksfile and point to empty cookbooks for those...not sure how else to test it.

On Fri, Aug 7, 2015 at 5:44 AM, Yauhen Artsiukhou < " target="_blank"> > wrote:
+1 Noah
Using wrapper for test always is really good idea. Here is example https://github.com/jsirex/collectd-lib-cookbook

I'm using noe template tool for creating cookbook skeletons, which are by default use wrapper cookbook: https://github.com/jsirex/chef-cookbook.noe

2015-08-06 23:54 GMT+03:00 Noah Kantrowitz < " target="_blank"> >:

On Aug 6, 2015, at 1:50 PM, Bill Warner < " target="_blank"> > wrote:

> I am trying to setup testing with kitchen and docker,  some cookbooks like the supermarket "hostname" cookbook are not compatible with docker but they are used in my final deployments.  I'd like to stub these out just for when kitchen docker is used to speed up early testing but not when vagrant or doing a berks install.
>
> I thought I'd use groups in my Berksfile, but that would still try to upload/install the stub cookbook to my chef server while doing a berks install unless i specify a -e docker_integration, and Berksfile doesn't seem to be processed by erb.
>
> I was unable to find anywhere in the .kitchen.yml file where I could override a single cookbook, or a way to have it not process a cookbook.

Use a wrapper cookbook that only include_recipe-s the real one if you aren't on Docker.

--Noah





--
--
Bill Warner



Archive powered by MHonArc 2.6.16.

§