It just occurred to me that it's weird that roles have a totally different DSL for attributes than cookbooks, and we should take a moment to think about how attributes should work in policyfiles. In this gist are two examples, one "role style" and one "cookbook style". Let me know what you like best (but remember there's no notifications for gist comments so you have to use some other medium to make sure I see your comments).
{ | |
"recipes": [ | |
{ | |
"name": "default.rb", | |
"path": "recipes/default.rb", | |
"checksum": "7662da1adad28445e4bc3a3e466ed979", | |
"specificity": "default", | |
"url": "https://s3-external-1.amazonaws.com:443/opscode-platform-production-data/organization-0a6b5a0357ea4ff4816a6e3ffb0cb561/checksum-7662da1adad28445e4bc3a3e466ed979?AWSAccessKeyId=AKIAIQKPG2CTSTRVDO4Q&Expires=1477725013&Signature=CQXv9znJQPrC1fV0F0R3NUsMW3c%3D" | |
}, | |
{ |
RFC | Author | Status | Type |
---|---|---|---|
unassigned |
Daniel DeLeo <[email protected]> |
Draft |
Standards Track |
Policyfiles are a new feature of Chef that allow the user to specify a
Firstly, the primary apps in ChefDK use executables generated by appbundler:
- chef (chef-client/knife/etc.)
- berks
- chef-dk (the
chef
tool) - TK
The appbundler code is here: https://github.com/opscode/appbundler/ and the README explains what it does and why. You can see the executables that appbundler generates in /opt/chefdk/bin
(there are other executables in there, but the executables for the primary apps are the appbundler ones).
The primary apps in ChefDK all live in the "apps" directory, in /opt/chefdk/embedded/apps
.
#!/usr/bin/env ruby | |
# | |
def clean_fds | |
# Don't clean $stdin, $stdout, $stderr, process_status_pipe. | |
3.upto(256) do |n| | |
begin | |
fd = File.for_fd(n) | |
fd.close if fd | |
rescue | |
end |
source "https://api.berkshelf.com" | |
cookbook 'annoyances', | |
:github => 'mattray/annoyances-cookbook' | |
cookbook 'apt', | |
:github => 'opscode-cookbooks/apt' | |
cookbook 'ark', | |
:github => 'opscode-cookbooks/ark' | |
cookbook 'avahi-daemon', | |
:github => 'jackl0phty/opschef-cookbook-avahi-daemon' |
# Show all the places where you have multiple cookbooks that shadow each other. | |
# | |
# Run this as: | |
# | |
# knife exec shadow-check.rb | |
config = Chef::Config | |
cookbook_loader = begin | |
Chef::Cookbook::FileVendor.on_create { |manifest| Chef::Cookbook::FileSystemFileVendor.new(manifest, config[:cookbook_path]) } |
require 'bundler' | |
parser = Bundler::LockfileParser.new(IO.read("Gemfile.lock")) | |
gem_activates = parser.specs.map {|s| %Q|gem "#{s.name}", "= #{s.version}"|} | |
preamble = "#TODO setup gem paths\n" | |
File.open("activate.rb", "w+") do |f| | |
f << preamble | |
f << gem_activates.join("\n") |
Hi Chefs,
Since we announced the 11.6 Release Candidate, we've been busy running test scenarios to verify new features and bug fixes. This round of testing is complete, and we've released a new RC with a handful of fixes. Unless any new issues are found, this RC will become the 11.6.0 release. If you've been wondering how you can contribute to Chef, testing this release in your environment is a great way to help out.
For the full list of changes in this release, please see the draft