[chef] Re: My first chef cookbook


Chronological Thread 
  • From: Ringo De Smet < >
  • To:
  • Subject: [chef] Re: My first chef cookbook
  • Date: Tue, 29 Jun 2010 08:46:44 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=iJNrec7m2vhdOWsa4wQ/GVOrPDpNLtKmZnlvYOWcIWhlo4rMW+kW9oTqpQgZ1zgCL5 gHBDbJUZy0bab25PWJrNMwHrxmWgkfe4DWXYeFk2RFKlRFwzZ0wSC0/2WI5bX/wQjDCY 5rozBKoy4nhDoGYMwpJ+/6GEdnuBlFPvIz96Q=

Pablo,

On 29 June 2010 01:46, Pablo Kang 
< >
 wrote:
> Wrote a blog post on my experience writing my first cookbook. It takes a
> step by step approach. Thought it might be useful for folks just getting
> their feet wet like I am.
> http://blazingcloud.net/2010/06/28/our-first-chef-cookbook/

As another user of Chef, I suggest an improvement to your cookbook.
Your openfire default recipe contains this snippet:

execute "wget" do
 tarball_url = 
"http://www.igniterealtime.org/downloadServlet?filename=openfire/#{tarball}";
 cwd "/tmp"
 command "wget #{tarball_url}"
 creates "/tmp/#{tarball}"
 action :run
end

Retrieving a remote file is better done by the "remote_file" (1) resource:

remote_file "/tmp/#{tarball}" do
  source 
"http://www.igniterealtime.org/downloadServlet?filename=openfire/#{tarball}";
  mode "0644"
  checksum "08da002l" # A SHA256 (or portion thereof) of the file.
end

(1) http://wiki.opscode.com/display/chef/Resources#Resources-RemoteFile

Cheers,

Ringo



Archive powered by MHonArc 2.6.16.

§