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


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

that's not a bad idea at all, and if we ever move to more docker related stuff this would likely be necessary anyway so not just test code.

Looks like the ohai related node items:
node['virtualization']['system'] = 'docker'
node[virtualization']['systems']['docker'] = 'guest'

I'll give this a try.

-Bill

On Fri, Aug 7, 2015 at 9:11 AM, Daniel DeLeo < " target="_blank"> > wrote:


On Friday, August 7, 2015 at 8:55 AM, Bill Warner wrote:

> 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.
You can detect that you’re on Docker with ohai (you’ll have to poke around for these attributes, I don’t recall what they are off-hand) and then put the logic into your wrapper cookbook. You could also do this via attributes. It’s maybe a tiny bit ugly to have that logic in non-test code, but you lose the ability to manage the run_list when you go to role cookbooks, so it’s your best option.

--
Daniel DeLeo




--
--
Bill Warner



Archive powered by MHonArc 2.6.16.

§