[chef] Unpacking and installing from archives, tarballs, and zipfiles with the Ark resource


Chronological Thread 
  • From: Bryan Berry < >
  • To:
  • Subject: [chef] Unpacking and installing from archives, tarballs, and zipfiles with the Ark resource
  • Date: Wed, 21 Mar 2012 09:42:10 +0100

You can find the full blog post here http://devopsanywhere.blogspot.com/2012/03/managing-archives-with-ark-resource.html

Here is my resource for unpacking and installing from archives, the ark resource

replace this ugly mess

# download the file
remote_file "Chef::Config[:file_cache_path]/jdk-7.2.tar.gz" do
  checksum '89ba5fde0c596db388c3bbd265b63007a9cc3df3a8e6d79a46780c1a39408cb5'
end

# unpack it
bash "unpack java" do
   code <<-EOS
tar xzf #{Chef::Config[:file_cache_path]/jdk-7.2.tar.gz} --strip-components=1 -C /usr/local/jdk-7.2
EOS
end

# indicate that this is the latest jdk
# yeah, I install multiple jdk's on a single machine for some apps which require the i386 arch
link "/usr/local/jvm" do
   to "/usr/local/jdk-7.2"
end

# put the java command in the PATH
link "/usr/local/jvm/bin/java" do
   to "/usr/local/bin/java"
end

with this

ark 'jdk' do   url 'http://download.oracle.com/jdk-7u2-linux-x64.tar.gz'   version '7.2'   checksum '89ba5fde0c596db388c3bbd265b63007a9cc3df3a8e6d79a46780c1a39408cb5'   has_binaries [ 'bin/java', 'bin/javac', 'bin/javaws' ]
end

you can find it on github.com at
https://github.com/bryanwb/chef-ark


  • [chef] Unpacking and installing from archives, tarballs, and zipfiles with the Ark resource, Bryan Berry, 03/21/2012

Archive powered by MHonArc 2.6.16.

§