Created
March 21, 2013 12:15
-
-
Save naoya/5212610 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Cookbook Name:: tiarra | |
# Recipe:: default | |
# | |
# Copyright 2013, YOUR_COMPANY_NAME | |
# | |
# All rights reserved - Do Not Redistribute | |
# | |
tiarra_version = node['tiarra']['version'] | |
src_filepath = "#{Chef::Config[:file_cache_path]}/tiarra-#{tiarra_version}.tar.gz" | |
remote_file src_filepath do | |
source "http://www.clovery.jp/tiarra/archive/2010/02/tiarra-20100212.tar.gz" | |
mode 0644 | |
end | |
bash 'install tiarra' do | |
user node['tiarra']['user'] | |
cwd ::File.dirname(src_filepath) | |
code <<-EOF | |
tar xzf #{src_filepath} -C #{node['tiarra']['dir']} | |
EOF | |
not_if { ::File.exists?("#{node['tiarra']['dir']}/tiarra-#{tiarra_version}") } | |
end | |
link node['tiarra']['dir'] + "/tiarra" do | |
to "#{node['tiarra']['dir']}/tiarra-#{tiarra_version}" | |
owner node['tiarra']['user'] | |
group node['tiarra']['group'] | |
end | |
template node['tiarra']['dir'] + "/tiarra/tiarra.conf" do | |
owner node['tiarra']['user'] | |
group node['tiarra']['group'] | |
mode 0644 | |
# notifies :reload, 'service[supervisor]' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment