rubber 2.1.2 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.travis.yml +2 -4
- data/CHANGELOG +98 -0
- data/LICENSE +10 -336
- data/lib/rubber/cloud/aws.rb +8 -8
- data/lib/rubber/commands/cron.rb +1 -1
- data/lib/rubber/commands/util.rb +46 -0
- data/lib/rubber/encryption.rb +46 -0
- data/lib/rubber/environment.rb +24 -5
- data/lib/rubber/recipes/rubber.rb +1 -1
- data/lib/rubber/recipes/rubber/instances.rb +97 -37
- data/lib/rubber/recipes/rubber/setup.rb +9 -4
- data/lib/rubber/recipes/rubber/static_ips.rb +3 -2
- data/lib/rubber/version.rb +1 -1
- data/rubber.gemspec +1 -2
- data/templates/apache/config/rubber/rubber-apache.yml +2 -2
- data/templates/base/config/deploy.rb +1 -1
- data/templates/base/config/rubber/common/crontab +1 -3
- data/templates/base/config/rubber/common/gemrc +5 -0
- data/templates/base/config/rubber/common/rubber.profile +0 -3
- data/templates/base/config/rubber/common/ruby.profile +9 -0
- data/templates/base/config/rubber/deploy-setup.rb +45 -65
- data/templates/base/config/rubber/rubber-ruby.yml +21 -0
- data/templates/base/config/rubber/rubber.yml +8 -3
- data/templates/base/script/rubber +7 -3
- data/templates/collectd/config/rubber/role/passenger/collectd-passenger.rb.conf +2 -2
- data/templates/collectd/config/rubber/role/passenger/passenger-status-sudoers.conf +2 -2
- data/templates/complete_unicorn_nginx/config/rubber/rubber-complete.yml +2 -3
- data/templates/complete_unicorn_nginx/templates.yml +0 -1
- data/templates/elasticsearch/config/rubber/deploy-elasticsearch.rb +1 -1
- data/templates/elasticsearch/config/rubber/rubber-elasticsearch.yml +1 -1
- data/templates/graphite/config/rubber/deploy-graphite.rb +9 -52
- data/templates/graphite/config/rubber/role/graphite_server/carbon.conf +1 -1
- data/templates/graphite/config/rubber/role/graphite_server/graphite-collectd-ping.conf +11 -0
- data/templates/graphite/config/rubber/role/graphite_server/monit-graphite_server.conf +8 -0
- data/templates/graphite/config/rubber/role/graphite_web/graphite_web-upstart.conf +15 -0
- data/templates/graphite/config/rubber/role/graphite_web/monit-graphite_web.conf +7 -0
- data/templates/graphite/config/rubber/role/graphite_web/uwsgi.ini +16 -0
- data/templates/graphite/config/rubber/rubber-graphite.yml +6 -4
- data/templates/graphite/templates.yml +2 -0
- data/templates/mongrel/config/rubber/deploy-mongrel.rb +1 -1
- data/templates/monit/config/rubber/role/mongrel/monit-mongrel.conf +2 -2
- data/templates/munin/config/rubber/role/munin/munin-plugins.conf +3 -3
- data/templates/munin/config/rubber/role/passenger/munin-passenger-memory.conf +1 -1
- data/templates/munin/config/rubber/role/passenger/munin-passenger-sudoers.conf +2 -2
- data/templates/munin/config/rubber/role/passenger/munin-passenger.conf +1 -1
- data/templates/munin/config/rubber/role/passenger_nginx/munin-passenger-memory.conf +1 -1
- data/templates/munin/config/rubber/role/passenger_nginx/munin-passenger-sudoers.conf +2 -2
- data/templates/munin/config/rubber/role/passenger_nginx/munin-passenger.conf +1 -1
- data/templates/passenger/config/rubber/deploy-passenger.rb +5 -11
- data/templates/passenger/config/rubber/role/passenger/passenger-apache-vhost.conf +12 -0
- data/templates/passenger/config/rubber/rubber-passenger.yml +3 -3
- data/templates/passenger_nginx/config/rubber/role/passenger_nginx/nginx.conf +1 -1
- data/templates/passenger_nginx/config/rubber/rubber-passenger_nginx.yml +2 -2
- data/templates/postgresql/config/rubber/deploy-postgresql.rb +47 -0
- data/templates/redis/config/rubber/rubber-redis.yml +1 -1
- data/templates/resque/templates.yml +0 -1
- data/templates/sidekiq/config/rubber/deploy-sidekiq.rb +35 -0
- data/templates/sidekiq/config/rubber/role/sidekiq/monit-sidekiq.conf +10 -0
- data/templates/sidekiq/config/rubber/rubber-sidekiq.yml +2 -0
- data/templates/sidekiq/templates.rb +2 -0
- data/templates/sidekiq/templates.yml +4 -0
- data/templates/solr/config/rubber/common/solr_sunspot.yml +10 -0
- data/templates/solr/config/rubber/deploy-solr.rb +78 -0
- data/templates/solr/config/rubber/rubber-solr.yml +10 -0
- data/templates/solr/templates.yml +3 -0
- data/templates/sphinx/config/rubber/deploy-sphinx.rb +4 -4
- data/templates/torquebox/config/rubber/deploy-torquebox.rb +16 -4
- data/templates/torquebox/config/rubber/role/app/torquebox-apache-vhost.conf +15 -5
- data/templates/torquebox/config/rubber/role/torquebox/graylog-logging-module.xml +9 -0
- data/templates/torquebox/config/rubber/role/torquebox/standalone-ha.xml +25 -7
- data/templates/torquebox/config/rubber/role/torquebox/standalone.conf +2 -2
- data/templates/torquebox/config/rubber/rubber-torquebox.yml +6 -3
- data/templates/zookeeper/config/rubber/rubber-zookeeper.yml +1 -1
- data/test/command_test.rb +7 -5
- data/test/commands/cron_test.rb +22 -18
- data/test/commands/util_test.rb +40 -0
- data/test/encryption_test.rb +59 -0
- data/test/environment_test.rb +14 -0
- data/test/fixtures/obfuscated/rubber.yml +3 -0
- data/test/fixtures/obfuscated/secret.yml +1 -0
- metadata +33 -12
- data/templates/base/config/rubber/rubber-rvm.yml +0 -42
- data/templates/complete_passenger/templates.rb +0 -9
- data/templates/complete_passenger_nginx/templates.rb +0 -8
- data/templates/complete_unicorn_nginx/config/rubber/role/haproxy/haproxy-unicorn.conf +0 -21
- data/templates/complete_unicorn_nginx/templates.rb +0 -8
- data/templates/graphite/config/rubber/role/graphite_web/graphite-vhost.conf +0 -62
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
roles:
|
|
3
3
|
apache:
|
|
4
|
-
packages: [apache2]
|
|
4
|
+
packages: [apache2, libapache2-mod-proxy-html, libcurl4-openssl-dev, libapache2-mod-xsendfile]
|
|
5
5
|
web_tools:
|
|
6
|
-
packages: [libapache2-mod-proxy-html]
|
|
6
|
+
packages: [apache2, libapache2-mod-proxy-html, libcurl4-openssl-dev, libapache2-mod-xsendfile]
|
|
@@ -6,7 +6,7 @@ on :load do
|
|
|
6
6
|
set :application, rubber_env.app_name
|
|
7
7
|
set :runner, rubber_env.app_user
|
|
8
8
|
set :deploy_to, "/mnt/#{application}-#{Rubber.env}"
|
|
9
|
-
set :copy_exclude, [".git/*", ".bundle/*", "log/*", ".rvmrc"]
|
|
9
|
+
set :copy_exclude, [".git/*", ".bundle/*", "log/*", ".rvmrc", ".rbenv-version"]
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
# Use a simple directory tree copy here to make demo easier.
|
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
%>
|
|
6
6
|
|
|
7
|
-
# cron clears out environment variables
|
|
8
|
-
# "rvm do default" to run, so no longer any need to setup ruby env vars here,
|
|
9
|
-
# all we need is PATH
|
|
7
|
+
# cron clears out environment variables. All we need is PATH.
|
|
10
8
|
PATH=<%= ENV['PATH'] %>
|
|
11
9
|
|
|
12
10
|
MAILTO=<%= rubber_env.admin_email %>
|
|
@@ -1,83 +1,63 @@
|
|
|
1
1
|
namespace :rubber do
|
|
2
2
|
namespace :base do
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
rubber.allow_optional_tasks(self)
|
|
5
5
|
|
|
6
|
-
before "rubber:setup_gem_sources", "rubber:base:
|
|
7
|
-
task :
|
|
8
|
-
rubber.sudo_script "
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
chmod +x rvm-installer
|
|
13
|
-
rm -f /etc/rvmrc
|
|
14
|
-
rvm_path=#{rubber_env.rvm_prefix} ./rvm-installer --version #{rubber_env.rvm_version}
|
|
6
|
+
before "rubber:setup_gem_sources", "rubber:base:install_ruby_build"
|
|
7
|
+
task :install_ruby_build do
|
|
8
|
+
rubber.sudo_script "install_ruby_build", <<-ENDSCRIPT
|
|
9
|
+
if [[ ! `ruby-build --version 2> /dev/null` =~ "#{rubber_env.ruby_build_version}" ]]; then
|
|
10
|
+
echo "Installing ruby-build v#{rubber_env.ruby_build_version}"
|
|
11
|
+
wget -q https://github.com/sstephenson/ruby-build/archive/v#{rubber_env.ruby_build_version}.tar.gz -O /tmp/ruby-build.tar.gz
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
# Install ruby-build.
|
|
14
|
+
tar -C /tmp -zxf /tmp/ruby-build.tar.gz
|
|
15
|
+
cd /tmp/ruby-build-*
|
|
16
|
+
./install.sh
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
# Clean up after ourselves.
|
|
19
|
+
cd /root
|
|
20
|
+
rm -rf /tmp/ruby-build-*
|
|
21
|
+
rm -f /tmp/ruby-build.tar.gz
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
fi
|
|
23
|
+
# Get rid of RVM if this is an older rubber installation.
|
|
24
|
+
if type rvm &> /dev/null; then
|
|
25
|
+
rvm implode
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
rm -rf /usr/local/rvm
|
|
28
|
+
rm -f /usr/bin/rvm*
|
|
29
|
+
rm -f ~/.gemrc
|
|
31
30
|
fi
|
|
31
|
+
fi
|
|
32
32
|
ENDSCRIPT
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
opts = get_host_options('rvm_ruby')
|
|
43
|
-
|
|
44
|
-
# sudo_script only takes a single hash with host -> VAR, so combine our
|
|
45
|
-
# two vars so we can extract them out in the bash script
|
|
46
|
-
install_opts = get_host_options('rvm_install_options')
|
|
47
|
-
install_opts.each do |k, v|
|
|
48
|
-
opts[k] = "#{opts[k]} #{v}"
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
install_rvm_ruby_script = <<-ENDSCRIPT
|
|
52
|
-
rvm_ver=$1
|
|
53
|
-
shift
|
|
54
|
-
install_opts=$*
|
|
55
|
-
|
|
56
|
-
if [[ ! `rvm list default 2> /dev/null` =~ "$rvm_ver" ]]; then
|
|
57
|
-
echo "RVM is compiling/installing ruby $rvm_ver, this may take a while"
|
|
58
|
-
|
|
59
|
-
nohup rvm install $rvm_ver $install_opts &> /tmp/install_rvm_ruby.log &
|
|
60
|
-
sleep 1
|
|
35
|
+
after "rubber:base:install_ruby_build", "rubber:base:install_ruby"
|
|
36
|
+
task :install_ruby do
|
|
37
|
+
rubber.sudo_script "install_ruby", <<-ENDSCRIPT
|
|
38
|
+
installed_ruby_ver=`which ruby | cut -d / -f 5`
|
|
39
|
+
desired_ruby_ver="#{rubber_env.ruby_version}"
|
|
40
|
+
if [[ ! $installed_ruby_ver =~ $desired_ruby_ver ]]; then
|
|
41
|
+
echo "Compiling and installing ruby $desired_ruby_ver. This may take a while ..."
|
|
61
42
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
echo -n .
|
|
65
|
-
sleep 5
|
|
66
|
-
done
|
|
43
|
+
nohup ruby-build #{rubber_env.ruby_version} #{rubber_env.ruby_path} &> /tmp/install_ruby.log &
|
|
44
|
+
sleep 1
|
|
67
45
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
46
|
+
while true; do
|
|
47
|
+
if ! ps ax | grep -q "[r]uby-build"; then break; fi
|
|
48
|
+
echo -n .
|
|
49
|
+
sleep 5
|
|
50
|
+
done
|
|
71
51
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
rvm repair environments
|
|
76
|
-
rvm use $rvm_ver
|
|
77
|
-
fi
|
|
52
|
+
echo "export RUBYOPT=rubygems\nexport PATH=#{rubber_env.ruby_path}/bin:$PATH" > /etc/profile.d/ruby.sh
|
|
53
|
+
echo "--- \ngem: --no-ri --no-rdoc" > /etc/gemrc
|
|
54
|
+
fi
|
|
78
55
|
ENDSCRIPT
|
|
79
|
-
|
|
80
|
-
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# ensure that the profile script gets sourced by reconnecting
|
|
59
|
+
after "rubber:base:install_ruby" do
|
|
60
|
+
teardown_connections_to(sessions.keys)
|
|
81
61
|
end
|
|
82
62
|
|
|
83
63
|
after "rubber:install_packages", "rubber:base:configure_git" if scm == "git"
|
|
@@ -90,7 +70,7 @@ namespace :rubber do
|
|
|
90
70
|
fi
|
|
91
71
|
ENDSCRIPT
|
|
92
72
|
end
|
|
93
|
-
|
|
73
|
+
|
|
94
74
|
# We need a rails user for safer permissions used by deploy.rb
|
|
95
75
|
after "rubber:install_packages", "rubber:base:custom_install"
|
|
96
76
|
task :custom_install do
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# ruby-build needs some extra packages to compile/install ruby runtimes
|
|
2
|
+
# curl is required.
|
|
3
|
+
# patch is required (for ree, some ruby head's).
|
|
4
|
+
# For JRuby (if you wish to use it) you will need:
|
|
5
|
+
# aptitude install curl sun-java6-bin sun-java6-jre sun-java6-jdk
|
|
6
|
+
# For MRI & ree (if you wish to use it) you will need:
|
|
7
|
+
# aptitude install curl bison build-essential zlib1g-dev libssl-dev libreadline5-dev libxml2-dev git-core
|
|
8
|
+
# For IronRuby (if you wish to use it) you will need:
|
|
9
|
+
# aptitude install curl mono-2.0-devel
|
|
10
|
+
|
|
11
|
+
packages: [build-essential, git-core, subversion, curl, autoconf, bison, ruby, zlib1g-dev, libssl-dev, libreadline6-dev, libxml2-dev, libyaml-dev]
|
|
12
|
+
|
|
13
|
+
# REQUIRED: The version of ruby-build to use for building ruby.
|
|
14
|
+
ruby_build_version: 20130206
|
|
15
|
+
|
|
16
|
+
# REQUIRED: Set to the version string for the ruby version you wish to use
|
|
17
|
+
# Run "ruby-build --definitions" to see the list of possible options
|
|
18
|
+
ruby_version: 1.9.3-p385
|
|
19
|
+
|
|
20
|
+
# REQUIRED: Installation path for ruby.
|
|
21
|
+
ruby_path: "/usr/local/rubies/#{ruby_version}"
|
|
@@ -30,6 +30,11 @@ domain: foo.com
|
|
|
30
30
|
#
|
|
31
31
|
# rubber_secret: "#{File.expand_path('~') + '/.ec2' + (Rubber.env == 'production' ? '' : '_dev') + '/rubber-secret.yml' rescue ''}"
|
|
32
32
|
|
|
33
|
+
# OPTIONAL: Encryption key that was used to obfuscate the contents of rubber-secret.yml with "rubber util:obfuscation"
|
|
34
|
+
# Not that much better when stored in here, but you could use a ruby snippet in here to fetch it from a key server or something
|
|
35
|
+
#
|
|
36
|
+
# rubber_secret_key: "XXXyyy=="
|
|
37
|
+
|
|
33
38
|
# REQUIRED All known cloud providers with the settings needed to configure them
|
|
34
39
|
# There's only one working cloud provider right now - Amazon Web Services
|
|
35
40
|
# To implement another, clone lib/rubber/cloud/aws.rb or make the fog provider
|
|
@@ -52,7 +57,7 @@ cloud_providers:
|
|
|
52
57
|
#
|
|
53
58
|
access_key: XXX
|
|
54
59
|
secret_access_key: YYY
|
|
55
|
-
account: ZZZ
|
|
60
|
+
account: 'ZZZ'
|
|
56
61
|
|
|
57
62
|
# REQUIRED: The name of the amazon keypair and location of its private key
|
|
58
63
|
#
|
|
@@ -78,8 +83,8 @@ cloud_providers:
|
|
|
78
83
|
# Ubuntu 12.04 Precise instance-store 64-bit: ami-eafa5883
|
|
79
84
|
#
|
|
80
85
|
# m1.small or m1.large or m1.xlarge
|
|
81
|
-
image_type:
|
|
82
|
-
image_id: ami-
|
|
86
|
+
image_type: c1.medium
|
|
87
|
+
image_id: ami-d726abbe
|
|
83
88
|
|
|
84
89
|
# OPTIONAL: EC2 spot instance request support.
|
|
85
90
|
#
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
export RUBBER_ROOT=`dirname $0`/..
|
|
4
4
|
export BUNDLE_GEMFILE=$RUBBER_ROOT/Gemfile
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
#
|
|
8
|
-
|
|
6
|
+
if type rvm &> /dev/null; then
|
|
7
|
+
# run through "rvm do" so we work in crontab - default rvm ruby
|
|
8
|
+
# version is set during bootstrap
|
|
9
|
+
rvm default do bundle exec rubber "$@"
|
|
10
|
+
else
|
|
11
|
+
bundle exec rubber "$@"
|
|
12
|
+
fi
|
|
@@ -36,7 +36,7 @@ INTERVAL = (ENV["COLLECTD_INTERVAL"] || 60).to_i
|
|
|
36
36
|
loop do
|
|
37
37
|
start_time = Time.now.to_i
|
|
38
38
|
|
|
39
|
-
status = `sudo <%= rubber_env.
|
|
39
|
+
status = `sudo <%= rubber_env.ruby_path %>/bin/passenger-status`
|
|
40
40
|
unless $?.success?
|
|
41
41
|
$stderr.puts "failed executing passenger-status"
|
|
42
42
|
exit 1
|
|
@@ -59,7 +59,7 @@ loop do
|
|
|
59
59
|
puts "PUTVAL #{HOSTNAME}/passenger/gauge-total_sessions interval=#{INTERVAL} N:#{total_sessions}"
|
|
60
60
|
|
|
61
61
|
|
|
62
|
-
status = `sudo <%= rubber_env.
|
|
62
|
+
status = `sudo <%= rubber_env.ruby_path %>/bin/passenger-memory-stats | tail -1`
|
|
63
63
|
unless $?.success?
|
|
64
64
|
$stderr.puts "failed executing passenger-memory-stats"
|
|
65
65
|
exit 1
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
%>
|
|
5
5
|
Defaults env_keep += GEM_PATH
|
|
6
6
|
|
|
7
|
-
nobody ALL=(ALL) NOPASSWD: <%= rubber_env.
|
|
8
|
-
nobody ALL=(ALL) NOPASSWD: <%= rubber_env.
|
|
7
|
+
nobody ALL=(ALL) NOPASSWD: <%= rubber_env.ruby_path %>/bin/passenger-status
|
|
8
|
+
nobody ALL=(ALL) NOPASSWD: <%= rubber_env.ruby_path %>/bin/passenger-memory-stats
|
|
@@ -9,7 +9,7 @@ namespace :rubber do
|
|
|
9
9
|
task :install, :roles => :elasticsearch do
|
|
10
10
|
rubber.sudo_script 'install_elasticsearch', <<-ENDSCRIPT
|
|
11
11
|
if [[ ! -d "#{rubber_env.elasticsearch_dir}" ]]; then
|
|
12
|
-
wget --no-check-certificate -qNP /tmp
|
|
12
|
+
wget --no-check-certificate -qNP /tmp http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-#{rubber_env.elasticsearch_version}.zip
|
|
13
13
|
unzip -d #{rubber_env.elasticsearch_prefix} /tmp/elasticsearch-#{rubber_env.elasticsearch_version}.zip
|
|
14
14
|
rm /tmp/elasticsearch-#{rubber_env.elasticsearch_version}.zip
|
|
15
15
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
namespace :rubber do
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
namespace :graphite do
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
rubber.allow_optional_tasks(self)
|
|
7
7
|
|
|
8
8
|
after "rubber:install_packages", "rubber:graphite:install_collectd_graphite_plugin"
|
|
@@ -21,53 +21,6 @@ namespace :rubber do
|
|
|
21
21
|
ENDSCRIPT
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
# graphite collectd plugin needs newer collectd (>= 4.9)
|
|
25
|
-
before "rubber:install_packages", "rubber:graphite:setup_apt_backport_of_collectd"
|
|
26
|
-
|
|
27
|
-
task :setup_apt_backport_of_collectd do
|
|
28
|
-
sources = <<-EOF
|
|
29
|
-
deb http://gb.archive.ubuntu.com/ubuntu/ maverick main universe
|
|
30
|
-
deb-src http://gb.archive.ubuntu.com/ubuntu/ maverick main universe
|
|
31
|
-
EOF
|
|
32
|
-
sources.gsub!(/^[ \t]*/, '')
|
|
33
|
-
|
|
34
|
-
prefs = <<-EOF
|
|
35
|
-
Package: *
|
|
36
|
-
Pin: release a=maverick
|
|
37
|
-
Pin-Priority: 400
|
|
38
|
-
|
|
39
|
-
Package: libxml2
|
|
40
|
-
Pin: release a=maverick
|
|
41
|
-
Pin-Priority: 900
|
|
42
|
-
|
|
43
|
-
Package: libxml2-dev
|
|
44
|
-
Pin: release a=maverick
|
|
45
|
-
Pin-Priority: 900
|
|
46
|
-
|
|
47
|
-
Package: collectd-core
|
|
48
|
-
Pin: release a=maverick
|
|
49
|
-
Pin-Priority: 900
|
|
50
|
-
|
|
51
|
-
Package: collectd-utils
|
|
52
|
-
Pin: release a=maverick
|
|
53
|
-
Pin-Priority: 900
|
|
54
|
-
|
|
55
|
-
Package: collectd
|
|
56
|
-
Pin: release a=maverick
|
|
57
|
-
Pin-Priority: 900
|
|
58
|
-
EOF
|
|
59
|
-
prefs.gsub!(/^[ \t]*/, '')
|
|
60
|
-
|
|
61
|
-
rubber.sudo_script 'setup_apt_backport_of_collectd', <<-ENDSCRIPT
|
|
62
|
-
release=`lsb_release -sr`
|
|
63
|
-
needs_backport=`echo "$release <= 10.04" | bc`
|
|
64
|
-
if [[ $needs_backport == 1 && ! -f /etc/apt/preferences.d/rubber-collectd ]]; then
|
|
65
|
-
echo -e #{sources.inspect} > /etc/apt/sources.list.d/rubber-collectd.list
|
|
66
|
-
echo -e #{prefs.inspect} > /etc/apt/preferences.d/rubber-collectd
|
|
67
|
-
fi
|
|
68
|
-
ENDSCRIPT
|
|
69
|
-
end
|
|
70
|
-
|
|
71
24
|
task :install_graphite_from_repo, :roles => [:graphite_server, :graphite_web] do
|
|
72
25
|
rubber.sudo_script 'install_graphite_from_repo', <<-ENDSCRIPT
|
|
73
26
|
if [[ ! -d "/opt/graphite" ]]; then
|
|
@@ -142,6 +95,10 @@ namespace :rubber do
|
|
|
142
95
|
cd /tmp/#{rubber_env.graphite_carbon_package_url.gsub(/.*\//, '').gsub('.tar.gz', '')}
|
|
143
96
|
python setup.py install
|
|
144
97
|
|
|
98
|
+
rm -rf /opt/graphite/storage
|
|
99
|
+
mkdir #{rubber_env.graphite_storage_dir}
|
|
100
|
+
chown www-data:www-data #{rubber_env.graphite_storage_dir}
|
|
101
|
+
ln -s #{rubber_env.graphite_storage_dir} /opt/graphite/storage
|
|
145
102
|
fi
|
|
146
103
|
ENDSCRIPT
|
|
147
104
|
end
|
|
@@ -183,7 +140,7 @@ namespace :rubber do
|
|
|
183
140
|
else
|
|
184
141
|
after "rubber:graphite:server:install", "rubber:graphite:web:install"
|
|
185
142
|
end
|
|
186
|
-
|
|
143
|
+
|
|
187
144
|
after "rubber:graphite:server:bootstrap", "rubber:graphite:web:bootstrap"
|
|
188
145
|
|
|
189
146
|
desc <<-DESC
|
|
@@ -234,12 +191,12 @@ EOF
|
|
|
234
191
|
|
|
235
192
|
desc "Start graphite system monitoring"
|
|
236
193
|
task :start, :roles => :graphite_web do
|
|
237
|
-
rsudo "service
|
|
194
|
+
rsudo "service graphite-web start"
|
|
238
195
|
end
|
|
239
196
|
|
|
240
197
|
desc "Stop graphite system monitoring"
|
|
241
198
|
task :stop, :roles => :graphite_web do
|
|
242
|
-
rsudo "service
|
|
199
|
+
rsudo "service graphite-web stop || true"
|
|
243
200
|
end
|
|
244
201
|
|
|
245
202
|
desc "Restart graphite system monitoring"
|
|
@@ -78,7 +78,7 @@ PICKLE_RECEIVER_PORT = 2004
|
|
|
78
78
|
USE_INSECURE_UNPICKLER = False
|
|
79
79
|
|
|
80
80
|
CACHE_QUERY_INTERFACE = 0.0.0.0
|
|
81
|
-
CACHE_QUERY_PORT =
|
|
81
|
+
CACHE_QUERY_PORT = <%= rubber_env.graphite_carbon_port %>
|
|
82
82
|
|
|
83
83
|
# Set this to False to drop datapoints received after the cache
|
|
84
84
|
# reaches MAX_CACHE_SIZE. If this is True (the default) then sockets
|