[chef] help changing recipe to definition


Chronological Thread 
  • From: Manoj Thakkar < >
  • To: " " < >
  • Subject: [chef] help changing recipe to definition
  • Date: Fri, 4 Oct 2013 00:25:55 -0700

Hi,

I am looking for some good example for chef definition,  or may be someone can help me change my recipe in to a definition so that i can use it in any recipe.

* this is the use case , i have this tomcat web deployment for 10+ wars since the deployment mechanism remains the same for every war i think a definition is the right thing to do, correct me if i am wrong

here is my recipe  .Please help change it to a definition and an example of a recipe  on how to use it, appreciate your help


cookbook_file "#{node[:tcat][:base_dir]}/webapps/#{node[:tcat][:war_name]}.war" do
  source "#{node[:tcat][:war_name]}-#{node[:file][:version]}.war"
  mode 0777
  owner "deploy"
  group "deploy"
end
remote_file "#{node[:tcat][:base_dir]}/#{node[:tcat][:env]}-config.zip" do
  mode '777'
  owner "deploy"
 notifies :run,  "bash[unzip_file]", :immediately
end

bash "unzip_file" do
   cwd "#{node[:tcat][:base_dir]}"
   code <<-EOS
   pwd
   unzip "#{node[:tcat][:env]}-config.zip"
   EOS
  action :nothing
end

link "#{node[:tcat][:base_dir]}/cas-config" do
  to "#{node[:tcat][:env]}-config"
end





  • [chef] help changing recipe to definition, Manoj Thakkar, 10/04/2013

Archive powered by MHonArc 2.6.16.

§