"haproxy.cfg.erb" owner "root" group "root" mode 0644 notifies :restart, "service[haproxy]" end service "haproxy" do supports :restart => true action [:enable, :start] end Chef Enables Infrastructure as Code • Resources • Recipes • Cookbooks and Roles • Source Code 15 Thursday, April 18, 13
chef_config['validation_key'] end template "/etc/chef/client.rb" do variables(:chef_config => chef_config) end file "/etc/chef/opsworks.json" do content chef_config.to_json end 33 Thursday, April 18, 13
#{chef_node_name} from Chef Server" do block do Chef::Node.load(chef_node_name).destroy Chef::ApiClient.load(chef_node_name).destroy end end file "/etc/chef/client.pem" do action :delete end 36 Thursday, April 18, 13
~20 cookbooks • Chef community site has over 800 cookbooks • Newer versions of Chef have incompatible features (platform family, attribute setting) 37 Thursday, April 18, 13