Skip to content

Instantly share code, notes, and snippets.

@johntdyer
Created December 13, 2011 18:28
Show Gist options
  • Select an option

  • Save johntdyer/1473228 to your computer and use it in GitHub Desktop.

Select an option

Save johntdyer/1473228 to your computer and use it in GitHub Desktop.
#
# Cookbook Name:: cassandra
# Recipe:: default
#
# Copyright 2011, Voxeo Labs ©2011
#
# All rights reserved - Do Not Redistribute
#
%w(/var/log/cassandra /var/lib/cassandra /opt/chef/cassandra).each do |dir|
directory dir do
owner "root"
group "root"
mode "0755"
recursive true
action :create
end
end
remote_file "/opt/chef/cassandra/apache-cassandra-1.0.5-bin.tar.gz" do
source "https://ec2-chef-deployment-assets.s3.amazonaws.com/cassandra/apache-cassandra-1.0.5-bin.tar.gz"
mode "0644"
checksum "d7c2edacddd91f4b01548747ae56c27e3bf2c20a3fc09826810530d3d33343c4" # A SHA256 (or portion thereof) of the file.
notifies :run, "script[install_cassandra]", :immediately
end
template "/etc/init.d/cassandra" do
source "cassandra.erb"
owner "root"
group "root"
mode "0744"
end
script "install_cassandra" do
action :nothing
interpreter "bash"
user "root"
cwd "/tmp"
code <<-EOH
tar -zxf /opt/chef/cassandra/apache-cassandra-1.0.5-bin.tar.gz -C /opt
EOH
end
service "cassandra" do
action [:enable,:start]
supports :status=>true, :restart=>true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment