[Pre-Release Announcement] Chef Client 12.16


#1

Ohai Chefs!

We have selected 12.16.42 as our 12.16 release candidate which is scheduled for release on Wednesday Oct 9th.

Release Highlights

attribute_changed event hook

In a cookbook library file, you can add this in order to print out all attribute changes in cookbooks:

Chef.event_handler do
  on :attribute_changed do |precedence, key, value|
    puts "setting attribute #{precedence}#{key.map {|n| "[\"#{n}\"]" }.join} = #{value}"
  end
end

If you want to setup a policy that override attributes should never be used:

Chef.event_handler do
  on :attribute_changed do |precedence, key, value|
    raise "override policy violation" if precedence == :override
  end
end

RFC018 Partially Implemented: Specify --field-separator for attribute filtering

If you have periods (.) in your Chef Node attribute keys, you can now pass
the --field-separator (or -S) flag along with your --attribute (or -a)
flag to specify a custom nesting character other than ..

In a situation where the webapp node has the following node data:

{
  "foo.bar": "baz",
  "alpha": {
    "beta": "omega"
  }
}

Running knife node show with the default field separator (.) won’t show
us the data we’re expecting for some attributes:

$ knife node show webapp -a foo.bar
webapp:
  foo.bar:

$ knife node show webapp -a alpha.beta
webapp:
  alpha.beta: omega

However, by specifying a field separator other than . we’re now able to show
the data.

$ knife node show webapp -S: -a foo.bar
webapp:
  foo.bar: baz

$ knife node show webapp -S: -a alpha:beta
webapp:
  alpha:beta: omega

Please see the CHANGELOG.md for the complete list of changes.

Getting the Build

12.16.42 is available in our current channel and you can install them now using:

curl https://omnitruck.chef.io/install.sh | sudo bash -s -- -c current -P chef -v 12.16.42

OR

. { iwr -useb https://omnitruck.chef.io/install.ps1 } | iex; install -channel current -project chef -version 12.16.42

If you want to give this a spin in Test-Kitchen, create or add the following to a .kitchen.local.yml file and have fun!

provisioner:
  product_name: chef
  channel: current
  product_version: 12.16.42