andyh-deprec 1.99.26 → 1.99.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +28 -1
- data/lib/deprec/capistrano_extensions.rb +57 -17
- data/lib/deprec/recipes.rb +2 -0
- data/lib/deprec/recipes/aoe.rb +35 -36
- data/lib/deprec/recipes/ar_sendmail.rb +5 -3
- data/lib/deprec/recipes/git.rb +3 -3
- data/lib/deprec/recipes/mongrel.rb +6 -6
- data/lib/deprec/recipes/mysql.rb +9 -9
- data/lib/deprec/recipes/nginx.rb +12 -12
- data/lib/deprec/recipes/php.rb +4 -12
- data/lib/deprec/recipes/postfix.rb +14 -5
- data/lib/deprec/recipes/rails.rb +12 -18
- data/lib/deprec/recipes/ruby.rb +8 -6
- data/lib/deprec/recipes/sphinx.rb +4 -1
- data/lib/deprec/recipes/utils.rb +1 -2
- data/lib/deprec/recipes/xen.rb +8 -8
- data/lib/deprec/templates/mongrel/logrotate.conf.erb +1 -1
- data/lib/deprec/templates/postfix/main.cf.erb +6 -11
- metadata +2 -2
data/CHANGELOG
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
|
-
==
|
|
1
|
+
== git
|
|
2
2
|
|
|
3
|
+
* Restricted tasks to roles. [mbailey]
|
|
4
|
+
http://github.com/mbailey/deprec/commit/d103dda7ee3f7696007d230c76c7739dd57115ec
|
|
5
|
+
|
|
6
|
+
* Extend capistrano_extensions.rb to allow install from git sources. [jasherai]
|
|
7
|
+
|
|
8
|
+
* Updated git to 1.6.0.1 [thornysun]
|
|
9
|
+
|
|
10
|
+
== 1.99.27 (August 27, 2008)
|
|
11
|
+
|
|
12
|
+
* Bugfix: Add configure and make options to src_package for rubygems to
|
|
13
|
+
override defaults. [jasherai]
|
|
14
|
+
|
|
15
|
+
* Change: We now setup postfix as a satellite mail server. This is designed
|
|
16
|
+
to listen only on the local network interface and non-local mail to a relay
|
|
17
|
+
host. [mbailey]
|
|
18
|
+
|
|
19
|
+
== 1.99.26 (August 22, 2008)
|
|
20
|
+
|
|
21
|
+
* added vnstat recipes - measure and report traffic on interface counters [mbailey]
|
|
22
|
+
* upgrade ruby to 1.8.6-p287 [Isaac Kearse]
|
|
23
|
+
* upgrade to rubygems 1.2.0 - addresses memory utilization issues on
|
|
24
|
+
low-memory boxes (half-gig or less) [thewoolleyman]
|
|
25
|
+
* deprec:rails:install_stack now installs mysql [mbailey]
|
|
26
|
+
* turned tcp_nopush back on [mbailey]
|
|
27
|
+
* Correctly handle tarballs with .tgz extension [mbailey]
|
|
28
|
+
* Generate default remote config on install [mbailey]
|
|
29
|
+
|
|
3
30
|
== 1.99.24 (July 7, 2008)
|
|
4
31
|
|
|
5
32
|
* I've rejigged things to make it easier to install a service without having
|
|
@@ -4,12 +4,24 @@ require 'fileutils'
|
|
|
4
4
|
|
|
5
5
|
module Deprec2
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# Temporarily modify ROLES if HOSTS not set
|
|
8
|
+
# Capistrano's default behaviour is for HOSTS to override ROLES
|
|
8
9
|
def for_roles(roles)
|
|
9
10
|
old_roles = ENV['ROLES']
|
|
10
|
-
ENV['ROLES'] = roles
|
|
11
|
+
ENV['ROLES'] = roles.to_s unless ENV['HOSTS']
|
|
12
|
+
yield
|
|
13
|
+
ENV['ROLES'] = old_roles.to_s unless ENV['HOSTS']
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Temporarily ignore ROLES and HOSTS
|
|
17
|
+
def ignoring_roles_and_hosts
|
|
18
|
+
old_roles = ENV['ROLES']
|
|
19
|
+
old_hosts = ENV['HOSTS']
|
|
20
|
+
ENV['ROLES'] = nil
|
|
21
|
+
ENV['HOSTS'] = nil
|
|
11
22
|
yield
|
|
12
23
|
ENV['ROLES'] = old_roles
|
|
24
|
+
ENV['HOSTS'] = old_hosts
|
|
13
25
|
end
|
|
14
26
|
|
|
15
27
|
DEPREC_TEMPLATES_BASE = File.join(File.dirname(__FILE__), 'templates')
|
|
@@ -242,35 +254,63 @@ module Deprec2
|
|
|
242
254
|
if defined?(src_package[:md5sum])
|
|
243
255
|
md5_clause = " && echo '#{src_package[:md5sum]}' | md5sum -c - "
|
|
244
256
|
end
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
257
|
+
case src_package[:download_method]
|
|
258
|
+
# when getting source with git
|
|
259
|
+
when :git
|
|
260
|
+
# ensure git is installed
|
|
261
|
+
apt.install( {:base => %w(git-core)}, :stable) #TODO fix this to test ubuntu version <hardy might need specific git version for full git submodules support
|
|
262
|
+
package_dir = File.join(src_dir, src_package[:dir])
|
|
263
|
+
run "if [ -d #{package_dir} ]; then cd #{package_dir} && #{sudo} git pull && #{sudo} git submodule init && #{sudo} git submodule update; else #{sudo} git clone #{src_package[:url]} #{package_dir} && cd #{package_dir} && #{sudo} git submodule init && #{sudo} git submodule update ; fi"
|
|
264
|
+
# Checkout the revision wanted if defined
|
|
265
|
+
invoke_command "cd #{package_dir} && git co #{src_package[:version]}", :via => :via if src_package[:version]
|
|
266
|
+
# when getting source with wget
|
|
267
|
+
when :http
|
|
268
|
+
# ensure wget is installed
|
|
269
|
+
apt.install( {:base => %w(wget)}, :stable )
|
|
270
|
+
# XXX replace with invoke_command
|
|
271
|
+
run "cd #{src_dir} && test -f #{src_package[:filename]} #{md5_clause} || #{sudo} wget --quiet --timestamping #{src_package[:url]}"
|
|
272
|
+
else
|
|
273
|
+
puts "DOWNLOAD SRC: Download method not recognised. src_package[:download_method]: #{src_package[:download_method]}"
|
|
274
|
+
end
|
|
248
275
|
end
|
|
249
276
|
|
|
250
277
|
# unpack src and make it writable by the group
|
|
251
278
|
def unpack_src(src_package, src_dir)
|
|
252
279
|
set_package_defaults(src_package)
|
|
253
280
|
package_dir = File.join(src_dir, src_package[:dir])
|
|
254
|
-
|
|
281
|
+
case src_package[:download_method]
|
|
282
|
+
# when unpacking git sources - nothing to do
|
|
283
|
+
when :git
|
|
284
|
+
puts "UNPACK SRC: nothing to do for git installs"
|
|
285
|
+
when :http
|
|
286
|
+
sudo <<-EOF
|
|
287
|
+
bash -c '
|
|
288
|
+
cd #{src_dir};
|
|
289
|
+
test -d #{package_dir}.old && rm -fr #{package_dir}.old;
|
|
290
|
+
test -d #{package_dir} && mv #{package_dir} #{package_dir}.old;
|
|
291
|
+
#{src_package[:unpack]}
|
|
292
|
+
'
|
|
293
|
+
EOF
|
|
294
|
+
else
|
|
295
|
+
puts "UNPACK SRC: Download method not recognised. src_package[:download_method]: #{src_package[:download_method]} "
|
|
296
|
+
end
|
|
255
297
|
sudo <<-EOF
|
|
256
298
|
bash -c '
|
|
257
299
|
cd #{src_dir};
|
|
258
|
-
test -d #{package_dir}.old && rm -fr #{package_dir}.old;
|
|
259
|
-
test -d #{package_dir} && mv #{package_dir} #{package_dir}.old;
|
|
260
|
-
#{src_package[:unpack]}
|
|
261
300
|
chgrp -R #{group} #{package_dir};
|
|
262
301
|
chmod -R g+w #{package_dir};
|
|
263
302
|
'
|
|
264
303
|
EOF
|
|
265
304
|
end
|
|
266
|
-
|
|
305
|
+
|
|
267
306
|
def set_package_defaults(pkg)
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
307
|
+
pkg[:filename] ||= File.basename(pkg[:url])
|
|
308
|
+
pkg[:dir] ||= pkg[:filename].sub(/(\.tgz|\.tar\.gz)/,'')
|
|
309
|
+
pkg[:download_method] ||= :http
|
|
310
|
+
pkg[:unpack] ||= "tar zxf #{pkg[:filename]};"
|
|
311
|
+
pkg[:configure] ||= './configure ;'
|
|
312
|
+
pkg[:make] ||= 'make;'
|
|
313
|
+
pkg[:install] ||= 'make install;'
|
|
274
314
|
end
|
|
275
315
|
|
|
276
316
|
# install package from source
|
|
@@ -388,4 +428,4 @@ module Deprec2
|
|
|
388
428
|
|
|
389
429
|
end
|
|
390
430
|
|
|
391
|
-
Capistrano.plugin :deprec2, Deprec2
|
|
431
|
+
Capistrano.plugin :deprec2, Deprec2
|
data/lib/deprec/recipes.rb
CHANGED
|
@@ -32,6 +32,8 @@ require "#{File.dirname(__FILE__)}/recipes/sphinx"
|
|
|
32
32
|
require "#{File.dirname(__FILE__)}/recipes/logrotate"
|
|
33
33
|
require "#{File.dirname(__FILE__)}/recipes/utils"
|
|
34
34
|
require "#{File.dirname(__FILE__)}/recipes/git"
|
|
35
|
+
require "#{File.dirname(__FILE__)}/recipes/apt_mirror"
|
|
35
36
|
# require "#{File.dirname(__FILE__)}/recipes/pdns"
|
|
36
37
|
require "#{File.dirname(__FILE__)}/recipes/gitosis"
|
|
38
|
+
require "#{File.dirname(__FILE__)}/recipes/wordpress"
|
|
37
39
|
require "#{File.dirname(__FILE__)}/recipes/ar_sendmail"
|
data/lib/deprec/recipes/aoe.rb
CHANGED
|
@@ -2,75 +2,74 @@
|
|
|
2
2
|
Capistrano::Configuration.instance(:must_exist).load do
|
|
3
3
|
|
|
4
4
|
SRC_PACKAGES[:aoe] = {
|
|
5
|
-
:
|
|
6
|
-
:md5sum => "
|
|
7
|
-
:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
:
|
|
5
|
+
:url => "http://support.coraid.com/support/linux/aoe6-64.tar.gz",
|
|
6
|
+
:md5sum => "c5e1ebb734e3b29c0a3d886a700ca44a aoe6-64.tar.gz",
|
|
7
|
+
:configure => ''
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
SRC_PACKAGES[:cec] = {
|
|
11
|
+
:url => "http://easynews.dl.sourceforge.net/sourceforge/aoetools/cec-8.tgz",
|
|
12
|
+
:md5sum => "7899dc549f9a368e532f9c39ed819f71 cec-8.tgz",
|
|
13
|
+
:configure => '',
|
|
14
|
+
:install => "test -f /usr/sbin/cec && rm /usr/sbin/cec; make install;"
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
SRC_PACKAGES[:ddt] = {
|
|
18
|
+
:url => "http://support.coraid.com/support/sr/ddt-8.tgz",
|
|
19
|
+
:md5sum => "256a58aba5e05f9995fb9de6aadadf92 ddt-8.tgz"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
SRC_PACKAGES[:aoemask] = {
|
|
23
|
+
:url => "http://support.coraid.com/support/sr/aoemask-1.tgz",
|
|
24
|
+
:md5sum => "379461a28d511e269f4593b846bd1288 aoemask-1.tgz"
|
|
12
25
|
}
|
|
13
26
|
|
|
14
27
|
namespace :deprec do
|
|
15
28
|
namespace :aoe do
|
|
16
|
-
|
|
29
|
+
|
|
17
30
|
desc "Install aoe drivers required to mount Coraid block devices"
|
|
18
|
-
task :install do
|
|
31
|
+
task :install, :roles => :aoe do
|
|
19
32
|
install_deps
|
|
20
33
|
deprec2.download_src(SRC_PACKAGES[:aoe], src_dir)
|
|
21
34
|
deprec2.install_from_src(SRC_PACKAGES[:aoe], src_dir)
|
|
22
35
|
end
|
|
23
36
|
|
|
24
|
-
task :install_deps do
|
|
37
|
+
task :install_deps, :roles => :aoe do
|
|
25
38
|
apt.install( {:base => %w(build-essential linux-headers-$(uname -r) vblade aoetools)}, :stable )
|
|
26
39
|
end
|
|
27
|
-
|
|
40
|
+
|
|
41
|
+
desc "Install all AoE related software"
|
|
42
|
+
task :install_all, :roles => :aoe do
|
|
43
|
+
top.deprec.aoe.install
|
|
44
|
+
top.deprec.cec.install
|
|
45
|
+
top.deprec.ddt.install
|
|
46
|
+
top.deprec.aoemask.install
|
|
47
|
+
end
|
|
48
|
+
|
|
28
49
|
end
|
|
29
50
|
|
|
30
|
-
|
|
31
|
-
SRC_PACKAGES[:cec] = {
|
|
32
|
-
:url => "http://easynews.dl.sourceforge.net/sourceforge/aoetools/cec-8.tgz",
|
|
33
|
-
:md5sum => "7899dc549f9a368e532f9c39ed819f71 cec-8.tgz"
|
|
34
|
-
}
|
|
35
|
-
|
|
36
51
|
namespace :cec do
|
|
37
|
-
|
|
38
52
|
desc "install CEC (Coraid Ethernet Console)"
|
|
39
|
-
task :install do
|
|
53
|
+
task :install, :roles => :aoe do
|
|
40
54
|
deprec2.download_src(SRC_PACKAGES[:cec], src_dir)
|
|
41
55
|
deprec2.install_from_src(SRC_PACKAGES[:cec], src_dir)
|
|
42
56
|
end
|
|
43
|
-
|
|
44
57
|
end
|
|
45
58
|
|
|
46
|
-
SRC_PACKAGES[:ddt] = {
|
|
47
|
-
:url => "http://support.coraid.com/support/sr/ddt-6.tgz",
|
|
48
|
-
:md5sum => "5e1e8a58a8621b93440be605113f7bc0 ddt-6.tgz"
|
|
49
|
-
}
|
|
50
|
-
|
|
51
59
|
namespace :ddt do
|
|
52
|
-
|
|
53
60
|
desc "install DDT (tool for testing performance)"
|
|
54
|
-
task :install do
|
|
61
|
+
task :install, :roles => :aoe do
|
|
55
62
|
deprec2.download_src(SRC_PACKAGES[:ddt], src_dir)
|
|
56
63
|
deprec2.install_from_src(SRC_PACKAGES[:ddt], src_dir)
|
|
57
64
|
end
|
|
58
|
-
|
|
59
65
|
end
|
|
60
66
|
|
|
61
|
-
SRC_PACKAGES[:aoemask] = {
|
|
62
|
-
:url => "http://support.coraid.com/support/sr/aoemask-1.tgz",
|
|
63
|
-
:md5sum => "379461a28d511e269f4593b846bd1288 aoemask-1.tgz"
|
|
64
|
-
}
|
|
65
|
-
|
|
66
67
|
namespace :aoemask do
|
|
67
|
-
|
|
68
68
|
desc "install aoemask"
|
|
69
|
-
task :install do
|
|
69
|
+
task :install, :roles => :aoe do
|
|
70
70
|
deprec2.download_src(SRC_PACKAGES[:aoemask], src_dir)
|
|
71
71
|
deprec2.install_from_src(SRC_PACKAGES[:aoemask], src_dir)
|
|
72
72
|
end
|
|
73
|
-
|
|
74
73
|
end
|
|
75
74
|
|
|
76
75
|
end
|
|
@@ -4,12 +4,12 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
4
4
|
namespace :ar_sendmail do
|
|
5
5
|
|
|
6
6
|
desc "Install ar_mailer"
|
|
7
|
-
task :install do
|
|
7
|
+
task :install, :roles => :app do
|
|
8
8
|
gem2.install 'ar_mailer'
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
# install dependencies for
|
|
12
|
-
task :install_deps do
|
|
11
|
+
# install dependencies for ar_sendmail
|
|
12
|
+
task :install_deps, :roles => :app do
|
|
13
13
|
#pass
|
|
14
14
|
end
|
|
15
15
|
|
|
@@ -30,12 +30,14 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
30
30
|
config_gen_project
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
+
desc "Generate configuration file(s) for ar_sendmail from template(s)"
|
|
33
34
|
task :config_gen_project do
|
|
34
35
|
PROJECT_CONFIG_FILES[:ar_sendmail].each do |file|
|
|
35
36
|
deprec2.render_template(:ar_sendmail, file)
|
|
36
37
|
end
|
|
37
38
|
end
|
|
38
39
|
|
|
40
|
+
desc "Push ar_sendmail config files to server"
|
|
39
41
|
task :config, :roles => :app do
|
|
40
42
|
config_project
|
|
41
43
|
end
|
data/lib/deprec/recipes/git.rb
CHANGED
|
@@ -10,8 +10,8 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
10
10
|
set :git_root, '/var/git'
|
|
11
11
|
|
|
12
12
|
SRC_PACKAGES[:git] = {
|
|
13
|
-
:url => "http://kernel.org/pub/software/scm/git/git-1.
|
|
14
|
-
:md5sum => "
|
|
13
|
+
:url => "http://kernel.org/pub/software/scm/git/git-1.6.0.1.tar.gz",
|
|
14
|
+
:md5sum => "7096bac44acbb73f916d3089aa3fdee6 git-1.6.0.1.tar.gz"
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
desc "Install git"
|
|
@@ -94,4 +94,4 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
94
94
|
|
|
95
95
|
end
|
|
96
96
|
end
|
|
97
|
-
end
|
|
97
|
+
end
|
|
@@ -21,7 +21,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
21
21
|
# Install
|
|
22
22
|
|
|
23
23
|
desc "Install mongrel"
|
|
24
|
-
task :install do
|
|
24
|
+
task :install, :roles => :app do
|
|
25
25
|
gem2.install 'mongrel'
|
|
26
26
|
gem2.install 'mongrel_cluster'
|
|
27
27
|
gem2.install 'swiftiply'
|
|
@@ -32,11 +32,11 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
32
32
|
activate_system
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
task :symlink_mongrel_rails do
|
|
35
|
+
task :symlink_mongrel_rails, :roles => :app do
|
|
36
36
|
sudo "ln -sf /usr/local/bin/mongrel_rails /usr/bin/mongrel_rails"
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
-
task :symlink_logrotate_config do
|
|
39
|
+
task :symlink_logrotate_config, :roles => :app do
|
|
40
40
|
sudo "ln -sf #{deploy_to}/mongrel/logrotate.conf /etc/logrotate.d/mongrel-#{application}"
|
|
41
41
|
end
|
|
42
42
|
|
|
@@ -142,16 +142,16 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
142
142
|
send(run_method, "mongrel_rails cluster::restart --clean -C #{mongrel_conf}")
|
|
143
143
|
end
|
|
144
144
|
|
|
145
|
-
task :activate
|
|
145
|
+
task :activate do
|
|
146
146
|
activate_system
|
|
147
147
|
activate_project
|
|
148
148
|
end
|
|
149
149
|
|
|
150
|
-
task :activate_system
|
|
150
|
+
task :activate_system do
|
|
151
151
|
send(run_method, "update-rc.d mongrel_cluster defaults")
|
|
152
152
|
end
|
|
153
153
|
|
|
154
|
-
task :activate_project
|
|
154
|
+
task :activate_project do
|
|
155
155
|
symlink_mongrel_cluster
|
|
156
156
|
symlink_monit_config
|
|
157
157
|
end
|
data/lib/deprec/recipes/mysql.rb
CHANGED
|
@@ -6,22 +6,22 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
6
6
|
# Installation
|
|
7
7
|
|
|
8
8
|
desc "Install mysql"
|
|
9
|
-
task :install do
|
|
9
|
+
task :install, :roles => :db do
|
|
10
10
|
install_deps
|
|
11
|
-
symlink_mysql_sockfile # XXX still needed?
|
|
11
|
+
# symlink_mysql_sockfile # XXX still needed?
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
# Install dependencies for Mysql
|
|
15
|
-
task :install_deps do
|
|
15
|
+
task :install_deps, :roles => :db do
|
|
16
16
|
apt.install( {:base => %w(mysql-server mysql-client)}, :stable )
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
task :symlink_mysql_sockfile, :roles => :db do
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
end
|
|
19
|
+
# task :symlink_mysql_sockfile, :roles => :db do
|
|
20
|
+
# # rails puts "socket: /tmp/mysql.sock" into config/database.yml
|
|
21
|
+
# # this is not the location for our ubuntu's mysql socket file
|
|
22
|
+
# # so we create this link to make deployment using rails defaults simpler
|
|
23
|
+
# sudo "ln -sf /var/run/mysqld/mysqld.sock /tmp/mysql.sock"
|
|
24
|
+
# end
|
|
25
25
|
|
|
26
26
|
# Configuration
|
|
27
27
|
|
data/lib/deprec/recipes/nginx.rb
CHANGED
|
@@ -17,7 +17,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
desc "Install nginx"
|
|
20
|
-
task :install do
|
|
20
|
+
task :install, :roles => :web do
|
|
21
21
|
install_deps
|
|
22
22
|
deprec2.download_src(SRC_PACKAGES[:nginx], src_dir)
|
|
23
23
|
deprec2.install_from_src(SRC_PACKAGES[:nginx], src_dir)
|
|
@@ -30,20 +30,15 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
# install dependencies for nginx
|
|
33
|
-
task :install_deps do
|
|
33
|
+
task :install_deps, :roles => :web do
|
|
34
34
|
apt.install( {:base => %w(libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev)}, :stable )
|
|
35
35
|
# do we need libgcrypt11-dev?
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
-
task :create_nginx_user do
|
|
38
|
+
task :create_nginx_user, :roles => :web do
|
|
39
39
|
deprec2.groupadd(nginx_group)
|
|
40
40
|
deprec2.useradd(nginx_user, :group => nginx_group, :homedir => false)
|
|
41
41
|
end
|
|
42
|
-
|
|
43
|
-
task :rename_index_page, :roles => :web do
|
|
44
|
-
index_file = '/usr/local/nginx/html/index.html'
|
|
45
|
-
sudo "test -f #{index_file} && sudo mv #{index_file} #{index_file}.orig || exit 0"
|
|
46
|
-
end
|
|
47
42
|
|
|
48
43
|
SYSTEM_CONFIG_FILES[:nginx] = [
|
|
49
44
|
|
|
@@ -89,11 +84,11 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
89
84
|
Activate nginx start scripts on server.
|
|
90
85
|
Setup server to start nginx on boot.
|
|
91
86
|
DESC
|
|
92
|
-
task :activate do
|
|
87
|
+
task :activate, :roles => :web do
|
|
93
88
|
activate_system
|
|
94
89
|
end
|
|
95
90
|
|
|
96
|
-
task :activate_system do
|
|
91
|
+
task :activate_system, :roles => :web do
|
|
97
92
|
send(run_method, "update-rc.d nginx defaults")
|
|
98
93
|
end
|
|
99
94
|
|
|
@@ -101,11 +96,10 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
101
96
|
Dectivate nginx start scripts on server.
|
|
102
97
|
Setup server to start nginx on boot.
|
|
103
98
|
DESC
|
|
104
|
-
task :deactivate do
|
|
99
|
+
task :deactivate, :roles => :web do
|
|
105
100
|
send(run_method, "update-rc.d -f nginx remove")
|
|
106
101
|
end
|
|
107
102
|
|
|
108
|
-
|
|
109
103
|
# Control
|
|
110
104
|
|
|
111
105
|
desc "Start Nginx"
|
|
@@ -138,6 +132,12 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
138
132
|
task :restore, :roles => :web do
|
|
139
133
|
# there's nothing to store for nginx
|
|
140
134
|
end
|
|
135
|
+
|
|
136
|
+
# Helper task to get rid of pesky "it works" page - not called by deprec tasks
|
|
137
|
+
task :rename_index_page, :roles => :web do
|
|
138
|
+
index_file = '/usr/local/nginx/html/index.html'
|
|
139
|
+
sudo "test -f #{index_file} && sudo mv #{index_file} #{index_file}.orig || exit 0"
|
|
140
|
+
end
|
|
141
141
|
|
|
142
142
|
end
|
|
143
143
|
end
|
data/lib/deprec/recipes/php.rb
CHANGED
|
@@ -5,14 +5,11 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
5
5
|
|
|
6
6
|
desc "Install PHP from source"
|
|
7
7
|
task :install do
|
|
8
|
-
version = 'php-5.2.4'
|
|
9
8
|
set :src_package, {
|
|
10
|
-
:
|
|
11
|
-
:
|
|
12
|
-
:dir => version,
|
|
13
|
-
:url => "http://www.php.net/distributions/#{version}.tar.gz",
|
|
14
|
-
:unpack => "tar zxf #{version}.tar.gz;",
|
|
9
|
+
:md5sum => '1720f95f26c506338f0dba3a51906bbd php-5.2.6.tar.gz',
|
|
10
|
+
:url => "http://www.php.net/distributions/php-5.2.6.tar.gz",
|
|
15
11
|
:configure => %w(
|
|
12
|
+
export CFLAGS=-O2;
|
|
16
13
|
./configure
|
|
17
14
|
--prefix=/usr/local/php
|
|
18
15
|
--with-apxs2=/usr/local/apache2/bin/apxs
|
|
@@ -34,13 +31,9 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
34
31
|
--enable-mbstring
|
|
35
32
|
--with-curl==/usr/lib
|
|
36
33
|
;
|
|
37
|
-
).reject{|arg| arg.match '#'}.join(' ')
|
|
38
|
-
:make => 'make;',
|
|
39
|
-
:install => 'make install;',
|
|
40
|
-
:post_install => ""
|
|
34
|
+
).reject{|arg| arg.match '#'}.join(' ')
|
|
41
35
|
}
|
|
42
36
|
install_deps
|
|
43
|
-
run "export CFLAGS=-O2;"
|
|
44
37
|
deprec2.download_src(src_package, src_dir)
|
|
45
38
|
deprec2.install_from_src(src_package, src_dir)
|
|
46
39
|
deprec2.append_to_file_if_missing('/usr/local/apache2/conf/httpd.conf', 'AddType application/x-httpd-php .php')
|
|
@@ -48,7 +41,6 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
48
41
|
|
|
49
42
|
# install dependencies for php
|
|
50
43
|
task :install_deps do
|
|
51
|
-
puts "This function should be overridden by your OS plugin!"
|
|
52
44
|
apt.install( {:base => %w(zlib1g-dev zlib1g openssl libssl-dev
|
|
53
45
|
flex libcurl3 libcurl3-dev libmcrypt-dev libmysqlclient15-dev libncurses5-dev
|
|
54
46
|
libxml2-dev libjpeg62-dev libpng12-dev)}, :stable )
|
|
@@ -4,16 +4,24 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
4
4
|
namespace :deprec do
|
|
5
5
|
namespace :postfix do
|
|
6
6
|
|
|
7
|
+
set(:postfix_relayhost) { Capistrano::CLI.ui.ask "What host should we relay mail through?" }
|
|
7
8
|
desc "Install Postfix"
|
|
8
|
-
task :install, :roles => :
|
|
9
|
+
task :install, :roles => :mail do
|
|
9
10
|
install_deps
|
|
10
11
|
end
|
|
11
12
|
|
|
12
13
|
# Install dependencies for Postfix
|
|
13
14
|
task :install_deps do
|
|
14
|
-
|
|
15
|
+
# mutt and mailx are useful tools for testing mail
|
|
16
|
+
# e.g. echo test | mail test@gmail.com
|
|
17
|
+
apt.install( {:base => %w(postfix mutt mailx)}, :stable )
|
|
15
18
|
end
|
|
16
19
|
|
|
20
|
+
# This is my default Postfix setup on servers that
|
|
21
|
+
# aren't my main outgoing mailserver.
|
|
22
|
+
# It accepts mail from localhost only and relays
|
|
23
|
+
# all mail to a master mailserver for delivery.
|
|
24
|
+
#
|
|
17
25
|
SYSTEM_CONFIG_FILES[:postfix] = [
|
|
18
26
|
|
|
19
27
|
{:template => "main.cf.erb",
|
|
@@ -38,17 +46,18 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
38
46
|
|
|
39
47
|
]
|
|
40
48
|
|
|
41
|
-
desc
|
|
49
|
+
desc 'Generate configuration files(s) for postfix'
|
|
42
50
|
task :config_gen do
|
|
43
51
|
SYSTEM_CONFIG_FILES[:postfix].each do |file|
|
|
44
52
|
deprec2.render_template(:postfix, file)
|
|
45
53
|
end
|
|
46
54
|
end
|
|
47
55
|
|
|
48
|
-
desc 'Deploy configuration files(s) for
|
|
49
|
-
task :config, :roles => :mail do
|
|
56
|
+
desc 'Deploy configuration files(s) for postfix'
|
|
57
|
+
task :config, :roles => :mail, :except => { :master => true } do
|
|
50
58
|
deprec2.push_configs(:postfix, SYSTEM_CONFIG_FILES[:postfix])
|
|
51
59
|
send(run_method, "/usr/bin/newaliases")
|
|
60
|
+
reload
|
|
52
61
|
end
|
|
53
62
|
|
|
54
63
|
desc "Start Postfix"
|
data/lib/deprec/recipes/rails.rb
CHANGED
|
@@ -61,10 +61,9 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
61
61
|
top.deprec.ruby.install
|
|
62
62
|
top.deprec.rubygems.install
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
top.deprec.nginx.install
|
|
66
|
-
end
|
|
64
|
+
top.deprec.nginx.install
|
|
67
65
|
|
|
66
|
+
# XXX check this out before removing - Mike
|
|
68
67
|
deprec2.for_roles('app') do
|
|
69
68
|
top.deprec.svn.install
|
|
70
69
|
top.deprec.git.install
|
|
@@ -73,15 +72,10 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
73
72
|
top.deprec.rails.install
|
|
74
73
|
end
|
|
75
74
|
|
|
76
|
-
|
|
77
|
-
top.deprec.logrotate.install
|
|
78
|
-
end
|
|
75
|
+
top.deprec.logrotate.install
|
|
79
76
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
top.deprec.mysql.install
|
|
83
|
-
top.deprec.mysql.start
|
|
84
|
-
end
|
|
77
|
+
top.deprec.mysql.install
|
|
78
|
+
top.deprec.mysql.start
|
|
85
79
|
|
|
86
80
|
end
|
|
87
81
|
|
|
@@ -90,7 +84,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
90
84
|
install_stack
|
|
91
85
|
end
|
|
92
86
|
|
|
93
|
-
task :install_gems_for_project do
|
|
87
|
+
task :install_gems_for_project, :roles => :app do
|
|
94
88
|
if gems_for_project
|
|
95
89
|
gems_for_project.each { |gem| gem2.install(gem) }
|
|
96
90
|
end
|
|
@@ -122,23 +116,23 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
122
116
|
deprec2.push_configs(:nginx, PROJECT_CONFIG_FILES[:nginx])
|
|
123
117
|
top.deprec.mongrel.config_project
|
|
124
118
|
symlink_nginx_vhost
|
|
125
|
-
|
|
119
|
+
symlink_nginx_logrotate_config
|
|
126
120
|
end
|
|
127
121
|
|
|
128
122
|
task :symlink_nginx_vhost, :roles => :web do
|
|
129
123
|
sudo "ln -sf #{deploy_to}/nginx/rails_nginx_vhost.conf #{nginx_vhost_dir}/#{application}.conf"
|
|
130
124
|
end
|
|
131
125
|
|
|
132
|
-
task :
|
|
126
|
+
task :symlink_nginx_logrotate_config, :roles => :web do
|
|
133
127
|
sudo "ln -sf #{deploy_to}/nginx/logrotate.conf /etc/logrotate.d/nginx-#{application}"
|
|
134
128
|
end
|
|
135
129
|
|
|
136
|
-
task :create_config_dir do
|
|
130
|
+
task :create_config_dir, :roles => :app do
|
|
137
131
|
deprec2.mkdir("#{shared_path}/config", :group => group, :mode => 0775, :via => :sudo)
|
|
138
132
|
end
|
|
139
133
|
|
|
140
134
|
desc "Create deployment group and add current user to it"
|
|
141
|
-
task :setup_user_perms do
|
|
135
|
+
task :setup_user_perms, :roles => [:app, :web] do
|
|
142
136
|
deprec2.groupadd(group)
|
|
143
137
|
deprec2.add_user_to_group(user, group)
|
|
144
138
|
deprec2.groupadd(mongrel_group)
|
|
@@ -160,7 +154,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
160
154
|
end
|
|
161
155
|
|
|
162
156
|
# setup extra paths required for deployment
|
|
163
|
-
task :setup_paths, :roles => :app do
|
|
157
|
+
task :setup_paths, :roles => [:app, :web] do
|
|
164
158
|
deprec2.mkdir(deploy_to, :mode => 0775, :group => group, :via => :sudo)
|
|
165
159
|
deprec2.mkdir(shared_path, :mode => 0775, :group => group, :via => :sudo)
|
|
166
160
|
end
|
|
@@ -285,4 +279,4 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
285
279
|
|
|
286
280
|
end
|
|
287
281
|
|
|
288
|
-
end
|
|
282
|
+
end
|
data/lib/deprec/recipes/ruby.rb
CHANGED
|
@@ -5,11 +5,11 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
5
5
|
namespace :ruby do
|
|
6
6
|
|
|
7
7
|
SRC_PACKAGES[:ruby] = {
|
|
8
|
-
:filename => 'ruby-1.8.6-
|
|
9
|
-
:md5sum => "
|
|
10
|
-
:dir => 'ruby-1.8.6-
|
|
11
|
-
:url => "ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-
|
|
12
|
-
:unpack => "tar zxf ruby-1.8.6-
|
|
8
|
+
:filename => 'ruby-1.8.6-p287.tar.gz',
|
|
9
|
+
:md5sum => "f6cd51001534ced5375339707a757556 ruby-1.8.6-p287.tar.gz",
|
|
10
|
+
:dir => 'ruby-1.8.6-p287',
|
|
11
|
+
:url => "ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p287.tar.gz",
|
|
12
|
+
:unpack => "tar zxf ruby-1.8.6-p287.tar.gz;",
|
|
13
13
|
:configure => %w(
|
|
14
14
|
./configure
|
|
15
15
|
--with-readline-dir=/usr/local
|
|
@@ -38,10 +38,12 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
38
38
|
|
|
39
39
|
SRC_PACKAGES[:rubygems] = {
|
|
40
40
|
:filename => 'rubygems-1.2.0.tgz',
|
|
41
|
-
:md5sum => "b77a4234360735174d1692e6fc598402 rubygems-1.0.
|
|
41
|
+
:md5sum => "b77a4234360735174d1692e6fc598402 rubygems-1.2.0.tgz",
|
|
42
42
|
:dir => 'rubygems-1.2.0',
|
|
43
43
|
:url => "http://rubyforge.org/frs/download.php/38646/rubygems-1.2.0.tgz",
|
|
44
44
|
:unpack => "tar zxf rubygems-1.2.0.tgz;",
|
|
45
|
+
:configure => "",
|
|
46
|
+
:make => "",
|
|
45
47
|
:install => 'ruby setup.rb;'
|
|
46
48
|
}
|
|
47
49
|
|
data/lib/deprec/recipes/utils.rb
CHANGED
data/lib/deprec/recipes/xen.rb
CHANGED
|
@@ -60,7 +60,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
60
60
|
enable_hardy_domu
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
-
task :install_deps do
|
|
63
|
+
task :install_deps, :roles => :dom0 do
|
|
64
64
|
# for amd64 version of ubuntu 7.10
|
|
65
65
|
apt.install( {:base => %w(linux-image-xen bridge-utils libxen3.1 python-xen-3.1 xen-docs-3.1 xen-hypervisor-3.1 xen-ioemu-3.1 xen-tools xen-utils-3.1 lvm2)}, :stable )
|
|
66
66
|
# alternatively, for x86 version of ubuntu:
|
|
@@ -75,7 +75,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
desc "Push Xen config files to server"
|
|
78
|
-
task :config do
|
|
78
|
+
task :config, :roles => :dom0 do
|
|
79
79
|
deprec2.push_configs(:xen, SYSTEM_CONFIG_FILES[:xen])
|
|
80
80
|
end
|
|
81
81
|
|
|
@@ -86,30 +86,30 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
86
86
|
# xm create -c /etc/xen/x1.cfg
|
|
87
87
|
|
|
88
88
|
desc "Start Xen"
|
|
89
|
-
task :start do
|
|
89
|
+
task :start, :roles => :dom0 do
|
|
90
90
|
send(run_method, "/etc/init.d/xend start")
|
|
91
91
|
end
|
|
92
92
|
|
|
93
93
|
desc "Stop Xen"
|
|
94
|
-
task :stop do
|
|
94
|
+
task :stop, :roles => :dom0 do
|
|
95
95
|
send(run_method, "/etc/init.d/xend stop")
|
|
96
96
|
end
|
|
97
97
|
|
|
98
98
|
desc "Restart Xen"
|
|
99
|
-
task :restart do
|
|
99
|
+
task :restart, :roles => :dom0 do
|
|
100
100
|
send(run_method, "/etc/init.d/xend restart")
|
|
101
101
|
end
|
|
102
102
|
|
|
103
103
|
desc "Reload Xen"
|
|
104
|
-
task :reload do
|
|
104
|
+
task :reload, :roles => :dom0 do
|
|
105
105
|
send(run_method, "/etc/init.d/xend reload")
|
|
106
106
|
end
|
|
107
107
|
|
|
108
|
-
task :list do
|
|
108
|
+
task :list, :roles => :dom0 do
|
|
109
109
|
sudo "xm list"
|
|
110
110
|
end
|
|
111
111
|
|
|
112
|
-
task :info do
|
|
112
|
+
task :info, :roles => :dom0 do
|
|
113
113
|
sudo "xm info"
|
|
114
114
|
end
|
|
115
115
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
|
|
2
2
|
|
|
3
|
+
|
|
3
4
|
# Debian specific: Specifying a file name will cause the first
|
|
4
5
|
# line of that file to be used as the name. The Debian default
|
|
5
6
|
# is /etc/mailname.
|
|
6
|
-
|
|
7
|
+
myorigin = /etc/mailname
|
|
7
8
|
|
|
8
9
|
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
|
|
9
10
|
biff = no
|
|
@@ -24,18 +25,12 @@ smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
|
|
|
24
25
|
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
|
|
25
26
|
# information on enabling SSL in the smtp client.
|
|
26
27
|
|
|
27
|
-
myhostname =
|
|
28
|
+
# myhostname =
|
|
28
29
|
alias_maps = hash:/etc/aliases
|
|
29
30
|
alias_database = hash:/etc/aliases
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
# deprec - XXX add something like this to template file
|
|
33
|
-
#
|
|
34
|
-
# mydestination = <%# postfix_destination_domains * ', ' %>, localhost.localdomain, localhost
|
|
35
|
-
mydestination = dn.blocksglobal.com, localhost.blocksglobal.com, , localhost
|
|
36
|
-
|
|
37
|
-
relayhost =
|
|
31
|
+
mydestination = $myhostname localhost.$mydomain $myorigin
|
|
32
|
+
relayhost = <%= postfix_relayhost %>
|
|
38
33
|
mynetworks = 127.0.0.0/8
|
|
39
34
|
mailbox_size_limit = 0
|
|
40
35
|
recipient_delimiter = +
|
|
41
|
-
inet_interfaces =
|
|
36
|
+
inet_interfaces = loopback-only
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: andyh-deprec
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.99.
|
|
4
|
+
version: 1.99.27
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mike Bailey
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2008-
|
|
12
|
+
date: 2008-10-09 00:00:00 -07:00
|
|
13
13
|
default_executable: depify
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|