(Virtualization and Cloud) • Application stacks and their configuration are becoming increasingly more intricate • We increasingly get so bogged down in having to manage more and more complexity that we don’t have time to work on innovative solutions that add value to the company Sunday, June 3, 12
Language syntax that is easy to understand and handles most tasks • When you need to go beyond the DSL you can code in pure Ruby without any restrictions • Many parts of Chef itself are written in Ruby • You don’t need to master Ruby. You need to know “just enough”. We’ll cover that in a later workshop. Sunday, June 3, 12
• Have parameters • Take action to put the resource in the declared state • Can send notifications to other resources package “haproxy” do action :install end template “/etc/haproxy/haproxy.cfg” do source “haproxy.cfg.erb” owner “root” group “root” mode 0644 notifies :restart, “service[haproxy]” end services “haproxy” do supports :restart => true action [:enable, :start] end Sunday, June 3, 12
appear. • Each resource object is added to the Resource Collection. package “haproxy” do action :install end template “/etc/haproxy/haproxy.cfg” do source “haproxy.cfg.erb” owner “root” group “root” mode 0644 notifies :restart, “service[haproxy]” end services “haproxy” do supports :restart => true action [:enable, :start] end CHEF RECIPES Sunday, June 3, 12
process in order include_recipe “apache2” include_recipe “apache2::mod_rewrite” include_recipe “apache2::mod_deflate” include_recipe “apache2::mod_headers” include_recipe “apache2::mod_php5” Sunday, June 3, 12
data through search template “/etc/haproxy/haproxy.cfg” do source “haproxy.cfg.erb” owner “root” group “root” mode 0644 notifies :restart, “service[haproxy]” end pool_members = search(“node”, “role:mediawiki”) template “/etc/haproxy/haproxy.cfg.erb” do source “haproxy.cfg.erb” owner “root” group “root” mode 0644 variables :pool_members => pool_members notifies :restart, “service[haproxy]” end Sunday, June 3, 12
Chef hosting options and Chef Solo • Anatomy of a Chef Run • Setting up your development environment (Windows, Linux, OS X) • knife skillz - Introduction to knife • Live Demo • Material will be more interactive and hands-on Sunday, June 3, 12