Chef Dialects
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Chef Dialects

on

  • 612 views

From Chef Summit 2013

From Chef Summit 2013

Statistics

Views

Total Views
612
Views on SlideShare
602
Embed Views
10

Actions

Likes
0
Downloads
0
Comments
0

1 Embed 10

https://twitter.com 10

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Chef Dialects Presentation Transcript

  • 1. Chef Dialects Noah Kantrowitz Balanced, Inc
  • 2. 10KM View • Hooks to load from non-.rb Improvements to layout •
  • 3. Dialect Hooks • Recipes Attributes • Metadata • • Roles • Data bags
  • 4. Rules • Side effect based • Ruby classes • File extension, MIME type
  • 5. Cookbook Dialects • • depends 'dialect-js' attributes/default.yml • • recipes/default.js Distributed as cookbooks
  • 6. dialect-js template('/tmp/foo', { source: 'foo.erb', owner: 'root', variables: {msg: node.msg} })
  • 7. dialect-py import chef chef.template('/tmp/foo', source='foo.erb', owner='root', variables={'msg':'Hello'} )
  • 8. Knife Dialects • Distributed as gems, knife plugins • gem install knife-dialect-erbyaml • knife role from file web.yml • knife data bag from file users jdoe.yml
  • 9. Current Dialects • Javascript, based on therubyracer/V8 • Python, incomplete, based on ffi + libpython • JSON • YAML and ERB+YAML • ...
  • 10. Current Dialects • Javascript, based on therubyracer/V8 • Python, incomplete, based on ffi + libpython • JSON • YAML and ERB+YAML • Puppet (soon)
  • 11. Next steps • chef_fs for knife upload and chef-client -z • More dialects • Perl? • Java? • TOML? • Templates?
  • 12. Layout Shortcuts • attributes/default.rb ➡ attributes.rb • recipes/default.js ➡ recipe.js • libraries/default.rb ➡ library.rb
  • 13. RIP Specificity • templates/foo.erb files/foo.ini •
  • 14. Default lookup • source 'foo.erb' • host-fqdn/foo.erb • platform-version/foo.erb • platform/foo.erb • default/foo.erb • foo.erb ☺☺☺
  • 15. Explicit Lookup • source ['one.erb', 'two.erb'] • source [ "host-#{node['fqdn']}/name", "#{node['platform']}-#{node['platform_version']}/name", "#{node['platform']}/name", "default/name", ]
  • 16. Putting It All Together my-postgresql/ attributes.json metadata.yml recipe.py templates/ postgresql.conf.erb
  • 17. When? • github.com/coderanger/chef/tree/dialects • Chef 12?