Created
December 13, 2011 18:28
-
-
Save johntdyer/1473228 to your computer and use it in GitHub Desktop.
This file contains hidden or 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:: 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