rubber 1.5.5 → 1.5.6

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ 1.5.5
2
+ -----
3
+
4
+ only existingg config files should be listed to fix non-existing env yml when doing a push_config <9fbb7ba> [Matt Conway]
5
+
1
6
  1.5.4
2
7
  -----
3
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.5.5
1
+ 1.5.6
@@ -6,6 +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/*", "log/*"]
9
10
  end
10
11
 
11
12
  # Use a simple directory tree copy here to make demo easier.
@@ -3,14 +3,43 @@ namespace :rubber do
3
3
 
4
4
  rubber.allow_optional_tasks(self)
5
5
 
6
- before "rubber:install_gems", "rubber:base:install_rvm"
6
+ before "rubber:setup_gem_sources", "rubber:base:install_rvm"
7
7
  task :install_rvm do
8
8
  rubber.sudo_script "install_rvm", <<-ENDSCRIPT
9
9
  if [[ `rvm --version 2> /dev/null` == "" ]]; then
10
10
  echo "rvm_prefix=/usr/local" > /etc/rvmrc
11
- wget -qNP /tmp http://rvm.beginrescueend.com/releases/rvm-install-head
12
- bash /tmp/rvm-install-head
13
11
  echo "#{rubber_env.rvm_prepare}" > /etc/profile.d/rvm.sh
12
+
13
+ # Copied below from http://rvm.beginrescueend.com/releases/rvm-install-latest
14
+ #
15
+
16
+ if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
17
+
18
+ if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
19
+
20
+ rvm_path="${rvm_path:-$HOME/.rvm}"
21
+
22
+ mkdir -p $rvm_path/src/
23
+
24
+ builtin cd $rvm_path/src
25
+
26
+ stable_version=#{rubber_env.rvm_version}
27
+
28
+ echo "rvm-${stable_version}"
29
+
30
+ curl -L "http://rvm.beginrescueend.com/releases/rvm-${stable_version}.tar.gz" -o "rvm-${stable_version}.tar.gz"
31
+
32
+ tar zxf "rvm-${stable_version}.tar.gz"
33
+
34
+ builtin cd "rvm-${stable_version}"
35
+
36
+ dos2unix scripts/* >/dev/null 2>&1 || true
37
+
38
+ bash ./scripts/install
39
+
40
+ #
41
+ # end rvm install script
42
+
14
43
  fi
15
44
  ENDSCRIPT
16
45
  end
@@ -11,6 +11,9 @@
11
11
 
12
12
  packages: [build-essential, git-core, subversion, curl, autoconf, bison, ruby, zlib1g-dev, libssl-dev, libreadline5-dev, libxml2-dev]
13
13
 
14
+ # REQUIRED: the version of rvm itself
15
+ rvm_version: 0.1.38
16
+
14
17
  # REQUIRED: Set to the rvm version string for the ruby version you wish to use
15
18
  # Run "rvm list known" to see the list of possible options
16
19
  rvm_ruby: 1.9.2
@@ -56,3 +56,5 @@ JVM_OPTS=" \
56
56
  -Dcom.sun.management.jmxremote.port=<%= rubber_env.cassandra_jmx_port %> \
57
57
  -Dcom.sun.management.jmxremote.ssl=false \
58
58
  -Dcom.sun.management.jmxremote.authenticate=false"
59
+
60
+ ulimit -n 65536
@@ -12,7 +12,7 @@ namespace :rubber do
12
12
  rubber.sudo_script 'setup_mongrel_init', <<-ENDSCRIPT
13
13
  mkdir -p /etc/mongrel_cluster
14
14
  rm -f /etc/mongrel_cluster/#{application}-#{RUBBER_ENV}.yml && ln -s /mnt/#{application}-#{RUBBER_ENV}/current/config/mongrel_cluster.yml /etc/mongrel_cluster/#{application}-#{RUBBER_ENV}.yml
15
- find /usr/lib/ruby/gems -path "*/resources/mongrel_cluster" -exec cp {} /etc/init.d/ \\;
15
+ find #{rubber_env.rvm_version ? "$(rvm gemdir)" : "/usr/lib/ruby/gems"} -path "*/resources/mongrel_cluster" -exec cp {} /etc/init.d/ \\;
16
16
  chmod +x /etc/init.d/mongrel_cluster
17
17
  update-rc.d -f mongrel_cluster remove
18
18
  update-rc.d mongrel_cluster defaults 99 00
@@ -1,38 +1,72 @@
1
1
  <%
2
2
  @path = '/etc/munin/munin.conf'
3
- @post = "mkdir -p /var/www/munin; chown -R munin:munin /var/www/munin"
4
3
  %>
5
4
 
6
5
  # Example configuration file for Munin, generated by 'make build'
7
6
 
8
7
  # The next three variables specifies where the location of the RRD
9
- # databases, the HTML output, and the logs, severally. They all
10
- # must be writable by the user running munin-cron.
11
- dbdir /var/lib/munin
12
- htmldir /var/www/munin
13
- logdir /var/log/munin
8
+ # databases, the HTML output, logs and the lock/pid files. They all
9
+ # must be writable by the user running munin-cron. They are all
10
+ # defaulted to the values you see here.
11
+ #
12
+ dbdir /var/lib/munin
13
+ htmldir /var/cache/munin/www
14
+ logdir /var/log/munin
14
15
  rundir /var/run/munin
15
16
 
16
17
  # Where to look for the HTML templates
17
18
  tmpldir /etc/munin/templates
18
19
 
20
+ # (Exactly one) directory to include all files from.
21
+ #
22
+ includedir /etc/munin/munin-conf.d
23
+
19
24
  # Make graphs show values per minute instead of per second
20
25
  #graph_period minute
21
26
 
27
+ # Graphics files are normaly generated by munin-graph, no matter if
28
+ # the graphs are used or not. You can change this to
29
+ # on-demand-graphing by following the instructions in
30
+ # http://munin.projects.linpro.no/wiki/CgiHowto
31
+ #
32
+ #graph_strategy cgi
33
+
34
+ # munin-cgi-graph is invoked by the web server up to very many times at the
35
+ # same time. This is not optimal since it results in high CPU and memory
36
+ # consumption to the degree that the system can thrash. Again the default is
37
+ # 6. Most likely the optimal number for max_cgi_graph_jobs is the same as
38
+ # max_graph_jobs.
39
+ #
40
+ #munin_cgi_graph_jobs 6
41
+
42
+ # If the automatic CGI url is wrong for your system override it here:
43
+ #
44
+ #cgiurl_graph /cgi-bin/munin-cgi-graph
45
+
46
+ # munin-graph runs in parallel, the number of concurrent processes is
47
+ # 6. If you want munin-graph to not be parallel set to 0. If set too
48
+ # high it will slow down munin-graph. Some experiments are needed to
49
+ # determine how many are optimal on your system. On a multi-core
50
+ # system with good SCSI disks the number can probably be quite high.
51
+ #
52
+ #max_graph_jobs 6
53
+
22
54
  # Drop somejuser@fnord.comm and anotheruser@blibb.comm an email everytime
23
55
  # something changes (OK -> WARNING, CRITICAL -> OK, etc)
24
56
  #contact.someuser.command mail -s "Munin notification" somejuser@fnord.comm
25
57
  #contact.anotheruser.command mail -s "Munin notification" anotheruser@blibb.comm
26
58
  #
27
- # For those with Nagios, the following might come in handy. In addition,
28
- # the services must be defined in the Nagios server as well.
29
- #contact.nagios.command /usr/sbin/send_nsca -H nagios.host.com -c /etc/send_nsca.cfg
30
59
 
31
60
  contacts dev
32
61
  contact.dev.command mail -s "Munin notification ${var:host} : ${var:group}" <%= rubber_env.admin_email %>
33
62
  contact.dev.always_send warning critical
34
63
 
64
+ # For those with Nagios, the following might come in handy. In addition,
65
+ # the services must be defined in the Nagios server as well.
66
+ #contact.nagios.command /usr/bin/send_nsca nagios.host.comm -c /etc/nsca.conf
35
67
 
68
+ # The host tree generated by rubber
69
+ #
36
70
  <% rubber_instances.each do |i| %>
37
71
  [<%= i.full_name %>]
38
72
  address <%= i.internal_ip %>
@@ -5,5 +5,5 @@
5
5
  %>
6
6
 
7
7
  # Roll the nginx logs at midnight
8
- 0 0 * * * LOG_DIR=/mnt/nginx/log <%= RUBBER_ROOT %>/script/cron-rake rubber:rotate_logs
8
+ 0 0 * * * LOG_DIR=/mnt/nginx/logs <%= RUBBER_ROOT %>/script/cron-rake rubber:rotate_logs
9
9
 
@@ -6,6 +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/*", "log/*"]
9
10
  end
10
11
 
11
12
  # Use a simple directory tree copy here to make demo easier.
@@ -3,14 +3,43 @@ namespace :rubber do
3
3
 
4
4
  rubber.allow_optional_tasks(self)
5
5
 
6
- before "rubber:install_gems", "rubber:base:install_rvm"
6
+ before "rubber:setup_gem_sources", "rubber:base:install_rvm"
7
7
  task :install_rvm do
8
8
  rubber.sudo_script "install_rvm", <<-ENDSCRIPT
9
9
  if [[ `rvm --version 2> /dev/null` == "" ]]; then
10
10
  echo "rvm_prefix=/usr/local" > /etc/rvmrc
11
- wget -qNP /tmp http://rvm.beginrescueend.com/releases/rvm-install-head
12
- bash /tmp/rvm-install-head
13
11
  echo "#{rubber_env.rvm_prepare}" > /etc/profile.d/rvm.sh
12
+
13
+ # Copied below from http://rvm.beginrescueend.com/releases/rvm-install-latest
14
+ #
15
+
16
+ if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
17
+
18
+ if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
19
+
20
+ rvm_path="${rvm_path:-$HOME/.rvm}"
21
+
22
+ mkdir -p $rvm_path/src/
23
+
24
+ builtin cd $rvm_path/src
25
+
26
+ stable_version=#{rubber_env.rvm_version}
27
+
28
+ echo "rvm-${stable_version}"
29
+
30
+ curl -L "http://rvm.beginrescueend.com/releases/rvm-${stable_version}.tar.gz" -o "rvm-${stable_version}.tar.gz"
31
+
32
+ tar zxf "rvm-${stable_version}.tar.gz"
33
+
34
+ builtin cd "rvm-${stable_version}"
35
+
36
+ dos2unix scripts/* >/dev/null 2>&1 || true
37
+
38
+ bash ./scripts/install
39
+
40
+ #
41
+ # end rvm install script
42
+
14
43
  fi
15
44
  ENDSCRIPT
16
45
  end
@@ -11,6 +11,9 @@
11
11
 
12
12
  packages: [build-essential, git-core, subversion, curl, autoconf, bison, ruby, zlib1g-dev, libssl-dev, libreadline5-dev, libxml2-dev]
13
13
 
14
+ # REQUIRED: the version of rvm itself
15
+ rvm_version: 0.1.38
16
+
14
17
  # REQUIRED: Set to the rvm version string for the ruby version you wish to use
15
18
  # Run "rvm list known" to see the list of possible options
16
19
  rvm_ruby: 1.9.2
@@ -56,3 +56,5 @@ JVM_OPTS=" \
56
56
  -Dcom.sun.management.jmxremote.port=<%= rubber_env.cassandra_jmx_port %> \
57
57
  -Dcom.sun.management.jmxremote.ssl=false \
58
58
  -Dcom.sun.management.jmxremote.authenticate=false"
59
+
60
+ ulimit -n 65536
@@ -12,7 +12,7 @@ namespace :rubber do
12
12
  rubber.sudo_script 'setup_mongrel_init', <<-ENDSCRIPT
13
13
  mkdir -p /etc/mongrel_cluster
14
14
  rm -f /etc/mongrel_cluster/#{application}-#{RUBBER_ENV}.yml && ln -s /mnt/#{application}-#{RUBBER_ENV}/current/config/mongrel_cluster.yml /etc/mongrel_cluster/#{application}-#{RUBBER_ENV}.yml
15
- find /usr/lib/ruby/gems -path "*/resources/mongrel_cluster" -exec cp {} /etc/init.d/ \\;
15
+ find #{rubber_env.rvm_version ? "$(rvm gemdir)" : "/usr/lib/ruby/gems"} -path "*/resources/mongrel_cluster" -exec cp {} /etc/init.d/ \\;
16
16
  chmod +x /etc/init.d/mongrel_cluster
17
17
  update-rc.d -f mongrel_cluster remove
18
18
  update-rc.d mongrel_cluster defaults 99 00
@@ -1,38 +1,72 @@
1
1
  <%
2
2
  @path = '/etc/munin/munin.conf'
3
- @post = "mkdir -p /var/www/munin; chown -R munin:munin /var/www/munin"
4
3
  %>
5
4
 
6
5
  # Example configuration file for Munin, generated by 'make build'
7
6
 
8
7
  # The next three variables specifies where the location of the RRD
9
- # databases, the HTML output, and the logs, severally. They all
10
- # must be writable by the user running munin-cron.
11
- dbdir /var/lib/munin
12
- htmldir /var/www/munin
13
- logdir /var/log/munin
8
+ # databases, the HTML output, logs and the lock/pid files. They all
9
+ # must be writable by the user running munin-cron. They are all
10
+ # defaulted to the values you see here.
11
+ #
12
+ dbdir /var/lib/munin
13
+ htmldir /var/cache/munin/www
14
+ logdir /var/log/munin
14
15
  rundir /var/run/munin
15
16
 
16
17
  # Where to look for the HTML templates
17
18
  tmpldir /etc/munin/templates
18
19
 
20
+ # (Exactly one) directory to include all files from.
21
+ #
22
+ includedir /etc/munin/munin-conf.d
23
+
19
24
  # Make graphs show values per minute instead of per second
20
25
  #graph_period minute
21
26
 
27
+ # Graphics files are normaly generated by munin-graph, no matter if
28
+ # the graphs are used or not. You can change this to
29
+ # on-demand-graphing by following the instructions in
30
+ # http://munin.projects.linpro.no/wiki/CgiHowto
31
+ #
32
+ #graph_strategy cgi
33
+
34
+ # munin-cgi-graph is invoked by the web server up to very many times at the
35
+ # same time. This is not optimal since it results in high CPU and memory
36
+ # consumption to the degree that the system can thrash. Again the default is
37
+ # 6. Most likely the optimal number for max_cgi_graph_jobs is the same as
38
+ # max_graph_jobs.
39
+ #
40
+ #munin_cgi_graph_jobs 6
41
+
42
+ # If the automatic CGI url is wrong for your system override it here:
43
+ #
44
+ #cgiurl_graph /cgi-bin/munin-cgi-graph
45
+
46
+ # munin-graph runs in parallel, the number of concurrent processes is
47
+ # 6. If you want munin-graph to not be parallel set to 0. If set too
48
+ # high it will slow down munin-graph. Some experiments are needed to
49
+ # determine how many are optimal on your system. On a multi-core
50
+ # system with good SCSI disks the number can probably be quite high.
51
+ #
52
+ #max_graph_jobs 6
53
+
22
54
  # Drop somejuser@fnord.comm and anotheruser@blibb.comm an email everytime
23
55
  # something changes (OK -> WARNING, CRITICAL -> OK, etc)
24
56
  #contact.someuser.command mail -s "Munin notification" somejuser@fnord.comm
25
57
  #contact.anotheruser.command mail -s "Munin notification" anotheruser@blibb.comm
26
58
  #
27
- # For those with Nagios, the following might come in handy. In addition,
28
- # the services must be defined in the Nagios server as well.
29
- #contact.nagios.command /usr/sbin/send_nsca -H nagios.host.com -c /etc/send_nsca.cfg
30
59
 
31
60
  contacts dev
32
61
  contact.dev.command mail -s "Munin notification ${var:host} : ${var:group}" <%= rubber_env.admin_email %>
33
62
  contact.dev.always_send warning critical
34
63
 
64
+ # For those with Nagios, the following might come in handy. In addition,
65
+ # the services must be defined in the Nagios server as well.
66
+ #contact.nagios.command /usr/bin/send_nsca nagios.host.comm -c /etc/nsca.conf
35
67
 
68
+ # The host tree generated by rubber
69
+ #
36
70
  <% rubber_instances.each do |i| %>
37
71
  [<%= i.full_name %>]
38
72
  address <%= i.internal_ip %>
@@ -5,5 +5,5 @@
5
5
  %>
6
6
 
7
7
  # Roll the nginx logs at midnight
8
- 0 0 * * * LOG_DIR=/mnt/nginx/log <%= RUBBER_ROOT %>/script/cron-rake rubber:rotate_logs
8
+ 0 0 * * * LOG_DIR=/mnt/nginx/logs <%= RUBBER_ROOT %>/script/cron-rake rubber:rotate_logs
9
9
 
@@ -29,12 +29,12 @@ module Rubber
29
29
  begin
30
30
  Resolv::DNS.open(:nameserver => [nameserver], :search => [], :ndots => 1) do |dns|
31
31
  r = dns.getresource(hostname, Resolv::DNS::Resource::IN::A)
32
- result = [{:host =>host, :data => r.address}]
32
+ result = [{:host =>opts[:host], :data => r.address}]
33
33
  end
34
34
  rescue
35
+ puts "Rescue #{e} #{e.message}"
35
36
  raise "Domain needs to exist in dyndns as an A record before record can be updated"
36
37
  end
37
- return true
38
38
  end
39
39
 
40
40
  def create_host_record(opts={})
@@ -46,13 +46,12 @@ module Rubber
46
46
  end
47
47
 
48
48
  def update_host_record(old_opts={}, new_opts={})
49
- old_opts = setup_opts(opts, [:host, :domain])
50
- new_opts = setup_opts(opts, [:data])
51
-
52
- host = hostname(old_opts[:host])
49
+ old_opts = setup_opts(old_opts, [:host, :domain])
50
+
51
+ host = "#{old_opts[:host]}.#{old_opts[:domain]}"
53
52
  ip = new_opts[:data]
54
53
  update_url = eval('%Q{' + @update_url + '}')
55
-
54
+ # puts update_url
56
55
  # This header is required by dyndns.org
57
56
  headers = {
58
57
  "User-Agent" => "Capistrano - Rubber - 0.1"
@@ -229,7 +229,7 @@ namespace :rubber do
229
229
  rubber_instances.save()
230
230
 
231
231
  # turn back on root ssh access if we are using root as the capistrano user for connecting
232
- enable_root_ssh(instance_item.external_ip, fetch(:initial_ssh_user, 'ubuntu')) if user == 'root'
232
+ enable_root_ssh(instance_item.external_ip, fetch(:initial_ssh_user, 'ubuntu')) if (user == 'root' && ! instance_item.windows?)
233
233
 
234
234
  # setup amazon elastic ips if configured to do so
235
235
  setup_static_ips
@@ -397,9 +397,9 @@ namespace :rubber do
397
397
 
398
398
  rsudo "apt-get -q update"
399
399
  if upgrade
400
- rsudo "export DEBIAN_FRONTEND=noninteractive; apt-get -q -y --force-yes dist-upgrade"
400
+ rsudo "export DEBIAN_FRONTEND=noninteractive; apt-get -q -o Dpkg::Options::=--force-confold -y --force-yes dist-upgrade"
401
401
  else
402
- rsudo "export DEBIAN_FRONTEND=noninteractive; apt-get -q -y --force-yes install $CAPISTRANO:VAR$", opts
402
+ rsudo "export DEBIAN_FRONTEND=noninteractive; apt-get -q -o Dpkg::Options::=--force-confold -y --force-yes install $CAPISTRANO:VAR$", opts
403
403
  end
404
404
  end
405
405
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 5
8
- - 5
9
- version: 1.5.5
8
+ - 6
9
+ version: 1.5.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Matt Conway
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-06-07 00:00:00 -04:00
17
+ date: 2010-07-01 00:00:00 -04:00
18
18
  default_executable: vulcanize
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency