WORKSTATION

$ cd chef-repo

$ knife cookbook create apache

$ cd cookbooks/apache/recipes

$ vi default.rb

#

# Cookbook Name:: apache

# Recipe:: default

#

# Copyright 2016, YOUR_COMPANY_NAME

#

# All rights reserved – Do Not Redistribute

#

package “httpd” do

action :install

end

service “httpd” do

action [:enable, :start]

end

$ knife cookbook upload apache

$ knife node run_list add “recipe[apache]”

CLIENT

$ chef-client

WORKSTATION

$ knife cookbook create secdel

$ cd cookbooks/security/recipes

$ vi default.rb

file “/etc/chef/validation.pem” do

action :delete

end

$ knife cookbook upload secdel

$ knife node run_list add -b “recipe[apache]” “recipe[secdel]”

CLIENT

$ chef-client