Greetings!
We have released ChefDK 0.5.0. It can be downloaded for all supported systems at https://downloads.chef.io/chef-dk/
The full list of changes is available in the changelog, but I wanted to highlight some noteable changes below:
Policyfiles
Native API Mode
This release adds a lot of support for the Policyfile workflow. First, we set native (non compatability mode) API communication to the Chef Server as the default. This means that if you are using policyfiles currently, you need to add `policy_document_native_api false` to your knife.rb to continue using compatibility mode. If you switch to native mode there is no automatic importing of policyfiles from the compatibility mode databags, so you will need to re-upload your policyfile locks.
UPDATE: I was wrong – Chef Server 12.0.7 supports policyfile native mode endpoints as detailed in this blog post, but requires configuration to activate it. Chef Server 12.1.0 will support policyfile native mode endpoints by default. Sorry for my confusion!
Chef Zero, however, still does not support native mode endpoints.
Attributes in Policyfiles
Policyfiles now support attributes using the same syntax you would use in an attribute file for a cookbook.
[shell]
default[‘some’][‘attribute’] = 1
default[‘some’][‘overridden’][‘attribute’] = ‘a’
override[‘some’][‘overridden’][‘attribute’] = ‘b’
[/shell]
Policyfile attributes are applied at the “role”precedence level during the chef-client run. You can also regenerate only the attributes in a policyfile.lock by running `chef update -a`.
Chef Diff
Running `chef diff` will display the itemized differences between two policyfiles or 2 versions of a specific policyfile. It is documented quite well and you can see the different options by running `chef diff -h`. This command only works with a server running the native API endpoints.
An example of the output looks like:
Misc
- Support fish shell in `chef shell-init`
- `chef -v` now displays the version of the ChefDK, Chef, Berkshelf and Test Kitchen
- `chef generate repo` command no longer generates a monolithic repo
- Add a `chef_repo` cookbook source which can be used in place of supermarket/berks-like depsolving to support a single monolithic git repo with its ‘universe’ of cookbooks entirely contained within it. Cookbook dependencies will be determined only from the filesystem. Cannot be combined with supermarket/berks-apis as a source.
- We now include the `knife-windows` gem at version 0.8.4 and the `winrm-transport` gem at version 1.0.0
- Updated embedded software:
- `chef` – 12.2.1
- `chef-provisioning` – 1.1.1
- `chef-provisioning-fog` – 0.13.2
- `chef-provisioning-azure` – 0.3.2
- `chef-provisioning-aws` – 1.1.1
- `test-kitchen` – 1.4.0
- `kitchen-vagrant` – 0.17.0
Note for OSX Users
The packaged version of `chef` (12.2.1) contains a bug which tries to use `macports` as the package provider for OSX instead of `homebrew`. So if you use the embedded chef to converge your workstation, do not install this version of the ChefDK. I am preparing a 0.5.1 release which will include `chef` 12.3.0 and contains the fix for this bug. Expect to see it in the next day or two.