rubber 1.14.1 → 1.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. data/CHANGELOG +36 -0
  2. data/VERSION +1 -1
  3. data/generators/vulcanize/templates/base/config/rubber/common/crontab +5 -6
  4. data/generators/vulcanize/templates/base/config/rubber/common/rsyslog.conf +71 -0
  5. data/generators/vulcanize/templates/base/config/rubber/deploy-setup.rb +7 -2
  6. data/generators/vulcanize/templates/base/config/rubber/rubber.yml +4 -12
  7. data/generators/vulcanize/templates/base/script/cron-rake +2 -2
  8. data/generators/vulcanize/templates/complete_passenger_nginx/config/rubber/role/haproxy/haproxy-passenger.conf +21 -0
  9. data/generators/vulcanize/templates/complete_passenger_nginx/config/rubber/rubber-complete.yml +38 -0
  10. data/generators/vulcanize/templates/complete_passenger_nginx/templates.rb +8 -0
  11. data/generators/vulcanize/templates/complete_passenger_nginx/templates.yml +8 -0
  12. data/generators/vulcanize/templates/complete_passenger_nginx_mysql/templates.yml +4 -0
  13. data/generators/vulcanize/templates/complete_passenger_nginx_postgresql/templates.yml +4 -0
  14. data/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/monit-haproxy.conf +1 -1
  15. data/generators/vulcanize/templates/minimal_passenger_nginx/config/rubber/rubber-complete.yml +37 -0
  16. data/generators/vulcanize/templates/minimal_passenger_nginx/templates.yml +4 -0
  17. data/generators/vulcanize/templates/mongodb/config/rubber/deploy-mongodb.rb +6 -2
  18. data/generators/vulcanize/templates/monit/config/rubber/role/web_tools/monit-admin-nginx.conf +1 -0
  19. data/generators/vulcanize/templates/munin/config/rubber/role/web_tools/munin.conf +2 -1
  20. data/generators/vulcanize/templates/munin/script/munin/example_mysql_query.rb +0 -0
  21. data/generators/vulcanize/templates/munin/script/munin/example_simple.rb +0 -0
  22. data/generators/vulcanize/templates/mysql/config/rubber/rubber-mysql.yml +1 -1
  23. data/generators/vulcanize/templates/mysql_proxy/config/rubber/common/mysql-proxy +1 -0
  24. data/generators/vulcanize/templates/passenger/config/rubber/deploy-passenger.rb +1 -1
  25. data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger-memory.conf +1 -1
  26. data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger.conf +1 -1
  27. data/generators/vulcanize/templates/passenger/config/rubber/rubber-passenger.yml +1 -1
  28. data/generators/vulcanize/templates/passenger_nginx/config/rubber/deploy-passenger_nginx.rb +86 -0
  29. data/generators/vulcanize/templates/passenger_nginx/config/rubber/role/passenger_nginx/application.conf +30 -0
  30. data/generators/vulcanize/templates/passenger_nginx/config/rubber/role/passenger_nginx/crontab +8 -0
  31. data/generators/vulcanize/templates/passenger_nginx/config/rubber/role/passenger_nginx/monit-nginx.conf +7 -0
  32. data/generators/vulcanize/templates/passenger_nginx/config/rubber/role/passenger_nginx/munin-passenger-memory.conf +34 -0
  33. data/generators/vulcanize/templates/passenger_nginx/config/rubber/role/passenger_nginx/munin-passenger-sudoers.conf +8 -0
  34. data/generators/vulcanize/templates/passenger_nginx/config/rubber/role/passenger_nginx/munin-passenger.conf +47 -0
  35. data/generators/vulcanize/templates/passenger_nginx/config/rubber/role/passenger_nginx/nginx +101 -0
  36. data/generators/vulcanize/templates/passenger_nginx/config/rubber/role/passenger_nginx/nginx.conf +65 -0
  37. data/generators/vulcanize/templates/passenger_nginx/config/rubber/role/passenger_nginx/passenger_nginx.conf +30 -0
  38. data/generators/vulcanize/templates/passenger_nginx/config/rubber/role/web_tools/nginx-tools.conf +55 -0
  39. data/generators/vulcanize/templates/passenger_nginx/config/rubber/role/web_tools/tools-index.html +34 -0
  40. data/generators/vulcanize/templates/passenger_nginx/config/rubber/role/web_tools/tools-nginx.auth +7 -0
  41. data/generators/vulcanize/templates/passenger_nginx/config/rubber/rubber-passenger_nginx.yml +20 -0
  42. data/generators/vulcanize/templates/passenger_nginx/templates.yml +1 -0
  43. data/generators/vulcanize/templates/postgresql/config/rubber/deploy-postgresql.rb +51 -49
  44. data/generators/vulcanize/templates/postgresql/config/rubber/role/db/pg_hba.conf +1 -0
  45. data/generators/vulcanize/templates/postgresql/config/rubber/role/db/postgresql.conf +20 -7
  46. data/generators/vulcanize/templates/postgresql/config/rubber/role/postgresql_slave/recovery.conf +120 -0
  47. data/generators/vulcanize/templates/postgresql/config/rubber/rubber-postgresql.yml +5 -5
  48. data/generators/vulcanize/templates/redis/config/rubber/deploy-redis.rb +6 -1
  49. data/generators/vulcanize/templates/redis/config/rubber/rubber-redis.yml +1 -1
  50. data/generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb +15 -2
  51. data/generators/vulcanize/templates/resque/config/rubber/role/resque_web/monit-resque_web.conf +1 -1
  52. data/generators/vulcanize/templates/resque/config/rubber/rubber-resque.yml +2 -2
  53. data/lib/generators/vulcanize/templates/base/config/rubber/common/crontab +5 -6
  54. data/lib/generators/vulcanize/templates/base/config/rubber/common/rsyslog.conf +71 -0
  55. data/lib/generators/vulcanize/templates/base/config/rubber/deploy-setup.rb +7 -2
  56. data/lib/generators/vulcanize/templates/base/config/rubber/rubber.yml +4 -12
  57. data/lib/generators/vulcanize/templates/base/script/cron-rake +2 -2
  58. data/lib/generators/vulcanize/templates/complete_passenger_nginx/config/rubber/role/haproxy/haproxy-passenger.conf +21 -0
  59. data/lib/generators/vulcanize/templates/complete_passenger_nginx/config/rubber/rubber-complete.yml +38 -0
  60. data/lib/generators/vulcanize/templates/complete_passenger_nginx/templates.rb +8 -0
  61. data/lib/generators/vulcanize/templates/complete_passenger_nginx/templates.yml +8 -0
  62. data/lib/generators/vulcanize/templates/complete_passenger_nginx_mysql/templates.yml +4 -0
  63. data/lib/generators/vulcanize/templates/complete_passenger_nginx_postgresql/templates.yml +4 -0
  64. data/lib/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/monit-haproxy.conf +1 -1
  65. data/lib/generators/vulcanize/templates/minimal_passenger_nginx/config/rubber/rubber-complete.yml +37 -0
  66. data/lib/generators/vulcanize/templates/minimal_passenger_nginx/templates.yml +4 -0
  67. data/lib/generators/vulcanize/templates/mongodb/config/rubber/deploy-mongodb.rb +6 -2
  68. data/lib/generators/vulcanize/templates/monit/config/rubber/role/web_tools/monit-admin-nginx.conf +1 -0
  69. data/lib/generators/vulcanize/templates/munin/config/rubber/role/web_tools/munin.conf +2 -1
  70. data/lib/generators/vulcanize/templates/munin/script/munin/example_mysql_query.rb +0 -0
  71. data/lib/generators/vulcanize/templates/munin/script/munin/example_simple.rb +0 -0
  72. data/lib/generators/vulcanize/templates/mysql/config/rubber/rubber-mysql.yml +1 -1
  73. data/lib/generators/vulcanize/templates/mysql_proxy/config/rubber/common/mysql-proxy +1 -0
  74. data/lib/generators/vulcanize/templates/passenger/config/rubber/deploy-passenger.rb +1 -1
  75. data/lib/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger-memory.conf +1 -1
  76. data/lib/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger.conf +1 -1
  77. data/lib/generators/vulcanize/templates/passenger/config/rubber/rubber-passenger.yml +1 -1
  78. data/lib/generators/vulcanize/templates/passenger_nginx/config/rubber/deploy-passenger_nginx.rb +86 -0
  79. data/lib/generators/vulcanize/templates/passenger_nginx/config/rubber/role/passenger_nginx/application.conf +30 -0
  80. data/lib/generators/vulcanize/templates/passenger_nginx/config/rubber/role/passenger_nginx/crontab +8 -0
  81. data/lib/generators/vulcanize/templates/passenger_nginx/config/rubber/role/passenger_nginx/monit-nginx.conf +7 -0
  82. data/lib/generators/vulcanize/templates/passenger_nginx/config/rubber/role/passenger_nginx/munin-passenger-memory.conf +34 -0
  83. data/lib/generators/vulcanize/templates/passenger_nginx/config/rubber/role/passenger_nginx/munin-passenger-sudoers.conf +8 -0
  84. data/lib/generators/vulcanize/templates/passenger_nginx/config/rubber/role/passenger_nginx/munin-passenger.conf +47 -0
  85. data/lib/generators/vulcanize/templates/passenger_nginx/config/rubber/role/passenger_nginx/nginx +101 -0
  86. data/lib/generators/vulcanize/templates/passenger_nginx/config/rubber/role/passenger_nginx/nginx.conf +65 -0
  87. data/lib/generators/vulcanize/templates/passenger_nginx/config/rubber/role/passenger_nginx/passenger_nginx.conf +30 -0
  88. data/lib/generators/vulcanize/templates/passenger_nginx/config/rubber/role/web_tools/nginx-tools.conf +55 -0
  89. data/lib/generators/vulcanize/templates/passenger_nginx/config/rubber/role/web_tools/tools-index.html +34 -0
  90. data/lib/generators/vulcanize/templates/passenger_nginx/config/rubber/role/web_tools/tools-nginx.auth +7 -0
  91. data/lib/generators/vulcanize/templates/passenger_nginx/config/rubber/rubber-passenger_nginx.yml +20 -0
  92. data/lib/generators/vulcanize/templates/passenger_nginx/templates.yml +1 -0
  93. data/lib/generators/vulcanize/templates/postgresql/config/rubber/deploy-postgresql.rb +51 -49
  94. data/lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/pg_hba.conf +1 -0
  95. data/lib/generators/vulcanize/templates/postgresql/config/rubber/role/db/postgresql.conf +20 -7
  96. data/lib/generators/vulcanize/templates/postgresql/config/rubber/role/postgresql_slave/recovery.conf +120 -0
  97. data/lib/generators/vulcanize/templates/postgresql/config/rubber/rubber-postgresql.yml +5 -5
  98. data/lib/generators/vulcanize/templates/redis/config/rubber/deploy-redis.rb +6 -1
  99. data/lib/generators/vulcanize/templates/redis/config/rubber/rubber-redis.yml +1 -1
  100. data/lib/generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb +15 -2
  101. data/lib/generators/vulcanize/templates/resque/config/rubber/role/resque_web/monit-resque_web.conf +1 -1
  102. data/lib/generators/vulcanize/templates/resque/config/rubber/rubber-resque.yml +2 -2
  103. data/lib/rubber/dns/zerigo.rb +1 -1
  104. data/lib/rubber/recipes/rubber/setup.rb +1 -1
  105. data/lib/rubber/recipes/rubber/volumes.rb +3 -3
  106. metadata +55 -5
data/CHANGELOG CHANGED
@@ -1,3 +1,38 @@
1
+ 1.15.0 (09/13/2011)
2
+
3
+ New Features:
4
+ ============
5
+
6
+ Added PostgreSQL streaming replication configuration (thanks Kevin Menard)
7
+ Added the ability to specify mount options for volumes (thanks Alex Kremer)
8
+ Added a minimal Passenger nginx configuration (thanks Will Koehler)
9
+ Added SSL support for nginx-passenger (thanks Michael Glass)
10
+ Added staging environment support fon nginx-passenger (thanks Michael Glass)
11
+
12
+ Improvements:
13
+ ============
14
+
15
+ Resque-web now runs as an unpriviliged user (thanks Scott Carleton)
16
+ Better error message when having issues loading the Zerigo gem (thanks Rupert Meese)
17
+ Upgraded Passenger to 3.0.9 (thanks Kevin Menard)
18
+ Upgraded Redis to 2.2.13 (thanks Kevin Menard)
19
+ Better .gemrc file setup (thanks Kevin Menard)
20
+
21
+ Bug Fixes:
22
+ ==========
23
+
24
+ Fixed an issue with setting up redis on Ubuntu 11.04 (thanks Kevin Menard)
25
+ Fixed an issue with mysql-proxy not being added to the correct run level (thanks Alex Kremer)
26
+ Fixed a typo in the passenger_nginx module name (thanks Alex Kremer)
27
+ Fixed an issue with the munin generated Web site location (thanks Will Koehler)
28
+ Fixed the open4 require issue (thanks Will Koehler)w
29
+ Fixed a bunch of nginx-related issues (thanks Will Koehler)
30
+ Fixed an environmental issue running ntpdate (thanks Will Koehler)
31
+ Fixed compatibility issues with the Psych parser used in Ruby 1.9.2 (thanks Kevin Menard)
32
+ Fixed timing issue with multiple resque workers starting (thanks Matt Conway)
33
+ Fixed an issue with hostnames that happen to be monit commands (thanks Michael Glass)
34
+
35
+
1
36
  1.14.1 (06/02/2011)
2
37
  -----
3
38
 
@@ -12,6 +47,7 @@ Added ability to lockdown the version of rake that RVM will install (vulcanize b
12
47
  Added the image type and ID for each instance to the instance file
13
48
  Fixed an issue with LVM groups keeping physical volumes in /etc/fstab
14
49
  Fixed an issue using the mysql2 adapter with the stock MySQL config
50
+ Disable ri and rdoc generation on new hosts
15
51
 
16
52
  1.13.2
17
53
  -----
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.14.1
1
+ 1.15.0
@@ -3,11 +3,10 @@
3
3
  @write_cmd = 'crontab -'
4
4
  %>
5
5
 
6
- # cron clears out enviroment variables, so we need to add these in
7
- # to make sure we are running the correct ruby (rvm env vars, plus paths)
8
- <%- ENV.select {|k, v| k =~ /rvm|ruby|bundler|gem|path/i }.each do |k, v| -%>
9
- <%= k %>='<%= v %>'
10
- <%- end -%>
6
+ # cron clears out enviroment variables. We need to put our path back in so we can find RVM.
7
+ # 'rvm exec' and 'bundle exec' in cron-rake will take care of setting up the rest of the
8
+ # environment needed by Ruby / Rails
9
+ PATH='<%= ENV['PATH'] %>'
11
10
 
12
11
  MAILTO=<%= rubber_env.admin_email %>
13
12
  # don't need to set RUBBER_ENV for each script since we set it for all cron here
@@ -19,4 +18,4 @@ RUBYOPT=rubygems
19
18
  0 0 * * * LOG_DIR=<%= RUBBER_ROOT %>/log <%= RUBBER_ROOT %>/script/cron-rake rubber:rotate_logs
20
19
 
21
20
  # Automatically set the clock for all machines
22
- <%= rand(60) %> 4 * * * <%= RUBBER_ROOT %>/script/cron-sh -- ntpdate pool.ntp.org
21
+ <%= rand(60) %> 4 * * * rvm exec <%= RUBBER_ROOT %>/script/cron-sh -- ntpdate pool.ntp.org
@@ -0,0 +1,71 @@
1
+ <%
2
+ log_dir = "/var/log/#{rubber_env.app_name}"
3
+ log_spool_dir = "/var/spool/rsyslog"
4
+
5
+ @path = "/etc/rsyslog.conf"
6
+ @post = <<-ENDSCRIPT
7
+ mkdir -p #{log_dir} #{log_spool_dir}
8
+ chown syslog:adm #{log_dir} #{log_spool_dir}
9
+ /usr/sbin/service rsyslog restart
10
+ ENDSCRIPT
11
+ %>
12
+
13
+ # /etc/rsyslog.conf Configuration file for rsyslog.
14
+ #
15
+ # For more information see
16
+ # /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html
17
+ #
18
+ # Default logging rules can be found in /etc/rsyslog.d/50-default.conf
19
+
20
+
21
+ #################
22
+ #### MODULES ####
23
+ #################
24
+
25
+ $ModLoad imuxsock # provides support for local system logging
26
+ $ModLoad imklog # provides kernel logging support (previously done by rklogd)
27
+ #$ModLoad immark # provides --MARK-- message capability
28
+
29
+ $KLogPath /proc/kmsg
30
+
31
+ # provides UDP syslog reception
32
+ $ModLoad imudp
33
+ $UDPServerRun 514
34
+
35
+ # provides TCP syslog reception
36
+ #$ModLoad imtcp
37
+ #$InputTCPServerRun 514
38
+
39
+ $WorkDirectory <%= log_spool_dir %>
40
+ $template LogCollectorDynFile,"<%= log_dir %>/%$YEAR%/%$MONTH%/%$DAY%/%programname%.log"
41
+
42
+ ###########################
43
+ #### GLOBAL DIRECTIVES ####
44
+ ###########################
45
+
46
+ #
47
+ # Use traditional timestamp format.
48
+ # To enable high precision timestamps, comment out the following line.
49
+ #
50
+ $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
51
+
52
+ # Don't filter duplicated messages
53
+ $RepeatedMsgReduction off
54
+
55
+ #
56
+ # Set the default permissions for all log files.
57
+ #
58
+ $FileOwner syslog
59
+ $FileGroup adm
60
+ $FileCreateMode 0640
61
+ $DirCreateMode 0755
62
+ $Umask 0022
63
+ $PrivDropToUser syslog
64
+ $PrivDropToGroup adm
65
+ # https://bugs.launchpad.net/ubuntu/+source/rsyslog/+bug/484336
66
+
67
+ #
68
+ # Include all config files in /etc/rsyslog.d/
69
+ #
70
+ $IncludeConfig /etc/rsyslog.d/*.conf
71
+
@@ -21,8 +21,13 @@ namespace :rubber do
21
21
  sed -i 's/rake.*/rake -v#{rubber_env.rake_version}/' #{rubber_env.rvm_prefix}/gemsets/global.gems
22
22
 
23
23
  # Set up the .gemrc file
24
- echo "--- " >> ~/.gemrc
25
- echo "gem: --no-ri --no-rdoc" >> ~/.gemrc
24
+ if [[ ! -f ~/.gemrc ]]; then
25
+ echo "--- " >> ~/.gemrc
26
+ fi
27
+
28
+ if ! grep -q 'gem: ' ~/.gemrc; then
29
+ echo "gem: --no-ri --no-rdoc" >> ~/.gemrc
30
+ fi
26
31
  fi
27
32
  ENDSCRIPT
28
33
  end
@@ -1,15 +1,3 @@
1
- # All variables can also be overridden on the role and/or host level by creating
2
- # a sub level to the config under roles and hosts
3
- # e.g. to install mysql only on db role, and awstats only on web01:
4
- #
5
- # packages: [ruby]
6
- # roles:
7
- # db:
8
- # packages: [mysql]
9
- # hosts:
10
- # web01:
11
- # packages: [awstats]
12
-
13
1
  # REQUIRED: The name of your application
14
2
  app_name: your_app_name
15
3
 
@@ -258,6 +246,10 @@ staging_roles: "web,app,db:primary=true"
258
246
  #
259
247
  # var_name: var_value
260
248
 
249
+ # All variables can also be overridden on the role and/or host level by creating
250
+ # a sub level to the config under roles and hosts
251
+ # e.g. to install mysql only on db role, and awstats only on web01:
252
+
261
253
  # OPTIONAL: Role specific overrides
262
254
  # roles:
263
255
  # somerole:
@@ -14,5 +14,5 @@ rescue
14
14
  end
15
15
 
16
16
  Dir.chdir(RAILS_ROOT)
17
- args = %W{-l #{log} -- rake --trace} + ARGV
18
- system "script/cron-sh", *args
17
+ args = %W{-l #{log} -- bundle exec rake -t} + ARGV
18
+ system "rvm", "exec", "script/cron-sh", *args
@@ -0,0 +1,21 @@
1
+ <%
2
+ @path = "/etc/haproxy/haproxy.cfg"
3
+ @additive = ["# start haproxy passenger", "# end haproxy passenger"]
4
+ %>
5
+
6
+ <%
7
+ backend_hosts = rubber_instances.for_role('app').collect { |i| i.name }
8
+ %>
9
+
10
+ listen passenger_proxy 0.0.0.0:<%= rubber_env.web_port %>
11
+ option forwardfor
12
+ <% backend_hosts.each do |server| %>
13
+ server <%= server %> <%= server %>:<%= rubber_env.passenger_listen_port %> maxconn <%= rubber_env.max_app_connections %> check
14
+ <% end %>
15
+
16
+ listen passenger_proxy_ssl 0.0.0.0:<%= rubber_env.web_ssl_port %>
17
+ mode tcp
18
+ option forwardfor
19
+ <% backend_hosts.each do |server| %>
20
+ server <%= server %> <%= server %>:<%= rubber_env.passenger_listen_ssl_port %> maxconn <%= rubber_env.max_app_connections %> check
21
+ <% end %>
@@ -0,0 +1,38 @@
1
+ role_dependencies:
2
+ web: [haproxy]
3
+ app: [passenger_nginx]
4
+
5
+ web_port: 80
6
+ web_ssl_port: 443
7
+ web_tools_port: 8080
8
+ web_tools_ssl_port: 8443
9
+
10
+ security_groups:
11
+ web:
12
+ description: "To open up port #{web_port}/#{web_ssl_port} for http server on web role"
13
+ rules:
14
+ - protocol: tcp
15
+ from_port: "#{web_port}"
16
+ to_port: "#{web_port}"
17
+ source_ips: [0.0.0.0/0]
18
+ - protocol: tcp
19
+ from_port: "#{web_ssl_port}"
20
+ to_port: "#{web_ssl_port}"
21
+ source_ips: [0.0.0.0/0]
22
+ web_tools:
23
+ description: "To open up port #{web_tools_port}/#{web_tools_ssl_port} for internal/tools http server"
24
+ rules:
25
+ - protocol: tcp
26
+ from_port: "#{web_tools_port}"
27
+ to_port: "#{web_tools_port}"
28
+ source_ips: [0.0.0.0/0]
29
+ - protocol: tcp
30
+ from_port: "#{web_tools_ssl_port}"
31
+ to_port: "#{web_tools_ssl_port}"
32
+ source_ips: [0.0.0.0/0]
33
+
34
+ roles:
35
+ web:
36
+ assigned_security_groups: [web]
37
+ web_tools:
38
+ assigned_security_groups: [web_tools]
@@ -0,0 +1,8 @@
1
+ database_engines = ['mysql', 'postgresql']
2
+ if ! database_engines.any? {|d| @template_dependencies.include?(d)}
3
+ db = Rubber::Util::prompt("DATABASE",
4
+ "The database engine to use (#{database_engines.join(', ')})",
5
+ true,
6
+ 'mysql')
7
+ template_dependencies << db
8
+ end
@@ -0,0 +1,8 @@
1
+ description: A fairly complete and scalable deployment setup using passenger and nginx
2
+ dependent_templates:
3
+ - base
4
+ - haproxy
5
+ - passenger_nginx
6
+ - monit
7
+ - munin
8
+ - memcached
@@ -0,0 +1,4 @@
1
+ description: A fairly complete and scalable mysql deployment setup using passenger/nginx
2
+ dependent_templates:
3
+ - complete_passenger_nginx
4
+ - mysql
@@ -0,0 +1,4 @@
1
+ description: A fairly complete and scalable postgresql deployment setup using passenger/nginx
2
+ dependent_templates:
3
+ - complete_passenger_nginx
4
+ - postgresql
@@ -5,4 +5,4 @@ check process haproxy with pidfile /var/run/haproxy.pid
5
5
  group haproxy-<%= RUBBER_ENV %>
6
6
  start program = "/usr/bin/env service haproxy start"
7
7
  stop program = "/usr/bin/env service haproxy stop"
8
- if failed host <%= rubber_env.host %> port <%= rubber_env.haproxy_monitor_port %> with timeout 10 seconds for 10 cycles then restart
8
+ if failed host "<%= rubber_env.host %>" port <%= rubber_env.haproxy_monitor_port %> with timeout 10 seconds for 10 cycles then restart
@@ -0,0 +1,37 @@
1
+ role_dependencies:
2
+ app: [passenger_nginx]
3
+
4
+ web_port: 80
5
+ web_ssl_port: 443
6
+ web_tools_port: 8080
7
+ web_tools_ssl_port: 8443
8
+
9
+ security_groups:
10
+ web:
11
+ description: "To open up port #{web_port}/#{web_ssl_port} for http server on web role"
12
+ rules:
13
+ - protocol: tcp
14
+ from_port: "#{web_port}"
15
+ to_port: "#{web_port}"
16
+ source_ips: [0.0.0.0/0]
17
+ - protocol: tcp
18
+ from_port: "#{web_ssl_port}"
19
+ to_port: "#{web_ssl_port}"
20
+ source_ips: [0.0.0.0/0]
21
+ web_tools:
22
+ description: "To open up port #{web_tools_port}/#{web_tools_ssl_port} for internal/tools http server"
23
+ rules:
24
+ - protocol: tcp
25
+ from_port: "#{web_tools_port}"
26
+ to_port: "#{web_tools_port}"
27
+ source_ips: [0.0.0.0/0]
28
+ - protocol: tcp
29
+ from_port: "#{web_tools_ssl_port}"
30
+ to_port: "#{web_tools_ssl_port}"
31
+ source_ips: [0.0.0.0/0]
32
+
33
+ roles:
34
+ web:
35
+ assigned_security_groups: [web]
36
+ web_tools:
37
+ assigned_security_groups: [web_tools]
@@ -0,0 +1,4 @@
1
+ description: A minimal deployment setup using passenger and nginx
2
+ dependent_templates:
3
+ - base
4
+ - passenger_nginx
@@ -19,8 +19,12 @@ namespace :rubber do
19
19
  end
20
20
 
21
21
  task :setup_paths, :roles => :mongodb do
22
- rsudo "mkdir -p #{rubber_env.mongodb_data_dir}"
23
- rsudo "chown -R mongodb:mongodb #{rubber_env.mongodb_data_dir}"
22
+ rubber.sudo_script 'setup_mongodb_paths', <<-ENDSCRIPT
23
+ if [[ ! -d "#{rubber_env.mongodb_data_dir}" ]]; then
24
+ mkdir -p #{rubber_env.mongodb_data_dir}
25
+ chown -R mongodb:mongodb #{rubber_env.mongodb_data_dir}
26
+ fi
27
+ ENDSCRIPT
24
28
  end
25
29
 
26
30
  desc <<-DESC
@@ -5,6 +5,7 @@
5
5
  <% rubber_instances.each do |ic| %>
6
6
  location /monit_<%= ic.name %>
7
7
  {
8
+ rewrite ^/monit_<%= ic.name %>/(.*) /$1 break;
8
9
  proxy_pass http://<%= ic.full_name %>:<%= rubber_env.monit_admin_port %>;
9
10
  }
10
11
  <% end %>
@@ -1,5 +1,6 @@
1
1
  <%
2
2
  @path = '/etc/munin/munin.conf'
3
+ @post = 'mkdir -p /var/www/munin; chown munin:munin /var/www/munin'
3
4
  %>
4
5
 
5
6
  # Example configuration file for Munin, generated by 'make build'
@@ -10,7 +11,7 @@
10
11
  # defaulted to the values you see here.
11
12
  #
12
13
  dbdir /var/lib/munin
13
- htmldir /var/cache/munin/www
14
+ htmldir /var/www/munin
14
15
  logdir /var/log/munin
15
16
  rundir /var/run/munin
16
17
 
@@ -26,7 +26,7 @@ db_log_dir: "#{db_root_dir}/log"
26
26
  # Capistrano needs db:primary role for migrate to work,
27
27
  # so we might as well just make consistent across the board
28
28
  role_dependencies:
29
- mysql_master: [db:primary=true]
29
+ mysql_master: ["db:primary=true"]
30
30
  mysql_slave: [db]
31
31
  db:primary=true: [mysql_master]
32
32
  db: [mysql_slave]
@@ -1,6 +1,7 @@
1
1
  <%
2
2
  @path = "/etc/init.d/mysql-proxy"
3
3
  @perms = 0755
4
+ @post = "/usr/sbin/update-rc.d -f mysql-proxy defaults"
4
5
  %>#! /bin/sh
5
6
  ### BEGIN INIT INFO
6
7
  # Provides: mysql-proxy
@@ -13,7 +13,7 @@ namespace :rubber do
13
13
  # when variable interpolation of rvm_gem_home is run remotely, and since we
14
14
  # are in cap, we run the interpolation locally
15
15
  #
16
- passenger_lib=$(find /usr/local/rvm -path "*/passenger-#{rubber_env.passenger_version}/*/mod_passenger.so" 2> /dev/null)
16
+ passenger_lib=$(find /usr/local/rvm/gems/`rvm current` -path "*/passenger-#{rubber_env.passenger_version}/*/mod_passenger.so" 2> /dev/null)
17
17
  if [[ -z $passenger_lib ]]; then
18
18
  echo -en "\n\n\n\n" | passenger-install-apache2-module
19
19
  rvm #{rubber_env.rvm_ruby} --passenger
@@ -18,7 +18,7 @@ END
18
18
  end
19
19
 
20
20
  def output_values
21
- status = `sudo <%= rubber_env.rvm_gem_home %>/bin/passenger-memory-stats | tail -1`
21
+ status = `rvm exec sudo <%= rubber_env.rvm_gem_home %>/bin/passenger-memory-stats | tail -1`
22
22
  unless $?.success?
23
23
  $stderr.puts "failed executing passenger-memory-stats"
24
24
  exit 1
@@ -21,7 +21,7 @@ END
21
21
  end
22
22
 
23
23
  def output_values
24
- status = `sudo <%= rubber_env.rvm_gem_home %>/bin/passenger-status`
24
+ status = `rvm exec sudo <%= rubber_env.rvm_gem_home %>/bin/passenger-status`
25
25
  unless $?.success?
26
26
  $stderr.puts "failed executing passenger-status"
27
27
  exit 1
@@ -1,4 +1,4 @@
1
- passenger_version: 3.0.4
1
+ passenger_version: 3.0.9
2
2
  passenger_root: "#{rvm_gem_home}/gems/passenger-#{passenger_version}"
3
3
  passenger_ruby: "#{rvm_prefix}/wrappers/#{`bash -l -c 'rvm strings #{rvm_ruby}'`.strip}/ruby"
4
4
  passenger_lib: "#{passenger_root}/ext/apache2/mod_passenger.so"