deprec 2.2.3 → 3.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (209) hide show
  1. data/CHANGELOG +1 -1
  2. data/bin/depify +3 -8
  3. data/{lib → docs}/deprec_cmd_completion.sh +0 -0
  4. data/lib/deprec.rb +5 -7
  5. data/lib/deprec/cap.rb +51 -0
  6. data/lib/deprec/{callbacks → cap/callbacks}/asset_pipeline.rb +0 -0
  7. data/lib/deprec/{recipes → cap/recipes}/aoe.rb +0 -0
  8. data/lib/deprec/{recipes → cap/recipes}/apache.rb +0 -0
  9. data/lib/deprec/{recipes → cap/recipes}/bash.rb +0 -0
  10. data/lib/deprec/{recipes → cap/recipes}/canonical.rb +0 -0
  11. data/lib/deprec/{recipes → cap/recipes}/collectd.rb +0 -0
  12. data/lib/deprec/{recipes → cap/recipes}/deprec.rb +1 -2
  13. data/lib/deprec/{recipes → cap/recipes}/deprecated.rb +0 -0
  14. data/lib/deprec/{recipes → cap/recipes}/ec2.rb +0 -0
  15. data/lib/deprec/{recipes → cap/recipes}/example.rb +0 -0
  16. data/lib/deprec/{recipes → cap/recipes}/git.rb +0 -0
  17. data/lib/deprec/{recipes → cap/recipes}/haproxy.rb +0 -0
  18. data/lib/deprec/{recipes → cap/recipes}/heartbeat.rb +0 -0
  19. data/lib/deprec/{recipes → cap/recipes}/logrotate.rb +0 -0
  20. data/lib/deprec/{recipes → cap/recipes}/lvm.rb +0 -0
  21. data/lib/deprec/{recipes → cap/recipes}/mongrel.rb +0 -0
  22. data/lib/deprec/{recipes → cap/recipes}/monit.rb +0 -0
  23. data/lib/deprec/{recipes → cap/recipes}/mri.rb +0 -0
  24. data/lib/deprec/{recipes → cap/recipes}/mysql.rb +0 -0
  25. data/lib/deprec/{recipes → cap/recipes}/nagios.rb +0 -0
  26. data/lib/deprec/{recipes → cap/recipes}/nagios3.rb +0 -0
  27. data/lib/deprec/{recipes → cap/recipes}/network.rb +0 -0
  28. data/lib/deprec/{recipes → cap/recipes}/nginx.rb +0 -0
  29. data/lib/deprec/{recipes → cap/recipes}/nrpe.rb +0 -0
  30. data/lib/deprec/{recipes → cap/recipes}/ntp.rb +0 -0
  31. data/lib/deprec/{recipes → cap/recipes}/passenger.rb +0 -0
  32. data/lib/deprec/{recipes → cap/recipes}/php.rb +0 -0
  33. data/lib/deprec/{recipes → cap/recipes}/postfix.rb +0 -0
  34. data/lib/deprec/{recipes → cap/recipes}/postgresql.rb +0 -0
  35. data/lib/deprec/{recipes → cap/recipes}/rack.rb +0 -0
  36. data/lib/deprec/{recipes → cap/recipes}/rails.rb +4 -4
  37. data/lib/deprec/{recipes → cap/recipes}/ree.rb +0 -0
  38. data/lib/deprec/{recipes → cap/recipes}/rubygems.rb +0 -0
  39. data/lib/deprec/{recipes → cap/recipes}/sqlite.rb +0 -0
  40. data/lib/deprec/{recipes → cap/recipes}/ssh.rb +0 -0
  41. data/lib/deprec/{recipes → cap/recipes}/ssl.rb +0 -0
  42. data/lib/deprec/{recipes → cap/recipes}/stunnel.rb +0 -0
  43. data/lib/deprec/{recipes → cap/recipes}/syslog.rb +0 -0
  44. data/lib/deprec/{recipes → cap/recipes}/syslog_ng.rb +0 -0
  45. data/lib/deprec/{recipes → cap/recipes}/ubuntu.rb +0 -0
  46. data/lib/deprec/{recipes → cap/recipes}/users.rb +0 -0
  47. data/lib/deprec/{recipes → cap/recipes}/utils.rb +0 -0
  48. data/lib/deprec/{recipes → cap/recipes}/xen.rb +0 -0
  49. data/lib/deprec/{recipes → cap/recipes}/xentools.rb +0 -0
  50. data/lib/deprec/{templates → cap/templates}/aoe/aoe-init +0 -0
  51. data/lib/deprec/{templates → cap/templates}/aoe/fence_aoemask +0 -0
  52. data/lib/deprec/{templates → cap/templates}/apache/CHANGES.txt +0 -0
  53. data/lib/deprec/{templates → cap/templates}/apache/apache2.conf.erb +0 -0
  54. data/lib/deprec/{templates → cap/templates}/apache/default.erb +0 -0
  55. data/lib/deprec/{templates → cap/templates}/apache/namevirtualhosts.conf +0 -0
  56. data/lib/deprec/{templates → cap/templates}/apache/ports.conf.erb +0 -0
  57. data/lib/deprec/{templates → cap/templates}/apache/status.conf.erb +0 -0
  58. data/lib/deprec/{templates → cap/templates}/apache/vhost.erb +0 -0
  59. data/lib/deprec/{templates → cap/templates}/bash/bash_global +0 -0
  60. data/lib/deprec/{templates → cap/templates}/collectd/collectd-init.d +0 -0
  61. data/lib/deprec/{templates → cap/templates}/collectd/collectd.conf.erb +0 -0
  62. data/lib/deprec/{templates → cap/templates}/deprec/caprc.erb +0 -0
  63. data/lib/deprec/{templates → cap/templates}/haproxy/haproxy-init.d +0 -0
  64. data/lib/deprec/{templates → cap/templates}/haproxy/haproxy.cfg.erb +0 -0
  65. data/lib/deprec/{templates → cap/templates}/heartbeat/authkeys.erb +0 -0
  66. data/lib/deprec/{templates → cap/templates}/heartbeat/ha.cf.erb +0 -0
  67. data/lib/deprec/{templates → cap/templates}/heartbeat/haresources.erb +0 -0
  68. data/lib/deprec/{templates → cap/templates}/logrotate/logrotate.conf.erb +0 -0
  69. data/lib/deprec/{templates → cap/templates}/mongrel/apache_vhost.conf.erb +0 -0
  70. data/lib/deprec/{templates → cap/templates}/mongrel/logrotate.conf.erb +0 -0
  71. data/lib/deprec/{templates → cap/templates}/mongrel/mongrel_cluster-init-script +0 -0
  72. data/lib/deprec/{templates → cap/templates}/mongrel/mongrel_cluster.yml.erb +0 -0
  73. data/lib/deprec/{templates → cap/templates}/mongrel/monit.conf.erb +0 -0
  74. data/lib/deprec/{templates → cap/templates}/mongrel/nginx_vhost.conf.erb +0 -0
  75. data/lib/deprec/{templates → cap/templates}/monit/monit-init-script +0 -0
  76. data/lib/deprec/{templates → cap/templates}/monit/monitrc.erb +0 -0
  77. data/lib/deprec/{templates → cap/templates}/monit/nothing.monitrc +0 -0
  78. data/lib/deprec/{templates → cap/templates}/mysql/create_databases.sql +0 -0
  79. data/lib/deprec/{templates → cap/templates}/mysql/database.yml.prod +0 -0
  80. data/lib/deprec/{templates → cap/templates}/mysql/database.yml.stage +0 -0
  81. data/lib/deprec/{templates → cap/templates}/mysql/my.cnf.erb +0 -0
  82. data/lib/deprec/{templates → cap/templates}/mysql/sphinx.conf.prod +0 -0
  83. data/lib/deprec/{templates → cap/templates}/mysql/sphinx.conf.stage +0 -0
  84. data/lib/deprec/{templates → cap/templates}/nagios.old/README +0 -0
  85. data/lib/deprec/{templates → cap/templates}/nagios.old/apache_vhost.erb +0 -0
  86. data/lib/deprec/{templates → cap/templates}/nagios.old/cgi.cfg.erb +0 -0
  87. data/lib/deprec/{templates → cap/templates}/nagios.old/check_linux_free_memory.pl +0 -0
  88. data/lib/deprec/{templates → cap/templates}/nagios.old/check_mongrel_cluster.rb +0 -0
  89. data/lib/deprec/{templates → cap/templates}/nagios.old/htpasswd.users +0 -0
  90. data/lib/deprec/{templates → cap/templates}/nagios.old/mrtg.cfg +0 -0
  91. data/lib/deprec/{templates → cap/templates}/nagios.old/nagios.cfg.erb +0 -0
  92. data/lib/deprec/{templates → cap/templates}/nagios.old/nrpe.cfg.erb +0 -0
  93. data/lib/deprec/{templates → cap/templates}/nagios.old/nrpe.xinetd.erb +0 -0
  94. data/lib/deprec/{templates → cap/templates}/nagios.old/objects/commands.cfg.erb +0 -0
  95. data/lib/deprec/{templates → cap/templates}/nagios.old/objects/contacts.cfg.erb +0 -0
  96. data/lib/deprec/{templates → cap/templates}/nagios.old/objects/hosts.cfg.erb +0 -0
  97. data/lib/deprec/{templates → cap/templates}/nagios.old/objects/localhost.cfg.erb +0 -0
  98. data/lib/deprec/{templates → cap/templates}/nagios.old/objects/services.cfg.erb +0 -0
  99. data/lib/deprec/{templates → cap/templates}/nagios.old/objects/timeperiods.cfg.erb +0 -0
  100. data/lib/deprec/{templates → cap/templates}/nagios.old/resource.cfg.erb +0 -0
  101. data/lib/deprec/{templates → cap/templates}/nagios/apache2.conf +0 -0
  102. data/lib/deprec/{templates → cap/templates}/nagios/cgi.cfg +0 -0
  103. data/lib/deprec/{templates → cap/templates}/nagios/check_linux_free_memory.pl +0 -0
  104. data/lib/deprec/{templates → cap/templates}/nagios/commands.cfg +0 -0
  105. data/lib/deprec/{templates → cap/templates}/nagios/conf.d/contacts_nagios2.cfg +0 -0
  106. data/lib/deprec/{templates → cap/templates}/nagios/conf.d/extinfo_nagios2.cfg +0 -0
  107. data/lib/deprec/{templates → cap/templates}/nagios/conf.d/generic-host_nagios2.cfg +0 -0
  108. data/lib/deprec/{templates → cap/templates}/nagios/conf.d/generic-service_nagios2.cfg +0 -0
  109. data/lib/deprec/{templates → cap/templates}/nagios/conf.d/hostgroups_nagios2.cfg +0 -0
  110. data/lib/deprec/{templates → cap/templates}/nagios/conf.d/hosts/localhost_nagios2.cfg +0 -0
  111. data/lib/deprec/{templates → cap/templates}/nagios/conf.d/services_nagios2.cfg +0 -0
  112. data/lib/deprec/{templates → cap/templates}/nagios/conf.d/timeperiods_nagios2.cfg +0 -0
  113. data/lib/deprec/{templates → cap/templates}/nagios/host_template.erb +0 -0
  114. data/lib/deprec/{templates → cap/templates}/nagios/htpasswd.users +0 -0
  115. data/lib/deprec/{templates → cap/templates}/nagios/nagios.cfg +0 -0
  116. data/lib/deprec/{templates → cap/templates}/nagios/nrpe.cfg +0 -0
  117. data/lib/deprec/{templates → cap/templates}/nagios/resource.cfg +0 -0
  118. data/lib/deprec/{templates → cap/templates}/network/hostname.erb +0 -0
  119. data/lib/deprec/{templates → cap/templates}/network/hosts.erb +0 -0
  120. data/lib/deprec/{templates → cap/templates}/network/interfaces.erb +0 -0
  121. data/lib/deprec/{templates → cap/templates}/network/resolv.conf.erb +0 -0
  122. data/lib/deprec/{templates → cap/templates}/nginx/logrotate.conf.erb +0 -0
  123. data/lib/deprec/{templates → cap/templates}/nginx/mime.types.erb +0 -0
  124. data/lib/deprec/{templates → cap/templates}/nginx/nginx-init-script +0 -0
  125. data/lib/deprec/{templates → cap/templates}/nginx/nginx.conf.erb +0 -0
  126. data/lib/deprec/{templates → cap/templates}/nginx/nginx.logrotate.d +0 -0
  127. data/lib/deprec/{templates → cap/templates}/nginx/nothing.conf +0 -0
  128. data/lib/deprec/{templates → cap/templates}/nginx/rails_nginx_vhost.conf.erb +0 -0
  129. data/lib/deprec/{templates → cap/templates}/ntp/ntp.conf.erb +0 -0
  130. data/lib/deprec/{templates → cap/templates}/passenger/apache_vhost.erb +0 -0
  131. data/lib/deprec/{templates → cap/templates}/passenger/logrotate.conf.erb +0 -0
  132. data/lib/deprec/{templates → cap/templates}/passenger/passenger.conf.erb +0 -0
  133. data/lib/deprec/{templates → cap/templates}/passenger/passenger.load.erb +0 -0
  134. data/lib/deprec/{templates → cap/templates}/postfix/aliases.erb +0 -0
  135. data/lib/deprec/{templates → cap/templates}/postfix/dynamicmaps.cf.erb +0 -0
  136. data/lib/deprec/{templates → cap/templates}/postfix/main.cf.erb +0 -0
  137. data/lib/deprec/{templates → cap/templates}/postfix/master.cf.erb +0 -0
  138. data/lib/deprec/{templates → cap/templates}/ssh/ssh_config.erb +0 -0
  139. data/lib/deprec/{templates → cap/templates}/ssh/sshd_config.erb +0 -0
  140. data/lib/deprec/{templates → cap/templates}/ssl/make-ssl-cert +0 -0
  141. data/lib/deprec/{templates → cap/templates}/ssl/ssl-cert-snakeoil.key +0 -0
  142. data/lib/deprec/{templates → cap/templates}/ssl/ssl-cert-snakeoil.pem +0 -0
  143. data/lib/deprec/{templates → cap/templates}/stunnel/stunnel.conf-client +0 -0
  144. data/lib/deprec/{templates → cap/templates}/stunnel/stunnel.conf-orig +0 -0
  145. data/lib/deprec/{templates → cap/templates}/stunnel/stunnel.conf-server +0 -0
  146. data/lib/deprec/{templates → cap/templates}/stunnel/stunnel4 +0 -0
  147. data/lib/deprec/{templates → cap/templates}/stunnel/syslog-server.pem +0 -0
  148. data/lib/deprec/{templates → cap/templates}/syslog/syslog.conf.erb +0 -0
  149. data/lib/deprec/{templates → cap/templates}/syslog/syslogd.erb +0 -0
  150. data/lib/deprec/{templates → cap/templates}/syslog_ng/apache_syslog +0 -0
  151. data/lib/deprec/{templates → cap/templates}/syslog_ng/syslog-ng.conf-client +0 -0
  152. data/lib/deprec/{templates → cap/templates}/syslog_ng/syslog-ng.conf-orig +0 -0
  153. data/lib/deprec/{templates → cap/templates}/syslog_ng/syslog-ng.conf-server +0 -0
  154. data/lib/deprec/{templates → cap/templates}/xen/network-bridge-wrapper +0 -0
  155. data/lib/deprec/{templates → cap/templates}/xen/xend-config.sxp.erb +0 -0
  156. data/lib/deprec/{templates → cap/templates}/xen/xend-init.erb +0 -0
  157. data/lib/deprec/{templates → cap/templates}/xen/xendomains.erb +0 -0
  158. data/lib/deprec/{templates → cap/templates}/xentools/15-disable-hwclock +0 -0
  159. data/lib/deprec/{templates → cap/templates}/xentools/40-setup-networking +0 -0
  160. data/lib/deprec/{templates → cap/templates}/xentools/xen-tools.conf.erb +0 -0
  161. data/lib/deprec/{templates → cap/templates}/xentools/xm.tmpl.erb +0 -0
  162. data/lib/deprec_minus_rails.rb +22 -12
  163. metadata +178 -212
  164. data/lib/deprec/TODO.txt +0 -6
  165. data/lib/deprec/capistrano_extensions.rb +0 -418
  166. data/lib/deprec/recipes.rb +0 -7
  167. data/lib/deprec/recipes/ar_sendmail.rb +0 -67
  168. data/lib/deprec/recipes/chef.rb +0 -68
  169. data/lib/deprec/recipes/couchdb.rb +0 -107
  170. data/lib/deprec/recipes/ddclient.rb +0 -51
  171. data/lib/deprec/recipes/gitosis.rb +0 -55
  172. data/lib/deprec/recipes/integrity.rb +0 -108
  173. data/lib/deprec/recipes/memcache.rb +0 -49
  174. data/lib/deprec/recipes/sphinx.rb +0 -86
  175. data/lib/deprec/recipes/starling.rb +0 -119
  176. data/lib/deprec/recipes/svn.rb +0 -12
  177. data/lib/deprec/recipes/trac.rb +0 -277
  178. data/lib/deprec/recipes/vmware_tools.rb +0 -15
  179. data/lib/deprec/recipes/vnstat.rb +0 -85
  180. data/lib/deprec/recipes/wpmu.rb +0 -103
  181. data/lib/deprec/recipes_minus_rails.rb +0 -69
  182. data/lib/deprec/templates/ar_sendmail/logrotate.conf.erb +0 -9
  183. data/lib/deprec/templates/ar_sendmail/monit.conf.erb +0 -5
  184. data/lib/deprec/templates/chef/chef.json.erb +0 -1
  185. data/lib/deprec/templates/chef/solo.rb +0 -2
  186. data/lib/deprec/templates/ddclient/ddclient.conf.erb +0 -11
  187. data/lib/deprec/templates/ddclient/ddclient.erb +0 -15
  188. data/lib/deprec/templates/integrity/apache_vhost.erb +0 -4
  189. data/lib/deprec/templates/integrity/config.ru.erb +0 -21
  190. data/lib/deprec/templates/integrity/config.yml.erb +0 -43
  191. data/lib/deprec/templates/sphinx/monit.conf.erb +0 -5
  192. data/lib/deprec/templates/starling/monit.conf.erb +0 -14
  193. data/lib/deprec/templates/starling/starling-init-script.erb +0 -71
  194. data/lib/deprec/templates/subversion/svn.apache.vhost.erb +0 -43
  195. data/lib/deprec/templates/trac/apache_vhost.conf.erb +0 -24
  196. data/lib/deprec/templates/trac/nginx_vhost.conf.erb +0 -26
  197. data/lib/deprec/templates/trac/trac.ini.erb +0 -169
  198. data/lib/deprec/templates/trac/trac_deprec.png +0 -0
  199. data/lib/deprec/templates/trac/tracd-init.erb +0 -43
  200. data/lib/deprec/templates/trac/users.htdigest.erb +0 -0
  201. data/lib/deprec/templates/vnstat/config.php +0 -57
  202. data/lib/deprec/templates/wordpress/apache2_wordpress_vhost.conf.erb +0 -31
  203. data/lib/deprec/templates/wordpress/wp-config.php.erb +0 -31
  204. data/lib/deprec/templates/wpmu/apache_vhost.conf.erb +0 -13
  205. data/lib/vmbuilder_plugins/all.rb +0 -20
  206. data/lib/vmbuilder_plugins/apt.rb +0 -93
  207. data/lib/vmbuilder_plugins/emerge.rb +0 -76
  208. data/lib/vmbuilder_plugins/gem.rb +0 -90
  209. data/lib/vmbuilder_plugins/std.rb +0 -203
@@ -1,119 +0,0 @@
1
- # Deprec script to install the Starling Messaging Server
2
- # This uses the forked copy located at http://github.com/starling/starling instead of the original gem
3
- # The start/stop/restart tasks are based on code used in the 'starling.ubuntu' script which is contained in the Starling repository.
4
- Capistrano::Configuration.instance(:must_exist).load do
5
- namespace :deprec do
6
- namespace :starling do
7
- set :starling_port, 15151
8
- set :starling_address, "127.0.0.1"
9
- set :starling_user, "starling"
10
- set :starling_group, "starling"
11
- set :starling_spool_dir, "/var/spool/starling"
12
- set :starling_run_dir, "/var/run/starling"
13
- set :starling_log_dir, "/var/log/starling"
14
- set :starling_runtime_options, "-h #{starling_address} -p #{starling_port} -d -q #{starling_spool_dir} -P #{starling_spool_dir}/starling.pid -L #{starling_log_dir}/starling.log"
15
-
16
- # Installation
17
- desc "Installs the Starling gem"
18
- task :install, :roles => :app do
19
- sudo("gem install eventmachine --no-rdoc --no-ri")
20
- sudo("gem install starling-starling --source http://gems.github.com -v 0.9.9 --no-rdoc --no-ri")
21
-
22
- deprec2.mkdir(starling_spool_dir, :via => :sudo)
23
- deprec2.mkdir(starling_run_dir, :via => :sudo)
24
- deprec2.mkdir(starling_log_dir, :via => :sudo)
25
-
26
- create_starling_user_and_group
27
- set_perms_for_starling_dirs
28
- symlink_starling_for_rubyee if ruby_vm_type == :ree
29
-
30
- SYSTEM_CONFIG_FILES[:starling].each do |file|
31
- deprec2.render_template(:starling, file.merge(:remote=>true))
32
- end
33
-
34
- activate
35
- end
36
-
37
- # Configure
38
-
39
- SYSTEM_CONFIG_FILES[:starling] = [
40
- {:template => 'starling-init-script.erb',
41
- :path => '/etc/init.d/starling',
42
- :mode => 0755,
43
- :owner => 'root:root'},
44
-
45
- {:template => 'monit.conf.erb',
46
- :path => "/etc/monit.d/monit_starling.conf",
47
- :mode => 0600,
48
- :owner => 'root:root'}
49
- ]
50
-
51
- # Generating Configuration Files
52
- desc "Generate configuration file(s) for Starling from template(s)"
53
- task :config_gen do
54
- SYSTEM_CONFIG_FILES[:starling].each do |file|
55
- deprec2.render_template(:starling, file)
56
- end
57
- end
58
-
59
- desc 'Deploy configuration files(s) for Starling'
60
- task :config, :roles => :app do
61
- deprec2.push_configs(:starling, SYSTEM_CONFIG_FILES[:starling])
62
- end
63
-
64
- # Control
65
-
66
- desc "Starts the Starling server"
67
- task :start, :roles => :app do
68
- send(run_method, "start-stop-daemon -c #{starling_user}:#{starling_group} --start --quiet --pidfile #{starling_run_dir}/starling.pid --exec /usr/local/bin/starling -- #{starling_runtime_options}")
69
- end
70
-
71
- desc "Stops the Starling server"
72
- task :stop, :roles => :app do
73
- send(run_method, "start-stop-daemon -c #{starling_user}:#{starling_group} --stop --quiet --pidfile #{starling_run_dir}/starling.pid --exec /usr/local/bin/starling -- #{starling_runtime_options}")
74
- end
75
-
76
- desc "Restarts the Starling server"
77
- task :restart, :roles => :app do
78
- send(run_method, "start-stop-daemon -c #{starling_user}:#{starling_group} --stop --quiet --pidfile #{starling_run_dir}/starling.pid --exec /usr/local/bin/starling -- #{starling_runtime_options}")
79
- sleep(2)
80
- send(run_method, "start-stop-daemon -c #{starling_user}:#{starling_group} --start --quiet --pidfile #{starling_run_dir}/starling.pid --exec /usr/local/bin/starling -- #{starling_runtime_options}")
81
- end
82
-
83
- task :activate, :roles => :app do
84
- send(run_method, "update-rc.d starling defaults")
85
- end
86
-
87
- task :deactivate, :roles => :app do
88
- send(run_method, "update-rc.d -f starling remove")
89
- end
90
-
91
- # User/Group creation & permission assignment
92
- # These were based off the tasks used in the mongrel recipe -
93
- # as this was probably the nicest way to ensure these tasks
94
- # were doing the right thing.
95
- desc "create user and group for starling to run as"
96
- task :create_starling_user_and_group, :roles => :app do
97
- deprec2.groupadd(starling_group)
98
- deprec2.useradd(starling_user, :group => starling_group, :homedir => false)
99
- # Set the primary group for the starling user (in case user already existed
100
- # when previous command was run)
101
- sudo "usermod --gid #{starling_group} #{starling_user}"
102
- end
103
-
104
- desc "set group ownership and permissions on dirs starling needs to write to"
105
- task :set_perms_for_starling_dirs, :roles => :app do
106
- sudo "chgrp -R #{starling_group} #{starling_spool_dir} #{starling_run_dir} #{starling_log_dir}"
107
- sudo "chmod -R g+w #{starling_spool_dir} #{starling_run_dir} #{starling_log_dir}"
108
- end
109
-
110
- task :symlink_starling_for_rubyee, :roles => :app do
111
- # This ensures we symlink from the REE common directory, NOT the
112
- # actual REE install directory (so when we change the REE version,
113
- # we don't have to fuddle around again).
114
- sudo "ln -s #{ree_short_path}/bin/starling /usr/local/bin/starling"
115
- end
116
-
117
- end
118
- end
119
- end
@@ -1,12 +0,0 @@
1
- # Copyright 2006-2008 by Mike Bailey. All rights reserved.
2
- Capistrano::Configuration.instance(:must_exist).load do
3
- namespace :deprec do
4
- namespace :svn do
5
-
6
- desc "Install Subversion"
7
- task :install do
8
- install_deps
9
- end
10
- end
11
- end
12
- end
@@ -1,277 +0,0 @@
1
- # Copyright 2006-2008 by Mike Bailey. All rights reserved.
2
- Capistrano::Configuration.instance(:must_exist).load do
3
- namespace :deprec do namespace :trac do
4
-
5
- # Master tracd process for server
6
- set :tracd_cmd, '/usr/bin/tracd'
7
- set :tracd_port, '9000'
8
- set :tracd_pidfile, '/var/run/tracd.pid'
9
-
10
- # Settings for this projects trac instance
11
- set(:tracd_domain_root) { domain.sub(/.*?\./,'') } # strip subdomain from domain
12
- set(:tracd_vhost_domain) { "trac-#{application}.#{tracd_domain_root}" } # nginx will proxy this domain to tracd
13
-
14
- set(:trac_backup_dir) { "#{backup_dir}/trac" }
15
- set(:trac_path) { exists?(:deploy_to) ? "#{deploy_to}/trac" : Capistrano::CLI.ui.ask('path to trac config') }
16
- set(:tracd_parent_dir) { "/etc/trac.d" }
17
- set(:trac_password_file) { "#{trac_path}/conf/users.htdigest" }
18
- set(:trac_account) { Capistrano::CLI.prompt('enter new trac user account name') }
19
- set :trac_passwordfile_exists, true # hack - should check on remote system instead
20
- set(:trac_header_logo_link) { trac_home_url }
21
- # We will symlink each projects trac dir into this dir for tracd to find
22
-
23
- # project
24
- set(:trac_domain) { domain.sub(/^.*?\./, 'trac.') }
25
- set(:trac_home_url) { "http://#{trac_domain}/" }
26
- set(:trac_desc) { application }
27
-
28
- # Settings only used for generating trac.ini for this project
29
- # - notification
30
- set :trac_always_notify_owner, false
31
- set :trac_always_notify_reporter, false
32
- set :trac_always_notify_updater, true
33
- set :trac_smtp_always_bcc, ''
34
- set :trac_smtp_always_cc, ''
35
- set :trac_smtp_default_domain, ''
36
- set :trac_smtp_enabled, true
37
- set :trac_smtp_from, 'trac@localhost'
38
- set :trac_smtp_password, ''
39
- set :trac_smtp_port, 25
40
- set :trac_smtp_replyto, 'trac@localhost'
41
- set :trac_smtp_server, 'localhost'
42
- set :trac_smtp_subject_prefix, '__default__'
43
- set :trac_smtp_user, ''
44
- set :trac_use_public_cc, false
45
- set :trac_use_short_addr, false
46
- set :trac_use_tls, false
47
- # - other
48
- set(:trac_base_url) { trac_home_url }
49
-
50
- desc "Install trac on server"
51
- task :install, :roles => :scm do
52
- install_deps
53
- sudo "easy_install Trac==0.11rc1"
54
- create_pid_dir
55
- create_parent_dir
56
- config_gen_system
57
- config_system
58
- activate_system
59
- end
60
-
61
- task :install_deps do
62
- apt.install( {:base => %w(sqlite3 python-setuptools python-subversion)}, :stable )
63
- end
64
-
65
- # The start script has a couple of config values in it.
66
- # We may want to extract them into a config file later
67
- # and install this script as part of the :install task.
68
- SYSTEM_CONFIG_FILES[:trac] = [
69
- {:template => 'tracd-init.erb',
70
- :path => '/etc/init.d/tracd',
71
- :mode => 0755,
72
- :owner => 'root:root'}
73
- ]
74
-
75
- PROJECT_CONFIG_FILES[:trac] = [
76
- {:template => 'users.htdigest.erb',
77
- :path => "conf/users.htdigest",
78
- :mode => 0644,
79
- :owner => 'root:root'},
80
-
81
- {:template => 'trac.ini.erb',
82
- :path => "conf/trac.ini",
83
- :mode => 0644,
84
- :owner => 'root:root'},
85
-
86
- {:template => 'nginx_vhost.conf.erb',
87
- :path => "conf/nginx_vhost.conf",
88
- :mode => 0644,
89
- :owner => 'root:root'}
90
- ]
91
-
92
- desc "Generate config files for trac"
93
- task :config_gen do
94
- config_gen_system
95
- config_gen_project
96
- end
97
-
98
- task :config_gen_system do
99
- SYSTEM_CONFIG_FILES[:trac].each do |file|
100
- deprec2.render_template(:trac, file)
101
- end
102
- end
103
-
104
- task :config_gen_project do
105
- PROJECT_CONFIG_FILES[:trac].each do |file|
106
- deprec2.render_template(:trac, file)
107
- end
108
- end
109
-
110
- desc "Push trac config files to server"
111
- task :config, :roles => :scm do
112
- config_system
113
- config_project
114
- restart
115
- top.deprec.nginx.restart
116
- end
117
-
118
- task :config_system, :roles => :scm do
119
- deprec2.push_configs(:trac, SYSTEM_CONFIG_FILES[:trac])
120
- end
121
-
122
- task :config_project, :roles => :scm do
123
- deprec2.push_configs(:trac, PROJECT_CONFIG_FILES[:trac])
124
- symlink_nginx_vhost
125
- end
126
-
127
- desc "Initialize the trac db for this project"
128
- task :setup, :roles => :scm do
129
- init
130
- config_gen_project
131
- config_project
132
- activate_project
133
- # set_default_permissions # XXX re-enable this
134
- # create trac account for current user
135
- set :trac_account, user
136
- set :trac_passwordfile_exists, false # hack - should check on remote system instead
137
- # user_add # XXX re-enable
138
- end
139
-
140
- task :init, :roles => :scm do
141
- deprec2.mkdir(trac_path, :via => :sudo)
142
- sudo "trac-admin #{trac_path} initenv #{application} sqlite:db/trac.db svn #{repos_root}"
143
- end
144
-
145
- task :set_default_permissions, :roles => :scm do
146
- anonymous_disable
147
- authenticated_enable
148
- end
149
-
150
- task :start, :roles => :scm do
151
- sudo "/etc/init.d/tracd start"
152
- end
153
-
154
- task :stop, :roles => :scm do
155
- sudo "/etc/init.d/tracd stop"
156
- end
157
-
158
- task :restart, :roles => :scm do
159
- stop
160
- start
161
- end
162
-
163
- task :activate, :roles => :scm do
164
- activate_system
165
- activate_project
166
- end
167
-
168
- task :activate_system, :roles => :scm do
169
- sudo "update-rc.d tracd defaults"
170
- end
171
-
172
- task :activate_project, :roles => :scm do
173
- symlink_project
174
- end
175
-
176
- task :deactivate, :roles => :scm do
177
- deactivate_system
178
- deactivate_project
179
- end
180
-
181
- task :deactivate_system, :roles => :scm do
182
- sudo "update-rc.d -f tracd remove"
183
- end
184
-
185
- task :deactivate_project, :roles => :scm do
186
- unlink_project
187
- unlink_nginx_vhost
188
- restart
189
- end
190
-
191
- desc "Create backup of trac repository"
192
- task :backup, :roles => :web do
193
- # http://trac.edgewall.org/wiki/TracBackup
194
- timestamp = Time.now.utc.strftime("%Y%m%d%H%M%S")
195
- dest_dir = File.join(trac_backup_dir, "trac_#{application}_#{timestamp}")
196
- sudo "trac-admin #{trac_path} hotcopy #{dest_dir}"
197
- end
198
-
199
- desc "Restore trac repository from backup"
200
- task :restore, :roles => :web do
201
- # prompt user to select from list of locally stored backups
202
- # tracd_stop
203
- # copy out backup
204
- end
205
-
206
- #
207
- # Service specific tasks for end users
208
- #
209
- desc "create a trac user"
210
- task :user_add, :roles => :scm do
211
- create_file = trac_passwordfile_exists ? '' : ' -c '
212
- htdigest = '/usr/local/apache2/bin/htdigest'
213
- # XXX check if htdigest file exists and add '-c' option if not
214
- # sudo "test -f #{trac_path/conf/users.htdigest}
215
- create_file = trac_passwordfile_exists ? '' : ' -c '
216
- deprec2.sudo_with_input("#{htdigest} #{create_file} #{trac_path}/conf/users.htdigest #{application} #{trac_account}", /password:/)
217
- end
218
-
219
- desc "list trac users"
220
- task :list_users, :roles => :scm do
221
- sudo "cat #{trac_path}/conf/users.htdigest"
222
- end
223
-
224
- # desc "disable anonymous access to everything"
225
- task :anonymous_disable, :roles => :scm do
226
- sudo "trac-admin #{trac_path} permission remove anonymous '*'"
227
- end
228
-
229
- # desc "enable authenticated users access to everything"
230
- task :authenticated_enable, :roles => :scm do
231
- sudo "trac-admin #{trac_path} permission add authenticated TRAC_ADMIN"
232
- end
233
-
234
- #
235
- # Helper tasks used by other tasks
236
- #
237
-
238
- # Link the trac repos for this project into the master trac repos dir
239
- # We do this so we can use trac for multiple projects on the same server
240
- task :symlink_project, :roles => :scm do
241
- sudo "ln -sf #{trac_path} #{tracd_parent_dir}/#{application}"
242
- end
243
-
244
- task :unlink_project, :roles => :scm do
245
- link = "#{tracd_parent_dir}/#{application}"
246
- sudo "test -h #{link} && sudo unlink #{link} || true"
247
- end
248
-
249
- task :symlink_nginx_vhost, :roles => :scm do
250
- sudo "ln -sf #{deploy_to}/trac/conf/nginx_vhost.conf #{nginx_vhost_dir}/tracd-#{application}.conf"
251
- end
252
-
253
- task :unlink_nginx_vhost, :roles => :scm do
254
- link = "#{nginx_vhost_dir}/tracd-#{application}.conf"
255
- sudo "test -h #{link} && unlink #{link} || true"
256
- end
257
-
258
- # task :symlink_apache_vhost, :roles => :scm do
259
- # sudo "ln -sf #{deploy_to}/trac/conf/trac_apache_vhost.conf #{apache_vhost_dir}/#{application}-trac.conf"
260
- # end
261
- #
262
- # task :unlink_apache_vhost, :roles => :scm do
263
- # link = "#{apache_vhost_dir}/#{application}-trac.conf"
264
- # sudo "test -h #{link} && unlink #{link} || true"
265
- # end
266
-
267
- task :create_pid_dir, :roles => :scm do
268
- deprec2.mkdir(File.dirname(tracd_pidfile))
269
- end
270
-
271
- task :create_parent_dir, :roles => :scm do
272
- deprec2.mkdir(tracd_parent_dir, :via => :sudo)
273
- end
274
-
275
- end end
276
-
277
- end
@@ -1,15 +0,0 @@
1
- # Copyright 2006-2008 by Mike Bailey. All rights reserved.
2
- Capistrano::Configuration.instance(:must_exist).load do
3
- namespace :deprec do
4
- namespace :vmware_tools do
5
-
6
- desc "Install VMware tools on guest"
7
- task :install do
8
- run "#{sudo} mount /dev/cdrom /mnt"
9
- run "tar zxfv /mnt/VMwareTools-*.tar.gz"
10
- run "#{sudo} ./vmware-tools-distrib/vmware-install.pl --default"
11
- end
12
-
13
- end
14
- end
15
- end
@@ -1,85 +0,0 @@
1
- # Copyright 2006-2008 by Mike Bailey. All rights reserved.
2
- Capistrano::Configuration.instance(:must_exist).load do
3
-
4
- namespace :deprec do
5
- namespace :vnstat do
6
-
7
- desc <<-EOF
8
- vnstat description
9
- EOF
10
- task :default do
11
- end
12
-
13
- SRC_PACKAGES[:vnstat] = {
14
- :url => "http://humdi.net/vnstat/vnstat-1.6.tar.gz",
15
- :md5sum => "ccaffe8e70d47e0cf2f25e52daa25712 vnstat-1.6.tar.gz",
16
- :configure => '',
17
- :post_install => 'vnstat --testkernel && vnstat -u -i eth0'
18
- }
19
-
20
- desc <<-EOF
21
- Install vnstat. Add interfaces with 'vnstat -u -i ethN'
22
- (where N is interface number).
23
-
24
- View stats using the vnstat command line tool.
25
- EOF
26
- task :install do
27
- install_deps
28
- deprec2.download_src(SRC_PACKAGES[:vnstat], src_dir)
29
- deprec2.install_from_src(SRC_PACKAGES[:vnstat], src_dir)
30
- end
31
-
32
- # install dependencies for monit
33
- task :install_deps do
34
- # apt.install( {:base => %w(flex bison libssl-dev)}, :stable )
35
- end
36
-
37
- end
38
-
39
-
40
- namespace :vnstat_php do
41
-
42
- SRC_PACKAGES[:vnstat_php] = {
43
- :url => "http://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.3.tar.gz",
44
- :md5sum => "190b37808ae16bd1c1a132434b170437 vnstat_php_frontend-1.3.tar.gz",
45
- :configure => '',
46
- :make => '',
47
- :install => "test -d /var/www/vnstat_php_frontend-1.3 && rm -fr /var/www/vnstat_php_frontend-1.3; mv #{src_dir}/vnstat_php_frontend-1.3 /var/www &&
48
- ln -sf /var/www/vnstat_php_frontend-1.3 /var/www/vnstat"
49
- }
50
-
51
- task :install do
52
- install_deps
53
- deprec2.download_src(SRC_PACKAGES[:vnstat_php], src_dir)
54
- deprec2.install_from_src(SRC_PACKAGES[:vnstat_php], src_dir)
55
- end
56
-
57
- # install dependencies for monit
58
- task :install_deps do
59
- apt.install( {:base => %w(apache2 php5 php5-gd)}, :stable )
60
- end
61
-
62
- SYSTEM_CONFIG_FILES[:vnstat] = [
63
-
64
- {:template => 'config.php',
65
- :path => '/var/www/vnstat',
66
- :mode => 0755,
67
- :owner => 'root:root'}
68
-
69
- ]
70
-
71
- task :config_gen do
72
- SYSTEM_CONFIG_FILES[:vnstat].each do |file|
73
- deprec2.render_template(:vnstat, file)
74
- end
75
- end
76
-
77
- desc "Push monit config files to server"
78
- task :config do
79
- deprec2.push_configs(:vnstat, SYSTEM_CONFIG_FILES[:vnstat])
80
- end
81
-
82
- end
83
-
84
- end
85
- end