More Proposed Chef 12.0 Changes


#1

Hi Chefs,

I’ve proposed 2 more Changes for Chef 12.0. They are pretty small and hopefully not too controversial.

Firstly, I’d like to make chef-solo raise an error when attempting to include_recipe a recipe that’s not in the run_list or dependencies. The tl;dr here is that non-recipe files aren’t loaded if a cookbook isn’t in the run_list or dependency tree, which causes confusing errors. We would have like to have made this condition an error already, but decided not to in order to avoid any possibility of breakage. See these tickets for more background:

https://tickets.opscode.com/browse/CHEF-4367
https://tickets.opscode.com/browse/CHEF-5120

The chef-rfc issue for this change is here: https://github.com/opscode/chef-rfc/issues/42 (since it’s a small change it doesn’t get its own RFC, it would be added to RFC 015 https://github.com/opscode/chef-rfc/blob/master/rfc015-chef-12.md

The second change I’m proposing is to finally remove the cookbook overlay feature. This is the feature (or mis-feature IMO) where, when a cookbook appears multiple times in your cookbook_path, chef combines it into a single cookbook with files overlaid. This feature has been deprecated since at least Chef 0.10.4 (deprecation warning was added to master in May 2011). There is more background in this ticket: https://tickets.opscode.com/browse/CHEF-2308

The chef-rfc issue for this change is here: https://github.com/opscode/chef-rfc/issues/43


Daniel DeLeo


#2

Hello!

What are the best methods for
doing cookbook verifications at
the micro and macro levels?

I.e. the unitary single cookbook
itself, alone and the greater universe of all it’s peer cookbooks.

–Stuart


#3

knife cookbook test, foodcritic, chefspec, minitest-chef-handler,
test-kitchen, serverspec, cucumber-nagios to name a few… :slight_smile:

Also check out the excellent “Test-driven infrastructure with Chef (2nd
edition)” book

HTH, Torben
Am 12.08.2014 01:29 schrieb “Stuart Cracraft” smcracraft@me.com:

Hello!

What are the best methods for
doing cookbook verifications at
the micro and macro levels?

I.e. the unitary single cookbook
itself, alone and the greater universe of all it’s peer cookbooks.

–Stuart


#4

Torben: Cool - thanks - the book is incoming. --Stuart

On Aug 11, 2014, at 10:02 PM, Torben Knerr mail@tknerr.de wrote:

knife cookbook test, foodcritic, chefspec, minitest-chef-handler, test-kitchen, serverspec, cucumber-nagios to name a few… :slight_smile:

Also check out the excellent “Test-driven infrastructure with Chef (2nd edition)” book

HTH, Torben

Am 12.08.2014 01:29 schrieb “Stuart Cracraft” smcracraft@me.com:

Hello!

What are the best methods for
doing cookbook verifications at
the micro and macro levels?

I.e. the unitary single cookbook
itself, alone and the greater universe of all it’s peer cookbooks.

–Stuart

Stuart Cracraft
RHCE, RHCSA
mail: smcracraft@icloud.com
linkedin: http://www.linkedin.com/in/stuartcracraft
skype: smcracraft
cell: (949) 285-6573, (408) 868-8647
web: http://marketwaves.us
app: http://appstore.com/marketwaves
group: https://groups.google.com/forum/#!forum/gnutech
group: https://groups.google.com/forum/#!forum/rhcerts


#5

So this is one of those huge yak shaves that really depends on what you are doing.

When you say macro and micro levels I think less in terms of single cookbook vs multiple cookbook and more in terms of single node vs multi node.

With that distinction in mind the first thing I would do is take a gander at a presentation @someara did at Chef-NYC: http://vimeo.com/98938732.

For me the workflow is:

  • Linting tools (used to make the code a bit easier to deal with and clean)

    • Foodcritic
    • Rubocop
  • Unit or Pre-converge testing (Really fast feedback. Tests that I told Chef to do the right thing)

    • ChefSpec
  • Integration/Functional or Post-converge testing (Did I automate the right thing? Was the automation effective.)

    • Test Kitchen
    • ServerSpec

From a multi-node level, I really haven’t had a chance to wrap my head around this yet. But in an ideal world, you would have a test or staging environment and you could push your Chef changes there, then run ServerSpec or whatever monitoring you already run in prod against that environment.

That is my 2cents anyway.
— cwebber

On Aug 11, 2014, at 4:28 PM, Stuart Cracraft smcracraft@me.com wrote:

Hello!

What are the best methods for
doing cookbook verifications at
the micro and macro levels?

I.e. the unitary single cookbook
itself, alone and the greater universe of all it’s peer cookbooks.

–Stuart