[chef] Re: good example of chef definitions ? need help with issue below


Chronological Thread 
  • From: Ranjib Dey < >
  • To:
  • Subject: [chef] Re: good example of chef definitions ? need help with issue below
  • Date: Fri, 4 Oct 2013 01:12:37 -0700

use an lwrp instead of a definition. convert the bash resource to an execute resource too. check chef wiki & docs website (or learnchef website) for lwrp development (even google should do).



On Fri, Oct 4, 2013 at 12:24 AM, Manoj Thakkar < " target="_blank"> > wrote:
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 a use case on how to sue it

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






Archive powered by MHonArc 2.6.16.

§