Fresh New Chef Stuff
Thom May & Tim Smith - Community Engineering
Chef Year in Review
10 chef client releases
7 chef server releases
13 ohai releases
7,000+ commits across chef
projects!
7,000+ more in chef managed
community cookbooks!
- apt_update
- apt_repository
- yum_repository
- systemd_unit
- chocolatey_package
- cab_package
- launchd
- osx_profile
- ksh
New Chef Resources
- shard
- machineid
- hostnamectl
- shells
- hardware
- time
- fips
- scala
- sessions
- packages
New Ohai Plugins
Do yourself a favour and upgrade!
Let’s jump into some new stuff!
Custom Resources
Custom resources are reusable Chef
resources you define within your
cookbooks that make it easy to automate
repetitive tasks within your organization’s
cookbooks
Custom resources build on the
foundations of Lightweight Resource
Providers (LWRPs) with powerful new
functionality and a simpler DSL
Custom Resources
• Introduced in Chef 12.5
• Compatible with Chef 12.1+ using the compat_resource cookbook
• Build on years of LWRP experience and development
Improvements compared to LWRPs
• Everything is defined in a single file
• Greatly simplified DSL
• New DSL for supporting multiple platforms / platform versions
• “Just works” out of the box
resources/myapp.rb file:
actions :create
default_action :create
attribute :name, kind_of: String, name_attribute: true
attribute :app_name, kind_of: String, default: 'default_app'
providers/myapp.rb file:
use_inline_resources
def whyrun_supported?
true
end
action :create do
template '/some/web/app/config' do
owner 'root'
group 'root'
variables(app_name: new_resource.app_name)
notifies :restart, 'service[apache2]'
end
service 'apache2' do
action :nothing
end
end
resources/myapp.rb file:
property :name, String, name_attribute: true
property :app_name, String, default: 'default_app'
action :create do
template '/some/web/app/config' do
owner 'root'
group 'root'
variables(app_name: new_resource.app_name)
notifies :restart, 'service[apache2]'
end
end
Simplified DSL in Action:
Fresh New Chef Stuff Episode 1:
Custom Resources Youtube Video
http://bit.ly/2dqpMJg
Chef Solo
Chef Solo now uses the same technology
as Chef Client Local Mode
Editing and Deleting Resources
The Chef Rewind extension is no longer
required - Chef 12.10 and later.
Delete
Previously:
chef_gem "chef-rewind"
require 'chef/rewind'
unwind "user[postgres]"
Now:
delete_resource(:user,”postgres")
Edit
Previously:
chef_gem "chef-rewind"
require 'chef/rewind'
rewind “user[postgres]" do
home “/var/lib/postgres”
end
Now:
edit_resource!(:user,”postgres”) do
home “/var/lib/postgres”
end
Built in Apt/Yum resources
name "my_cookbook"
maintainer "Me"
maintainer_email "me@gmail.com"
license "Apache 2.0"
version "1.0.0"
depends "apt"
depends "yum"
Prep Debian / Ubuntu package cache
apt_update "Update Please"
include_recipe "apt::default"
Setup package repositories
apt_repository "OurCo" do
uri "http://artifacts.ourco.org/ubuntu/something"
action :true
components ["main"]
end
yum_repository "OurCo" do
description "OurCo Yum repository"
mirrorlist "http://artifacts.ourco.org/mirrorlist?repo=ourco-6&arch=$basearch
gpgkey "http://artifacts.ourco.org/pub/yum/RPM-GPG-KEY-OURCO-6"
action :create
end
Multi Package
Multiple Packages
Previously:
%w{ httpd jenkins tmux }.each do |pkg|
package pkg
end
Now:
package %w{ httpd jenkins tmux }
macOS Improvements
New Resources for macOS
launchd (Chef 12.8.1)
osx_profile (Chef 12.7.0)
Big thanks to Facebook for their macOS
work
Cookbook Gem Dependencies
Previously
Recipe:
chef_gem "docker" do
compile_time true
end
Library:
begin
require 'docker'
rescue LoadError
puts "waiting to load Docker"
end
Now (in12.9.1)
metadata.rb:
gem "docker"
Library:
require 'docker'
Windows Improvements
New Resources
chocolatey_package (Chef 12.7.0)
cab_package (Chef 12.15.19)
Newly Built in Windows Resources
• reboot
• batch
• registry
• package
name “my_windows_cookbook"
maintainer "Me"
maintainer_email "me@gmail.com"
license "Apache 2.0"
version "1.0.0"
depends "windows"
systemd_unit (since 12.11)
More built-ins
Simpler DSLs
Expanded platform support

More Related Content

PDF
Chef Automate Workflow Demo
PDF
Nike popup compliance workshop
PDF
Nike pop up habitat
PPTX
Achieving DevOps Success with Chef Automate
PPTX
Compliance Automation with Inspec Part 2
PPTX
Compliance Automation with Inspec Part 4
PPTX
London Community Summit - Habitat 2016
PPTX
Chef Workflow Demo
Chef Automate Workflow Demo
Nike popup compliance workshop
Nike pop up habitat
Achieving DevOps Success with Chef Automate
Compliance Automation with Inspec Part 2
Compliance Automation with Inspec Part 4
London Community Summit - Habitat 2016
Chef Workflow Demo

What's hot (20)

PPTX
London Community Summit - Chef at SkyBet
PPTX
Application Automation with Habitat
PPTX
Azure handsonlab
PPTX
Understand Chef
PPTX
How to Write Chef Cookbook
PDF
Intermediate/Compliance training Guide
PDF
Compliance Automation Workshop
PDF
Infrastructure Automation with Chef
PPTX
Chef introduction
PPTX
Infrastructure Automation with Chef & Ansible
PDF
Compliance as Code
PDF
Server Installation and Configuration with Chef
PDF
Learning chef
PDF
Ansible Introduction
PPTX
Chef Hack Day Denver
PDF
Introduction to Chef: Automate Your Infrastructure by Modeling It In Code
PPTX
Testing for infra code using test-kitchen,docker,chef
PPTX
SAP TechEd 2013 session Tec118 managing your-environment
PDF
Automating Infrastructure with Chef
PDF
DevOpsDays Singapore - Continuous Auditing with Compliance as Code
London Community Summit - Chef at SkyBet
Application Automation with Habitat
Azure handsonlab
Understand Chef
How to Write Chef Cookbook
Intermediate/Compliance training Guide
Compliance Automation Workshop
Infrastructure Automation with Chef
Chef introduction
Infrastructure Automation with Chef & Ansible
Compliance as Code
Server Installation and Configuration with Chef
Learning chef
Ansible Introduction
Chef Hack Day Denver
Introduction to Chef: Automate Your Infrastructure by Modeling It In Code
Testing for infra code using test-kitchen,docker,chef
SAP TechEd 2013 session Tec118 managing your-environment
Automating Infrastructure with Chef
DevOpsDays Singapore - Continuous Auditing with Compliance as Code
Ad

Viewers also liked (20)

PPTX
London Community Summit - From Contribution to Authorship
PPTX
Learning from Configuration Management
PPTX
London Community Summit 2016 - Adopting Chef Compliance
PPTX
Compliance Automation with Inspec Part 3
PPTX
Chef nextdoor final 2012 berkeley
PPTX
SOUS CHEF- Android app
PDF
Our DevOps Journey - An Exercise in Cultural Change
PDF
Chef compliance - Intermediate Training
PPTX
Compliance Automation with Inspec Part 1
PPTX
London Community Summit 2016 - Chef Automate
PDF
The caseforawesome
PPT
vBACD - Introduction to Puppet, Configuration Management and IT Automation So...
PPTX
London Community Summit 2016 - Habitat
PPTX
London Community Summit 2016 - Community Update
PDF
Chef for beginners module 1
PDF
Netflix's Could Migration
PDF
PuppetConf 2016: Keynote - Sanjay Mirchandani, Puppet CEO
KEY
11 Ways to Hack Puppet for Fun and Productivity - Luke Kanies - Velocity 2012
PPTX
Vagrant를 이용한 개발환경 구축과 NetBeans를 이용한 C/C++개발과 리모트 디버깅
PPTX
20150113 secret chef ver03
London Community Summit - From Contribution to Authorship
Learning from Configuration Management
London Community Summit 2016 - Adopting Chef Compliance
Compliance Automation with Inspec Part 3
Chef nextdoor final 2012 berkeley
SOUS CHEF- Android app
Our DevOps Journey - An Exercise in Cultural Change
Chef compliance - Intermediate Training
Compliance Automation with Inspec Part 1
London Community Summit 2016 - Chef Automate
The caseforawesome
vBACD - Introduction to Puppet, Configuration Management and IT Automation So...
London Community Summit 2016 - Habitat
London Community Summit 2016 - Community Update
Chef for beginners module 1
Netflix's Could Migration
PuppetConf 2016: Keynote - Sanjay Mirchandani, Puppet CEO
11 Ways to Hack Puppet for Fun and Productivity - Luke Kanies - Velocity 2012
Vagrant를 이용한 개발환경 구축과 NetBeans를 이용한 C/C++개발과 리모트 디버깅
20150113 secret chef ver03
Ad

Similar to London Community Summit 2016 - Fresh New Chef Stuff (20)

PPTX
DevOps and Chef
PDF
Automating your infrastructure with Chef
PPTX
DevOps Hackathon: Session 3 - Test Driven Infrastructure
PDF
Cloud Automation with Opscode Chef
PDF
Docker for developers on mac and windows
PDF
Introduction to Chef - April 22 2015
PDF
Introduction to chef framework
PPTX
Environment
PDF
Overview of Chef - Fundamentals Webinar Series Part 1
PPTX
Chef advance
PPTX
Chef advance
PDF
Introduction to Chef
PDF
Introduction to Infrastructure as Code & Automation / Introduction to Chef
PDF
Cloud Automation with Opscode Chef
PDF
IT Automation with Chef
PDF
Serve Meals, Not Ingredients (ChefConf 2015)
PDF
Serve Meals, Not Ingredients - ChefConf 2015
PDF
Priming Your Teams For Microservice Deployment to the Cloud
PDF
Ansible new paradigms for orchestration
PPTX
DevOps hackathon Session 2: Basics of Chef
DevOps and Chef
Automating your infrastructure with Chef
DevOps Hackathon: Session 3 - Test Driven Infrastructure
Cloud Automation with Opscode Chef
Docker for developers on mac and windows
Introduction to Chef - April 22 2015
Introduction to chef framework
Environment
Overview of Chef - Fundamentals Webinar Series Part 1
Chef advance
Chef advance
Introduction to Chef
Introduction to Infrastructure as Code & Automation / Introduction to Chef
Cloud Automation with Opscode Chef
IT Automation with Chef
Serve Meals, Not Ingredients (ChefConf 2015)
Serve Meals, Not Ingredients - ChefConf 2015
Priming Your Teams For Microservice Deployment to the Cloud
Ansible new paradigms for orchestration
DevOps hackathon Session 2: Basics of Chef

More from Chef (9)

PPTX
Habitat Managed Chef
PPTX
Automation, Audits, and Apps Tour
PPTX
Automation, Audits, and Apps Tour
PDF
Alaska Airlines DevOps Journey
PDF
And The Slow Suffer What They Must
PDF
Visualizing your journey with chef
PDF
The New IT Game
PPTX
How to Accelerate Agile, Lean and DevOps Adoption Across Your Organization
PPTX
Chef andwindows reactor
Habitat Managed Chef
Automation, Audits, and Apps Tour
Automation, Audits, and Apps Tour
Alaska Airlines DevOps Journey
And The Slow Suffer What They Must
Visualizing your journey with chef
The New IT Game
How to Accelerate Agile, Lean and DevOps Adoption Across Your Organization
Chef andwindows reactor

Recently uploaded (20)

PPTX
Build automations faster and more reliably with UiPath ScreenPlay
PPTX
SGT Report The Beast Plan and Cyberphysical Systems of Control
PDF
Electrocardiogram sequences data analytics and classification using unsupervi...
PDF
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
PDF
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
PDF
Human Computer Interaction Miterm Lesson
PDF
A symptom-driven medical diagnosis support model based on machine learning te...
PDF
Early detection and classification of bone marrow changes in lumbar vertebrae...
PPTX
Module 1 Introduction to Web Programming .pptx
PDF
Lung cancer patients survival prediction using outlier detection and optimize...
PPTX
agenticai-neweraofintelligence-250529192801-1b5e6870.pptx
PDF
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
PPTX
Internet of Everything -Basic concepts details
PDF
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
PDF
Connector Corner: Transform Unstructured Documents with Agentic Automation
PDF
Build Real-Time ML Apps with Python, Feast & NoSQL
PDF
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
PDF
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
PDF
Ensemble model-based arrhythmia classification with local interpretable model...
PDF
Transform-Your-Streaming-Platform-with-AI-Driven-Quality-Engineering.pdf
Build automations faster and more reliably with UiPath ScreenPlay
SGT Report The Beast Plan and Cyberphysical Systems of Control
Electrocardiogram sequences data analytics and classification using unsupervi...
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
MENA-ECEONOMIC-CONTEXT-VC MENA-ECEONOMIC
Human Computer Interaction Miterm Lesson
A symptom-driven medical diagnosis support model based on machine learning te...
Early detection and classification of bone marrow changes in lumbar vertebrae...
Module 1 Introduction to Web Programming .pptx
Lung cancer patients survival prediction using outlier detection and optimize...
agenticai-neweraofintelligence-250529192801-1b5e6870.pptx
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
Internet of Everything -Basic concepts details
IT-ITes Industry bjjbnkmkhkhknbmhkhmjhjkhj
Connector Corner: Transform Unstructured Documents with Agentic Automation
Build Real-Time ML Apps with Python, Feast & NoSQL
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
Ensemble model-based arrhythmia classification with local interpretable model...
Transform-Your-Streaming-Platform-with-AI-Driven-Quality-Engineering.pdf

London Community Summit 2016 - Fresh New Chef Stuff