nirvdrum-rubber 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. data/CHANGELOG +146 -0
  2. data/COPYING +339 -0
  3. data/README +6 -0
  4. data/TODO +11 -0
  5. data/VERSION +1 -0
  6. data/bin/vulcanize +41 -0
  7. data/generators/vulcanize/USAGE +6 -0
  8. data/generators/vulcanize/templates/apache/config/rubber/deploy-apache.rb +51 -0
  9. data/generators/vulcanize/templates/apache/config/rubber/role/apache/deflate.conf +10 -0
  10. data/generators/vulcanize/templates/apache/config/rubber/role/apache/expires.conf +9 -0
  11. data/generators/vulcanize/templates/apache/config/rubber/role/apache/headers.conf +6 -0
  12. data/generators/vulcanize/templates/apache/config/rubber/role/apache/monit-apache.conf +8 -0
  13. data/generators/vulcanize/templates/apache/config/rubber/role/apache/ports.conf +5 -0
  14. data/generators/vulcanize/templates/apache/config/rubber/role/apache/setenvif.conf +52 -0
  15. data/generators/vulcanize/templates/apache/config/rubber/role/web_tools/tools-apache-vhost.conf +66 -0
  16. data/generators/vulcanize/templates/apache/config/rubber/role/web_tools/tools-apache.auth +7 -0
  17. data/generators/vulcanize/templates/apache/config/rubber/role/web_tools/tools-index.html +34 -0
  18. data/generators/vulcanize/templates/apache/config/rubber/rubber-apache.yml +6 -0
  19. data/generators/vulcanize/templates/apache/templates.yml +1 -0
  20. data/generators/vulcanize/templates/base/Capfile +14 -0
  21. data/generators/vulcanize/templates/base/config/deploy.rb +55 -0
  22. data/generators/vulcanize/templates/base/config/rubber/common/crontab +17 -0
  23. data/generators/vulcanize/templates/base/config/rubber/common/monit-postfix.conf +8 -0
  24. data/generators/vulcanize/templates/base/config/rubber/common/rubber.profile +14 -0
  25. data/generators/vulcanize/templates/base/config/rubber/deploy-setup.rb +84 -0
  26. data/generators/vulcanize/templates/base/config/rubber/rubber-dns.yml +79 -0
  27. data/generators/vulcanize/templates/base/config/rubber/rubber.yml +227 -0
  28. data/generators/vulcanize/templates/base/lib/tasks/rubber.rake +15 -0
  29. data/generators/vulcanize/templates/base/script/cron-rake +18 -0
  30. data/generators/vulcanize/templates/base/script/cron-runner +18 -0
  31. data/generators/vulcanize/templates/base/script/cron-sh +67 -0
  32. data/generators/vulcanize/templates/base/templates.yml +1 -0
  33. data/generators/vulcanize/templates/complete_mongrel_mysql/config/rubber/role/haproxy/haproxy-mongrel.conf +23 -0
  34. data/generators/vulcanize/templates/complete_mongrel_mysql/config/rubber/role/nginx/nginx-mongrel.conf +113 -0
  35. data/generators/vulcanize/templates/complete_mongrel_mysql/config/rubber/rubber-complete.yml +41 -0
  36. data/generators/vulcanize/templates/complete_mongrel_mysql/templates.yml +6 -0
  37. data/generators/vulcanize/templates/complete_passenger_mysql/config/rubber/role/haproxy/haproxy-passenger.conf +21 -0
  38. data/generators/vulcanize/templates/complete_passenger_mysql/config/rubber/rubber-complete.yml +40 -0
  39. data/generators/vulcanize/templates/complete_passenger_mysql/templates.yml +10 -0
  40. data/generators/vulcanize/templates/cruise/config/rubber/deploy-cruise.rb +72 -0
  41. data/generators/vulcanize/templates/cruise/config/rubber/role/cruise/cruise +40 -0
  42. data/generators/vulcanize/templates/cruise/config/rubber/role/cruise/my.cnf +165 -0
  43. data/generators/vulcanize/templates/cruise/config/rubber/role/cruise/production.rb +8 -0
  44. data/generators/vulcanize/templates/cruise/config/rubber/role/cruise/site_config.rb +76 -0
  45. data/generators/vulcanize/templates/cruise/config/rubber/role/web_tools/cruise-nginx.conf +11 -0
  46. data/generators/vulcanize/templates/cruise/config/rubber/rubber-cruise.yml +18 -0
  47. data/generators/vulcanize/templates/cruise/templates.yml +1 -0
  48. data/generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb +45 -0
  49. data/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/haproxy-base.conf +26 -0
  50. data/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/haproxy-default.conf +8 -0
  51. data/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/monit-haproxy.conf +9 -0
  52. data/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/syslog-haproxy.conf +6 -0
  53. data/generators/vulcanize/templates/haproxy/config/rubber/role/haproxy/syslogd-default.conf +17 -0
  54. data/generators/vulcanize/templates/haproxy/config/rubber/role/web_tools/haproxy-nginx.conf +10 -0
  55. data/generators/vulcanize/templates/haproxy/config/rubber/rubber-haproxy.yml +7 -0
  56. data/generators/vulcanize/templates/haproxy/templates.yml +1 -0
  57. data/generators/vulcanize/templates/jetty/config/rubber/deploy-jetty.rb +59 -0
  58. data/generators/vulcanize/templates/jetty/config/rubber/role/jetty/jetty.sh +589 -0
  59. data/generators/vulcanize/templates/jetty/config/rubber/role/jetty/jetty.xml +199 -0
  60. data/generators/vulcanize/templates/jetty/config/rubber/role/jetty/monit-jetty.conf +9 -0
  61. data/generators/vulcanize/templates/jetty/config/rubber/rubber-jetty.yml +10 -0
  62. data/generators/vulcanize/templates/jetty/templates.yml +1 -0
  63. data/generators/vulcanize/templates/memcached/config/memcached.yml +28 -0
  64. data/generators/vulcanize/templates/memcached/config/rubber/common/memcached.yml +14 -0
  65. data/generators/vulcanize/templates/memcached/config/rubber/role/memcached/memcached.conf +52 -0
  66. data/generators/vulcanize/templates/memcached/config/rubber/role/memcached/memcached_munin_plugin +249 -0
  67. data/generators/vulcanize/templates/memcached/config/rubber/rubber-memcached.yml +7 -0
  68. data/generators/vulcanize/templates/memcached/templates.yml +1 -0
  69. data/generators/vulcanize/templates/minimal_mysql/templates.yml +7 -0
  70. data/generators/vulcanize/templates/minimal_nodb/templates.yml +6 -0
  71. data/generators/vulcanize/templates/mongrel/config/rubber/deploy-mongrel.rb +75 -0
  72. data/generators/vulcanize/templates/mongrel/config/rubber/role/mongrel/mongrel_cluster.yml +12 -0
  73. data/generators/vulcanize/templates/mongrel/config/rubber/role/mongrel/monit-mongrel.conf +20 -0
  74. data/generators/vulcanize/templates/mongrel/config/rubber/rubber-mongrel.yml +9 -0
  75. data/generators/vulcanize/templates/mongrel/templates.yml +1 -0
  76. data/generators/vulcanize/templates/monit/config/rubber/common/monit-default.conf +15 -0
  77. data/generators/vulcanize/templates/monit/config/rubber/common/monit.conf +251 -0
  78. data/generators/vulcanize/templates/monit/config/rubber/deploy-monit.rb +32 -0
  79. data/generators/vulcanize/templates/monit/config/rubber/role/web_tools/monit-admin-nginx.conf +10 -0
  80. data/generators/vulcanize/templates/monit/config/rubber/rubber-monit.yml +6 -0
  81. data/generators/vulcanize/templates/monit/templates.yml +1 -0
  82. data/generators/vulcanize/templates/munin/config/rubber/common/monit-munin.conf +8 -0
  83. data/generators/vulcanize/templates/munin/config/rubber/common/munin-node.conf +48 -0
  84. data/generators/vulcanize/templates/munin/config/rubber/common/munin-plugins.conf +9 -0
  85. data/generators/vulcanize/templates/munin/config/rubber/deploy-munin.rb +46 -0
  86. data/generators/vulcanize/templates/munin/config/rubber/role/web_tools/munin-nginx.conf +8 -0
  87. data/generators/vulcanize/templates/munin/config/rubber/role/web_tools/munin-plugins.conf +31 -0
  88. data/generators/vulcanize/templates/munin/config/rubber/role/web_tools/munin.conf +80 -0
  89. data/generators/vulcanize/templates/munin/config/rubber/rubber-munin.yml +8 -0
  90. data/generators/vulcanize/templates/munin/script/munin/example_mysql_query.rb +57 -0
  91. data/generators/vulcanize/templates/munin/script/munin/example_simple.rb +24 -0
  92. data/generators/vulcanize/templates/munin/templates.yml +1 -0
  93. data/generators/vulcanize/templates/mysql/config/rubber/common/database.yml +11 -0
  94. data/generators/vulcanize/templates/mysql/config/rubber/deploy-mysql.rb +156 -0
  95. data/generators/vulcanize/templates/mysql/config/rubber/role/db/crontab +14 -0
  96. data/generators/vulcanize/templates/mysql/config/rubber/role/db/monit-mysql.cnf +10 -0
  97. data/generators/vulcanize/templates/mysql/config/rubber/role/db/my.cnf +167 -0
  98. data/generators/vulcanize/templates/mysql/config/rubber/role/mysql_slave/mysql_slave_munin_plugin +51 -0
  99. data/generators/vulcanize/templates/mysql/config/rubber/rubber-mysql.yml +46 -0
  100. data/generators/vulcanize/templates/mysql/templates.yml +1 -0
  101. data/generators/vulcanize/templates/mysql_cluster/config/rubber/common/mysql_cluster_migrations.rb +13 -0
  102. data/generators/vulcanize/templates/mysql_cluster/config/rubber/deploy-mysql_cluster.rb +173 -0
  103. data/generators/vulcanize/templates/mysql_cluster/config/rubber/role/mysql_data/my.cnf +15 -0
  104. data/generators/vulcanize/templates/mysql_cluster/config/rubber/role/mysql_mgm/ndb_mgmd.cnf +39 -0
  105. data/generators/vulcanize/templates/mysql_cluster/config/rubber/role/mysql_sql/monit-mysql_cluster_sql.cnf +10 -0
  106. data/generators/vulcanize/templates/mysql_cluster/config/rubber/role/mysql_sql/my.cnf +23 -0
  107. data/generators/vulcanize/templates/mysql_cluster/config/rubber/rubber-mysql_cluster.yml +32 -0
  108. data/generators/vulcanize/templates/mysql_cluster/templates.yml +1 -0
  109. data/generators/vulcanize/templates/mysql_proxy/config/rubber/common/database.yml +16 -0
  110. data/generators/vulcanize/templates/mysql_proxy/config/rubber/common/monit-mysql_proxy.cnf +10 -0
  111. data/generators/vulcanize/templates/mysql_proxy/config/rubber/common/mysql-proxy +153 -0
  112. data/generators/vulcanize/templates/mysql_proxy/config/rubber/common/mysql-proxy.conf +10 -0
  113. data/generators/vulcanize/templates/mysql_proxy/config/rubber/common/mysql-proxy.lua +5 -0
  114. data/generators/vulcanize/templates/mysql_proxy/config/rubber/deploy-mysql_proxy.rb +52 -0
  115. data/generators/vulcanize/templates/mysql_proxy/config/rubber/rubber-mysql_proxy.yml +11 -0
  116. data/generators/vulcanize/templates/mysql_proxy/templates.yml +1 -0
  117. data/generators/vulcanize/templates/nginx/config/rubber/deploy-nginx.rb +45 -0
  118. data/generators/vulcanize/templates/nginx/config/rubber/role/nginx/crontab +9 -0
  119. data/generators/vulcanize/templates/nginx/config/rubber/role/nginx/monit-nginx.conf +8 -0
  120. data/generators/vulcanize/templates/nginx/config/rubber/role/nginx/nginx.conf +42 -0
  121. data/generators/vulcanize/templates/nginx/config/rubber/role/web_tools/nginx-tools.conf +55 -0
  122. data/generators/vulcanize/templates/nginx/config/rubber/role/web_tools/tools-index.html +30 -0
  123. data/generators/vulcanize/templates/nginx/config/rubber/role/web_tools/tools-nginx.auth +7 -0
  124. data/generators/vulcanize/templates/nginx/config/rubber/rubber-nginx.yml +10 -0
  125. data/generators/vulcanize/templates/nginx/templates.yml +1 -0
  126. data/generators/vulcanize/templates/passenger/config/rubber/deploy-passenger.rb +37 -0
  127. data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger-memory.conf +34 -0
  128. data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger-sudoers.conf +7 -0
  129. data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/munin-passenger.conf +47 -0
  130. data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/passenger-apache-vhost.conf +46 -0
  131. data/generators/vulcanize/templates/passenger/config/rubber/role/passenger/passenger.conf +10 -0
  132. data/generators/vulcanize/templates/passenger/config/rubber/rubber-passenger.yml +15 -0
  133. data/generators/vulcanize/templates/passenger/templates.yml +3 -0
  134. data/generators/vulcanize/templates/redis/config/rubber/deploy-redis.rb +36 -0
  135. data/generators/vulcanize/templates/redis/config/rubber/role/redis/crontab +8 -0
  136. data/generators/vulcanize/templates/redis/config/rubber/role/redis/monit-redis.conf +9 -0
  137. data/generators/vulcanize/templates/redis/config/rubber/role/redis/redis.conf +141 -0
  138. data/generators/vulcanize/templates/redis/config/rubber/rubber-redis.yml +4 -0
  139. data/generators/vulcanize/templates/redis/templates.yml +1 -0
  140. data/generators/vulcanize/templates/resque/config/rubber/deploy-resque-worker-default.rb +38 -0
  141. data/generators/vulcanize/templates/resque/config/rubber/deploy-resque.rb +39 -0
  142. data/generators/vulcanize/templates/resque/config/rubber/role/resque_worker_default/monit-resque_worker_default.conf +19 -0
  143. data/generators/vulcanize/templates/resque/config/rubber/rubber-resque.yml +10 -0
  144. data/generators/vulcanize/templates/resque/templates.yml +3 -0
  145. data/generators/vulcanize/templates/sphinx/config/rubber/common/sphinx.yml +46 -0
  146. data/generators/vulcanize/templates/sphinx/config/rubber/deploy-sphinx.rb +112 -0
  147. data/generators/vulcanize/templates/sphinx/config/rubber/role/sphinx/crontab +11 -0
  148. data/generators/vulcanize/templates/sphinx/config/rubber/role/sphinx/monit-sphinx.conf +10 -0
  149. data/generators/vulcanize/templates/sphinx/config/rubber/rubber-sphinx.yml +6 -0
  150. data/generators/vulcanize/templates/sphinx/templates.yml +1 -0
  151. data/generators/vulcanize/vulcanize_generator.rb +67 -0
  152. data/lib/capistrano/hostcmd.rb +12 -0
  153. data/lib/rubber.rb +38 -0
  154. data/lib/rubber/capistrano.rb +1 -0
  155. data/lib/rubber/cloud.rb +13 -0
  156. data/lib/rubber/cloud/aws.rb +334 -0
  157. data/lib/rubber/cloud/base.rb +16 -0
  158. data/lib/rubber/configuration.rb +47 -0
  159. data/lib/rubber/dns.rb +13 -0
  160. data/lib/rubber/dns/base.rb +84 -0
  161. data/lib/rubber/dns/dyndns.rb +78 -0
  162. data/lib/rubber/dns/nettica.rb +117 -0
  163. data/lib/rubber/dns/zerigo.rb +174 -0
  164. data/lib/rubber/environment.rb +169 -0
  165. data/lib/rubber/generator.rb +197 -0
  166. data/lib/rubber/instance.rb +166 -0
  167. data/lib/rubber/recipes/rubber.rb +89 -0
  168. data/lib/rubber/recipes/rubber/bundles.rb +28 -0
  169. data/lib/rubber/recipes/rubber/deploy.rb +90 -0
  170. data/lib/rubber/recipes/rubber/instances.rb +393 -0
  171. data/lib/rubber/recipes/rubber/load_balancers.rb +44 -0
  172. data/lib/rubber/recipes/rubber/security_groups.rb +189 -0
  173. data/lib/rubber/recipes/rubber/setup.rb +457 -0
  174. data/lib/rubber/recipes/rubber/spot_requests.rb +17 -0
  175. data/lib/rubber/recipes/rubber/static_ips.rb +107 -0
  176. data/lib/rubber/recipes/rubber/utils.rb +203 -0
  177. data/lib/rubber/recipes/rubber/volumes.rb +264 -0
  178. data/lib/rubber/tasks/rubber.rb +279 -0
  179. data/lib/rubber/util.rb +37 -0
  180. data/rails/init.rb +9 -0
  181. data/test/environment_test.rb +133 -0
  182. data/test/generator_test.rb +323 -0
  183. data/test/instance_test.rb +93 -0
  184. data/test/test_helper.rb +8 -0
  185. data/test/util_test.rb +16 -0
  186. metadata +298 -0
@@ -0,0 +1,8 @@
1
+ <%
2
+ @path = '/etc/monit/monit.d/monit-postfix.conf'
3
+ %>
4
+
5
+ check process postfix with pidfile /var/spool/postfix/pid/master.pid
6
+ start program "/etc/init.d/postfix start"
7
+ stop program "/etc/init.d/postfix stop"
8
+ if 5 restarts within 5 cycles then timeout
@@ -0,0 +1,14 @@
1
+ <%
2
+ @path = "/etc/profile.d/rubber.sh"
3
+ %>
4
+
5
+ # convenience to simply running rails console, etc with correct env
6
+ export RUBBER_ENV=<%= RUBBER_ENV %>
7
+ export RAILS_ENV=<%= RUBBER_ENV %>
8
+ alias current="cd <%= RUBBER_ROOT %>"
9
+
10
+ # make sure we use the right ruby since REE installs into /usr/local
11
+ export PATH=<%= rubber_env.ruby_prefix %>/bin:$PATH
12
+
13
+ # Always use rubygems
14
+ export RUBYOPT="rubygems"
@@ -0,0 +1,84 @@
1
+ namespace :rubber do
2
+ namespace :base do
3
+
4
+ rubber.allow_optional_tasks(self)
5
+
6
+
7
+ before "rubber:install_packages", "rubber:base:pre_install_ruby"
8
+ task :pre_install_ruby do
9
+
10
+ # figure out which hosts we have specified enterprise ruby for
11
+ sys_ruby_hosts = []
12
+ ent_ruby_hosts = []
13
+ rubber_instances.filtered.each do |ic|
14
+ env = rubber_cfg.environment.bind(ic.role_names, ic.name)
15
+ if env.use_enterprise_ruby
16
+ ent_ruby_hosts << ic.full_name
17
+ end
18
+ end
19
+
20
+ if ent_ruby_hosts.size > 0
21
+ task :_install_enterprise_ruby, :hosts => ent_ruby_hosts do
22
+ ver = "1.8.7-2009.10"
23
+ rubber.run_script "install_ruby-enterprise", <<-ENDSCRIPT
24
+ if [[ ! `ruby --version 2> /dev/null` =~ "Ruby Enterprise Edition 2009.10" ]]; then
25
+ arch=`uname -m`
26
+ if [ "$arch" = "x86_64" ]; then
27
+ src="http://rubyforge.org/frs/download.php/66163/ruby-enterprise_#{ver}_amd64.deb"
28
+ else
29
+ src="http://rubyforge.org/frs/download.php/66164/ruby-enterprise_#{ver}_i386.deb"
30
+ fi
31
+ src_file="${src##*/}"
32
+ wget -qP /tmp ${src}
33
+ dpkg -i /tmp/${src_file}
34
+ fi
35
+ ENDSCRIPT
36
+ end
37
+
38
+ _install_enterprise_ruby
39
+ end
40
+
41
+ end
42
+
43
+ # The ubuntu rubygem package is woefully out of date, so install it manually
44
+ after "rubber:install_packages", "rubber:base:install_rubygems"
45
+ task :install_rubygems do
46
+ ver = "1.3.5"
47
+ src_url = "http://rubyforge.org/frs/download.php/60718/rubygems-#{ver}.tgz"
48
+ rubber.sudo_script 'install_rubygems', <<-ENDSCRIPT
49
+ if [[ `gem --version 2>&1` != "#{ver}" ]]; then
50
+ wget -qNP /tmp #{src_url}
51
+ tar -C /tmp -xzf /tmp/rubygems-#{ver}.tgz
52
+ ruby -C /tmp/rubygems-#{ver} setup.rb
53
+ ln -sf /usr/bin/gem1.8 /usr/bin/gem
54
+ rm -rf /tmp/rubygems*
55
+ gem source -l > /dev/null
56
+ fi
57
+ ENDSCRIPT
58
+ end
59
+
60
+ after "rubber:install_packages", "rubber:base:configure_git" if scm == "git"
61
+ task :configure_git do
62
+ rubber.run_script 'configure_git', <<-ENDSCRIPT
63
+ if [[ "#{repository}" =~ "@" ]]; then
64
+ # Get host key for src machine to prevent ssh from failing
65
+ rm -f ~/.ssh/known_hosts
66
+ ! ssh -o 'StrictHostKeyChecking=no' #{repository.gsub(/:.*/, '')} &> /dev/null
67
+ fi
68
+ ENDSCRIPT
69
+ end
70
+
71
+ # We need a rails user for safer permissions used by deploy.rb
72
+ after "rubber:install_packages", "rubber:base:custom_install"
73
+ task :custom_install do
74
+ rubber.sudo_script 'custom_install', <<-ENDSCRIPT
75
+ # add the user for running app server with
76
+ if ! id #{rubber_env.app_user} &> /dev/null; then adduser --system --group #{rubber_env.app_user}; fi
77
+
78
+ # add ssh keys for root
79
+ if [[ ! -f /root/.ssh/id_dsa ]]; then ssh-keygen -q -t dsa -N '' -f /root/.ssh/id_dsa; fi
80
+ ENDSCRIPT
81
+ end
82
+
83
+ end
84
+ end
@@ -0,0 +1,79 @@
1
+ # OPTIONAL: The dns provider to use. Need to exist in dns_providers below
2
+ # dns_provider: nettica
3
+
4
+ # OPTIONAL: The configuration for each dns provider (nettica|zerigo|dyndns)
5
+ # This lets rubber update a dynamic dns service with the instance alias and ip
6
+ #
7
+ dns_providers:
8
+ nettica:
9
+ user: joe
10
+ password: sekret
11
+ type: A
12
+ ttl: 300
13
+ zerigo:
14
+ customer_id: 1234
15
+ email: foo@bar.com
16
+ token: hexxy
17
+ type: A
18
+ ttl: 300
19
+ dyndns:
20
+ user: joe
21
+ password: sekret
22
+ update_url: https://members.dyndns.org/nic/update?hostname=%host%&myip=%ip%'
23
+
24
+ # OPTIONAL: Lets you configure your dns service, for example to add other CNAMES
25
+ # or setup dns round robin, etc. Run "cap rubber:setup_dns_records"
26
+ # to apply them as rubber only sets up instance aliases as part of
27
+ # the standard lifecycle
28
+ #
29
+ # dns_records:
30
+ # # simple A record
31
+ # - host: bar
32
+ # data: 1.1.1.1
33
+ #
34
+ # # more detailed A record
35
+ # - host: bar
36
+ # domain: otherdomain.com
37
+ # data: 1.1.1.1
38
+ # type: A
39
+ # ttl: 300
40
+ #
41
+ # # tld A record
42
+ # - host: ''
43
+ # data: 1.1.1.1
44
+ # type: A
45
+ #
46
+ # # simple CNAME record
47
+ # - host: otherbar
48
+ # domain: foo.com
49
+ # data: bar.foo.com
50
+ # type: CNAME
51
+ # ttl: 300
52
+ #
53
+ # # 2 of the same A records is a round robin dns
54
+ # - host: rr
55
+ # domain: foo.com
56
+ # data: 1.1.1.1
57
+ # type: A
58
+ # ttl: 300
59
+ # - host: rr
60
+ # domain: foo.com
61
+ # data: 1.1.1.2
62
+ # type: A
63
+ # ttl: 300
64
+ #
65
+ # # A record, grabbing ip from instance config
66
+ # - host: baz
67
+ # domain: foo.com
68
+ # data: "#{rubber_instances.for_role('web').first.external_ip}"
69
+ # type: A
70
+ # ttl: 300
71
+ #
72
+ # # MX record
73
+ # - host: ''
74
+ # domain: foo.com
75
+ # data: mail.foo.com
76
+ # type: MX
77
+ # ttl: 300
78
+ # priority: 10
79
+
@@ -0,0 +1,227 @@
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
+ # REQUIRED: The name of your application
14
+ app_name: your_app_name
15
+
16
+ # REQUIRED: The system user to run your app servers as
17
+ app_user: app
18
+
19
+ # REQUIRED: Notification emails (e.g. monit) get sent to this address
20
+ #
21
+ admin_email: root@localhost
22
+
23
+ # OPTIONAL: If not set, you won't be able to access web_tools
24
+ # server (munin stats, monit status, etc)
25
+ # web_tools_user: admin
26
+ # web_tools_password: sekret
27
+
28
+ # REQUIRED: The timezone the server should be in
29
+ timezone: US/Eastern
30
+
31
+ # REQUIRED: the domain all the instances should be associated with
32
+ #
33
+ domain: foo.com
34
+
35
+ # OPTIONAL: See rubber-dns.yml for dns configuration
36
+ # This lets rubber update a dynamic dns service with the instance alias
37
+ # and ip when they are created. It also allows setting up arbitrary
38
+ # dns records (CNAME, MX, Round Robin DNS, etc)
39
+
40
+ # OPTIONAL: Additional rubber file to pull config from if it exists. This file will
41
+ # also be pushed to remote host at RUBBER_ROOT/config/rubber/rubber-secret.yml
42
+ #
43
+ # rubber_secret: "#{File.expand_path('~') + '/.ec2' + (RUBBER_ENV == 'production' ? '' : '_dev') + '/rubber-secret.yml' rescue ''}"
44
+
45
+ # REQUIRED All known cloud providers with the settings needed to configure them
46
+ # There's only one coud provider right now - Amazon Web Services
47
+ # To implement another, clone lib/rubber/cloud/aws.rb
48
+ #
49
+ cloud_providers:
50
+ aws:
51
+ # REQUIRED The amazon keys and account ID (digits only, no dashes) used to access the AWS API
52
+ #
53
+ access_key: XXX
54
+ secret_access_key: YYY
55
+ account: ZZZ
56
+
57
+ # REQUIRED: The name of the amazon keypair and location of its private key
58
+ #
59
+ # NOTE: for some reason Capistrano requires you to have both the public and
60
+ # the private key in the same folder, the public key should have the
61
+ # extension ".pub". The easiest (only?) way to get your hand on this is to
62
+ # create an instance, ssh into it, and copy the file /mnt/openssh_id.pub
63
+ #
64
+ key_name: gsg-keypair
65
+ key_file: "#{Dir[(File.expand_path('~') rescue '/root') + '/.ec2/*' + cloud_providers.aws.key_name].first}"
66
+
67
+ # OPTIONAL: Needed for bundling a running instance using rubber:bundle
68
+ #
69
+ # pk_file: "#{Dir[(File.expand_path('~') rescue '/root') + '/.ec2/pk-*'].first}"
70
+ # cert_file: "#{Dir[(File.expand_path('~') rescue '/root') + '/.ec2/cert-*'].first}"
71
+ # image_bucket: "#{app_name}-images"
72
+
73
+ # OPTIONAL: Needed for backing up database to s3
74
+ # backup_bucket: "#{app_name}-backups"
75
+
76
+ # REQUIRED: the ami and instance type for creating instances
77
+ # The Ubuntu images at http://alestic.com/ work well
78
+ # Ubuntu 9.04 Jaunty base install 32-bit 2.6.21.7-2.fc8xen ami-ccf615a5
79
+ # Ubuntu 9.04 Jaunty base install 64-bit 2.6.21.7-2.fc8xen ami-eef61587
80
+ #
81
+ image_id: ami-ccf615a5
82
+ # m1.small or m1.large or m1.xlarge
83
+ image_type: m1.small
84
+
85
+ # REQUIRED the cloud provider to use
86
+ #
87
+ cloud_provider: aws
88
+
89
+ # OPTIONAL: Define security groups
90
+ # Each security group is a name associated with a sequence of maps where the
91
+ # keys are the parameters to the ec2 AuthorizeSecurityGroupIngress API
92
+ # source_security_group_name, source_security_group_owner_id
93
+ # ip_protocol, from_port, to_port, cidr_ip
94
+ #
95
+ security_groups:
96
+ default:
97
+ description: The default security group
98
+ rules:
99
+ - source_group_name: default
100
+ source_group_account: "#{cloud_providers.aws.account}"
101
+ - protocol: tcp
102
+ from_port: 22
103
+ to_port: 22
104
+ source_ips: [0.0.0.0/0]
105
+
106
+ # OPTIONAL: The default security groups to create instances with
107
+ assigned_security_groups: [default]
108
+
109
+ # OPTIONAL: Automatically create security groups for each host and role
110
+ # EC2 doesn't allow one to change what groups an instance belongs to after
111
+ # creation, so its good to have some empty ones predefined.
112
+ auto_security_groups: true
113
+
114
+ # OPTIONAL: Automatically isolate security groups for each appname/environment
115
+ # by mangling their names to be appname_env_groupname
116
+ # This makes it safer to have staging and production coexist on the same EC2
117
+ # account, or even multiple apps
118
+ isolate_security_groups: true
119
+
120
+ # OPTIONAL: Set if you want to use Ruby Enterprise Edition instead of the standard ubuntu one
121
+ use_enterprise_ruby: false
122
+
123
+ # REE installs into /usr/local, so this lets us setup environment to use it globally
124
+ # instead of system ruby
125
+ ruby_prefix: "#{use_enterprise_ruby ? '/usr/local' : '/usr'}"
126
+
127
+ # OPTIONAL: The packages to install on all instances
128
+ # You can install a specific version of a package by using a sub-array of pkg, version
129
+ # For example, packages: [[rake, 0.7.1], irb]
130
+ packages: [postfix, build-essential, ruby-full, ruby1.8-dev, rake, irb, git-core]
131
+
132
+ # OPTIONAL: gem sources to setup for rubygems
133
+ gemsources: ["http://gemcutter.org", "http://gems.rubyforge.org/", "http://gems.github.com"]
134
+
135
+ # OPTIONAL: The gems to install on all instances
136
+ # You can install a specific version of a gem by using a sub-array of gem, version
137
+ # For example, gem: [[rails, 2.2.2], open4, aws-s3]
138
+ gems: [rubber, rails, open4, aws-s3]
139
+
140
+ # OPTIONAL: A string prepended to shell command strings that cause multi
141
+ # statement shell commands to fail fast. You may need to comment this out
142
+ # on some platforms, but it works for me on linux/osx with a bash shell
143
+ #
144
+ stop_on_error_cmd: "function error_exit { exit 99; }; trap error_exit ERR"
145
+
146
+ # OPTIONAL: The default set of roles to use when creating a staging instance
147
+ # with "cap rubber:create_staging". By default this uses all the known roles,
148
+ # but this is not always desired for staging, so you can specify a different
149
+ # set here
150
+ #
151
+ staging_roles: "web,app,db:primary=true"
152
+
153
+
154
+ # OPTIONAL: Lets one assign amazon elastic IPs (static IPs) to your instances
155
+ # You should typically set this on the role/host level rather than
156
+ # globally , unless you really do want all instances to have a
157
+ # static IP
158
+ #
159
+ # use_static_ip: true
160
+
161
+ # OPTIONAL: Specifies an instance to be created in the given availability zone
162
+ # Availability zones are sepcified by amazon to be somewhat isolated
163
+ # from each other so that hardware failures in one zone shouldn't
164
+ # affect instances in another. As such, it is good to specify these
165
+ # for instances that need to be redundant to reduce your chance of
166
+ # downtime. You should typically set this on the role/host level
167
+ # rather than globally. Use rubber describe:zones to see the list
168
+ # of zones
169
+ # availability_zone: us-east-1a
170
+
171
+ # OPTIONAL: If you want t use Elastic Block Store (EBS) persistent
172
+ # volumes, add them to host specific overrides and they will get created
173
+ # and assigned to the instance. On initial creation, the volume will get
174
+ # attached _and_ formatted, but if your host disapears and you recreate
175
+ # it, the volume will only get remounted thereby preserving your data
176
+ #
177
+ # hosts:
178
+ # my_host:
179
+ # availability_zone: us-east-1a
180
+ # volumes:
181
+ # - size: 100 # size of vol in GBs
182
+ # zone: us-east-1a # zone to create volume in, needs to match host's zone
183
+ # device: /dev/sdh # OS device to attach volume to
184
+ # mount: /mnt/mysql # The directory to mount this volume to
185
+ # filesystem: ext3 # the filesystem to create on volume
186
+ # - size: 10 # size of vol in GBs
187
+ # zone: us-east-1a # zone to create volume in, needs to match host's zone
188
+ # device: /dev/sdi # OS device to attach volume to
189
+ # mount: /mnt/logs # The directory to mount this volume to
190
+ # filesystem: ext3 # the filesystem to create on volume
191
+ #
192
+ # # volumes without mount/filesystem can be used in raid arrays
193
+ #
194
+ # - size: 50 # size of vol in GBs
195
+ # zone: us-east-1a # zone to create volume in, needs to match host's zone
196
+ # device: /dev/sdx # OS device to attach volume to
197
+ # - size: 50 # size of vol in GBs
198
+ # zone: us-east-1a # zone to create volume in, needs to match host's zone
199
+ # device: /dev/sdy # OS device to attach volume to
200
+ #
201
+ # # for raid array, you'll need to add mdadm to packages. Likewise,
202
+ # # xfsprogs is needed for xfs filesystem support
203
+ # packages: [xfsprogs, mdadm]
204
+ # raid_volumes:
205
+ # - device: /dev/md0 # OS device to to create raid array on
206
+ # mount: /mnt/fast # The directory to mount this array to
207
+ # filesystem: xfs # the filesystem to create on array
208
+ # raid_level: 0 # the raid level to use for the array
209
+ # source_devices: [/dev/sdx, /dev/sdy] # the source EBS devices we are creating raid array from
210
+
211
+ # OPTIONAL: You can also define your own variables here for use when
212
+ # transforming config files, and they will be available in your config
213
+ # templates as <%= rubber_env.var_name %>
214
+ #
215
+ # var_name: var_value
216
+
217
+ # OPTIONAL: Role specific overrides
218
+ # roles:
219
+ # somerole:
220
+ # packages: []
221
+ # somerole2:
222
+ # myconfig: someval
223
+
224
+ # OPTIONAL: Host specific overrides
225
+ # hosts:
226
+ # somehost:
227
+ # packages: []
@@ -0,0 +1,15 @@
1
+ # rails tries to load this from generator dir, so skip it.
2
+ if __FILE__ !~ /rubber\/generators\/vulcanize/
3
+
4
+ env = ENV['RUBBER_ENV'] ||= (ENV['RAILS_ENV'] || 'development')
5
+ root = File.dirname(__FILE__) + '/../..'
6
+
7
+ # this tries first as a rails plugin then as a gem
8
+ $:.unshift "#{root}/vendor/plugins/rubber/lib/"
9
+ require 'rubber'
10
+
11
+ Rubber::initialize(root, env)
12
+
13
+ require 'rubber/tasks/rubber'
14
+
15
+ end
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # For running rake jobs through cron - only prints output if there is an error
4
+ #
5
+ # author mconway
6
+ # since 8/12/07
7
+
8
+ RAILS_ROOT = File.expand_path("..", File.dirname(__FILE__))
9
+ log = "#{RAILS_ROOT}/log/cron-rake-#{Time.now.tv_sec}.log"
10
+ begin
11
+ ident = File.basename(ARGV[-1]).gsub(/\W+/, "_")
12
+ log = "#{RAILS_ROOT}/log/cron-rake-#{ident}.log"
13
+ rescue
14
+ end
15
+
16
+ Dir.chdir(RAILS_ROOT)
17
+ args = %W{-l #{log} -- rake --trace} + ARGV
18
+ system "script/cron-sh", *args