To create a second version of the apache cookbook

$cd chef-repo/cookbooks/apache/attributes

$vi defualt.rb AND ADD THE LINE

default[“author”][“name”] = “PaulH”

$cd ../recipes

$vi default.rb ADD the author attribute

Change the index.html creation to:

template “/var/www/#{sitename}/index.html” do
source “index.html.erb”
mode “0644”
variables ({
:tobewritten=>”To Be Written”,
notifies :restart, “service[httpd]”

$ cd ../templates/default

$ vi index.html.erb

add a heading line e.g.

H2 H2

$ cd ../../
$ vi metadata.rb
version          ‘0.1.0’
version          ‘0.1.5’
$ knife cookbook upload apache
Using the website we can see that the current apache version is 0.1.5
So lets make DEV use this version and we’ll set live to use 0.1.0
The author name won’t be changed in DEV because we set up an override_attribute in the DEV environment file which overrides and values set in the particular cookbooks used.
If we remove the override_attribute then the new author_name would be displayed.