[chef] Re: ChefDK cookbook generator question


Chronological Thread 
  • From: Yauhen Artsiukhou < >
  • To: Nick Shemonsky < >
  • Cc:
  • Subject: [chef] Re: ChefDK cookbook generator question
  • Date: Thu, 23 Apr 2015 02:15:57 +0300

Ohai Chefs!

Recently I also faced with issue about cookbook generating and updating existing cookbooks. 
After googling I've found interesting project Noe:

I tried to use it and it works for me. Really cool. I'm still not using ChefDK and this project also doesn't depend on ChefDK. 

Creating templates and using it now easy.

noe prepare --template=chef-cookbook --layout=short my-cookbook
cd my-cookbook

# Edit specific information about your cookbook
edit my-cookbook.noespec

# Let Noe generate your project
noe go

# Let Noe update your project after some time
noe go --safe-override

# Let Noe regenerate noespec (if new version has changed specs)
noe prepare --template=chef-cookbook --layout=short --force

Note: template still in very beta state.


2015-02-16 19:33 GMT+03:00 Nick Shemonsky < " target="_blank"> >:
Hey all,

I'm in the midst of creating a custom cookbook generator and would like to set some of the generator options while still allowing them to be overridden when passed in from the command line. Thus far, I've been doing something like this within recipes/cookbook.rb:

context = ChefDK::Generator.context
context.copyright_holder = 'Example, Inc.'

While that works, if I specify -C at the command line, eg. chef generate cookbook test_cookbook -C 'Other, Inc.', I can't override the copyright_holder option set in cookbook.rb. Is there somewhere better to set these options so that any passed from the command line would take precedence without directly modifying the defaults set in chef-dk/lib/chef-dk/command/generator_commands.rb?

Thanks,
Nick



  • [chef] Re: ChefDK cookbook generator question, Yauhen Artsiukhou, 04/22/2015

Archive powered by MHonArc 2.6.16.

§