Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

88 lines (70 sloc) 2.141 kb
#
# Cookbook Name:: altcointip
# Recipe:: coins
#
# Copyright 2013, vindimy@gmail.com
#
# All rights reserved - Do Not Redistribute
#
# Install cryptocoins
directory File.join(node[:altcointip][:install_dir], 'coins') do
action :create
mode '0755'
user node[:altcointip][:user]
group node[:altcointip][:group]
recursive true
end
::Chef::Recipe.send(:include, Opscode::OpenSSL::Password)
include_recipe "crypto-coin::default"
node[:altcointip][:cryptocoins].each do |key,coin|
if coin[:enabled]
node.set_unless[:altcointip][:cryptocoins]["#{coin[:name]}"][:rpcpassword] = secure_password
home_dir = File.join(node[:altcointip][:install_dir], 'coins', coin[:name])
directory home_dir do
action :create
recursive true
group coin[:group] || node[:altcointip][:user_group]
end
if coin[:extra_packages]
coin[:extra_packages].each do |pkg|
package pkg
end
end
crypto_coin coin[:name] do
repository coin[:git_repo]
revision coin[:git_revision]
compile_cmd coin[:compile_cmd] || nil
port coin[:port]
rpcport coin[:rpcport]
rpcpassword node[:altcointip][:cryptocoins]["#{coin[:name]}"][:rpcpassword]
extra_config coin[:extra_config] || {}
group coin[:group] || node[:altcointip][:user_group]
home home_dir
executable coin[:executable]
autostart coin[:autostart]
respawn_times '1'
respawn_seconds '60'
end
service coin[:name] do
provider Chef::Provider::Service::Upstart
action coin[:autostart] ? :start : :nothing
end
# Relax file permissions
file "/opt/crypto_coins/#{coin[:name]}/src/#{coin[:name]}d" do
mode '0755'
end
file "#{node[:altcointip][:install_dir]}/coins/#{coin[:name]}/#{coin[:name]}.conf" do
mode '0644'
end
end
end
template '/etc/profile.d/coin_alias.sh' do
source 'coin_alias.sh.erb'
backup false
user 'root'
group 'root'
mode '0755'
variables({
:coins => node[:altcointip][:cryptocoins]
})
end
Jump to Line
Something went wrong with that request. Please try again.