Good example of a definition here :)LWRPs are where it's at nowadays though definitions are a bit easier to understand I think.If people feel strongly about it though, convert that to a LWRP and I'll be happy to update the book!--On Fri, Oct 4, 2013 at 8: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 wronghere is my recipe .Please help change it to a definition and a use case on how to sue itcookbook_file "#{node[:tcat][:base_dir]}/webapps/#{node[:tcat][:war_name]}.war" dosource "#{node[:tcat][:war_name]}-#{node[:file][:version]}.war"mode 0777owner "deploy"group "deploy"endremote_file "#{node[:tcat][:base_dir]}/#{node[:tcat][:env]}-config.zip" domode '777'owner "deploy"notifies :run, "bash[unzip_file]", :immediatelyendbash "unzip_file" docwd "#{node[:tcat][:base_dir]}"code <<-EOSpwdunzip "#{node[:tcat][:env]}-config.zip"EOSaction :nothingendlink "#{node[:tcat][:base_dir]}/cas-config" doto "#{node[:tcat][:env]}-config"end
Andy Gale
http://andy-gale.com
http://twitter.com/andygale
Archive powered by MHonArc 2.6.16.