capitate 0.2.7 → 0.2.8
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/Capfile +0 -4
- data/History.txt +9 -2
- data/Manifest.txt +4 -32
- data/README.txt +8 -1
- data/lib/capitate/cap_ext/variables.rb +28 -5
- data/lib/capitate/plugins/build.rb +1 -1
- data/lib/capitate/version.rb +1 -1
- data/lib/deployment/{install-centos-rubyweb.rb → centos-5.1-64-web/install.rb} +62 -34
- data/lib/deployment/deploy.rb +1 -3
- data/lib/recipes/centos/monit.rb +3 -3
- data/lib/recipes/centos/mysql.rb +1 -1
- data/lib/recipes/centos/ruby.rb +1 -1
- data/lib/recipes/mysql.rb +2 -2
- data/lib/recipes/sphinx.rb +5 -5
- data/lib/recipes/sshd.rb +25 -0
- data/lib/templates/monit/monitrc.erb +0 -10
- data/lib/templates/nginx/nginx.conf.erb +1 -0
- data/lib/templates/sshd/sshd.monitrc.erb +5 -0
- data/website/index.html +9 -8
- data/website/index.txt +5 -4
- data/website/template.rhtml +2 -2
- metadata +6 -64
- data/docs/recipes/centos.txt +0 -33
- data/docs/recipes/deploy-pending.txt +0 -25
- data/docs/recipes/deploy-web.txt +0 -33
- data/docs/recipes/deploy.txt +0 -167
- data/docs/recipes/docs.txt +0 -26
- data/docs/recipes/imagemagick-centos.txt +0 -26
- data/docs/recipes/imagemagick.txt +0 -8
- data/docs/recipes/index.txt +0 -31
- data/docs/recipes/memcached-centos.txt +0 -39
- data/docs/recipes/memcached-monit.txt +0 -30
- data/docs/recipes/memcached.txt +0 -9
- data/docs/recipes/mongrel-cluster-centos.txt +0 -37
- data/docs/recipes/mongrel-cluster-monit.txt +0 -37
- data/docs/recipes/mongrel-cluster.txt +0 -9
- data/docs/recipes/mongrel.txt +0 -9
- data/docs/recipes/monit-centos.txt +0 -49
- data/docs/recipes/monit.txt +0 -45
- data/docs/recipes/mysql-centos.txt +0 -22
- data/docs/recipes/mysql-monit.txt +0 -28
- data/docs/recipes/mysql.txt +0 -42
- data/docs/recipes/nginx-centos.txt +0 -52
- data/docs/recipes/nginx-mongrel.txt +0 -33
- data/docs/recipes/nginx-monit.txt +0 -26
- data/docs/recipes/nginx.txt +0 -10
- data/docs/recipes/rails.txt +0 -64
- data/docs/recipes/ruby-centos.txt +0 -31
- data/docs/recipes/ruby.txt +0 -8
- data/docs/recipes/sphinx-centos.txt +0 -56
- data/docs/recipes/sphinx-monit.txt +0 -22
- data/docs/recipes/sphinx.txt +0 -81
- data/lib/capitate/cap_ext/extension_proxy.rb +0 -15
data/Capfile
CHANGED
data/History.txt
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
|
+
== 0.2.8 2008-03-13
|
|
2
|
+
|
|
3
|
+
* Recipe, mysql:centos:install, doing restart incase already run
|
|
4
|
+
* Added sshd monit recipe. In case using non-standard sshd port
|
|
5
|
+
* Updated example deployment install script (centos 5.1 x86_64)
|
|
6
|
+
* Move monit inittab install at the end
|
|
7
|
+
* Added fetch_any(:var1, :var2)
|
|
8
|
+
|
|
1
9
|
== 0.2.7 2008-03-10
|
|
2
10
|
|
|
3
11
|
* Add clean method to sphinx init script
|
|
4
12
|
* Moved install and make_install into build plugin
|
|
5
13
|
* Added symlink option to make_install
|
|
6
14
|
* Added fetch_role and fetch_roles methods
|
|
7
|
-
* Recipe fixes
|
|
8
15
|
|
|
9
16
|
== 0.2.6 2008-02-29
|
|
10
17
|
|
|
@@ -76,4 +83,4 @@
|
|
|
76
83
|
|
|
77
84
|
== 0.1.1 2008-02-06
|
|
78
85
|
|
|
79
|
-
* Initial import
|
|
86
|
+
* Initial import
|
data/Manifest.txt
CHANGED
|
@@ -8,39 +8,8 @@ bin/capitate
|
|
|
8
8
|
config/hoe.rb
|
|
9
9
|
config/requirements.rb
|
|
10
10
|
docs/nginx.README
|
|
11
|
-
docs/recipes/centos.txt
|
|
12
|
-
docs/recipes/deploy-pending.txt
|
|
13
|
-
docs/recipes/deploy-web.txt
|
|
14
|
-
docs/recipes/deploy.txt
|
|
15
|
-
docs/recipes/docs.txt
|
|
16
|
-
docs/recipes/imagemagick-centos.txt
|
|
17
|
-
docs/recipes/imagemagick.txt
|
|
18
|
-
docs/recipes/index.txt
|
|
19
|
-
docs/recipes/memcached-centos.txt
|
|
20
|
-
docs/recipes/memcached-monit.txt
|
|
21
|
-
docs/recipes/memcached.txt
|
|
22
|
-
docs/recipes/mongrel-cluster-centos.txt
|
|
23
|
-
docs/recipes/mongrel-cluster-monit.txt
|
|
24
|
-
docs/recipes/mongrel-cluster.txt
|
|
25
|
-
docs/recipes/mongrel.txt
|
|
26
|
-
docs/recipes/monit-centos.txt
|
|
27
|
-
docs/recipes/monit.txt
|
|
28
|
-
docs/recipes/mysql-centos.txt
|
|
29
|
-
docs/recipes/mysql-monit.txt
|
|
30
|
-
docs/recipes/mysql.txt
|
|
31
|
-
docs/recipes/nginx-centos.txt
|
|
32
|
-
docs/recipes/nginx-mongrel.txt
|
|
33
|
-
docs/recipes/nginx-monit.txt
|
|
34
|
-
docs/recipes/nginx.txt
|
|
35
|
-
docs/recipes/rails.txt
|
|
36
|
-
docs/recipes/ruby-centos.txt
|
|
37
|
-
docs/recipes/ruby.txt
|
|
38
|
-
docs/recipes/sphinx-centos.txt
|
|
39
|
-
docs/recipes/sphinx-monit.txt
|
|
40
|
-
docs/recipes/sphinx.txt
|
|
41
11
|
lib/capitate.rb
|
|
42
12
|
lib/capitate/cap_ext/connections.rb
|
|
43
|
-
lib/capitate/cap_ext/extension_proxy.rb
|
|
44
13
|
lib/capitate/cap_ext/roles.rb
|
|
45
14
|
lib/capitate/cap_ext/run_via.rb
|
|
46
15
|
lib/capitate/cap_ext/variables.rb
|
|
@@ -56,8 +25,8 @@ lib/capitate/plugins/yum.rb
|
|
|
56
25
|
lib/capitate/recipes.rb
|
|
57
26
|
lib/capitate/task_node.rb
|
|
58
27
|
lib/capitate/version.rb
|
|
28
|
+
lib/deployment/centos-5.1-64-web/install.rb
|
|
59
29
|
lib/deployment/deploy.rb
|
|
60
|
-
lib/deployment/install-centos-rubyweb.rb
|
|
61
30
|
lib/recipes/centos/centos.rb
|
|
62
31
|
lib/recipes/centos/imagemagick.rb
|
|
63
32
|
lib/recipes/centos/memcached.rb
|
|
@@ -75,6 +44,7 @@ lib/recipes/mysql.rb
|
|
|
75
44
|
lib/recipes/nginx.rb
|
|
76
45
|
lib/recipes/rails.rb
|
|
77
46
|
lib/recipes/sphinx.rb
|
|
47
|
+
lib/recipes/sshd.rb
|
|
78
48
|
lib/templates/capistrano/Capfile
|
|
79
49
|
lib/templates/memcached/memcached.initd.centos.erb
|
|
80
50
|
lib/templates/memcached/memcached.monitrc.erb
|
|
@@ -97,6 +67,7 @@ lib/templates/ruby/fix_openssl.sh
|
|
|
97
67
|
lib/templates/sphinx/sphinx.conf.erb
|
|
98
68
|
lib/templates/sphinx/sphinx.monitrc.erb
|
|
99
69
|
lib/templates/sphinx/sphinx_app.initd.centos.erb
|
|
70
|
+
lib/templates/sshd/sshd.monitrc.erb
|
|
100
71
|
script/destroy
|
|
101
72
|
script/generate
|
|
102
73
|
script/txt2html
|
|
@@ -107,6 +78,7 @@ tasks/website.rake
|
|
|
107
78
|
test/test_helper.rb
|
|
108
79
|
test/test_plugin_upload.rb
|
|
109
80
|
test/test_recipes.rb
|
|
81
|
+
test/test_roles.rb
|
|
110
82
|
test/test_templates.rb
|
|
111
83
|
website/index.html
|
|
112
84
|
website/index.txt
|
data/README.txt
CHANGED
|
@@ -42,15 +42,38 @@ module Capitate
|
|
|
42
42
|
# # Any calls to fetch(memcached_port) in the future will return this value 11211 (unless overriden)
|
|
43
43
|
#
|
|
44
44
|
def fetch_or_default(variable, default, *args)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
if exists?(variable)
|
|
46
|
+
fetch(variable, *args)
|
|
47
|
+
else
|
|
48
48
|
set variable, default
|
|
49
|
+
default
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Fetch or set and fetch any default variable listed.
|
|
54
|
+
#
|
|
55
|
+
# ==== Options
|
|
56
|
+
# +variable+:: Variable to fetch
|
|
57
|
+
# +variables+:: List if variables to try in order
|
|
58
|
+
#
|
|
59
|
+
# ==== Examples
|
|
60
|
+
# fetch_or_set(:sphinx_db_host, :db_host)
|
|
61
|
+
#
|
|
62
|
+
def fetch_or_set(variable, *default_variables)
|
|
63
|
+
return fetch(variable) if exists?(variable)
|
|
64
|
+
|
|
65
|
+
default_variables.each do |default_variable|
|
|
66
|
+
if exists?(default_variable)
|
|
67
|
+
value = fetch(default_variable)
|
|
68
|
+
set variable, value
|
|
69
|
+
return value
|
|
70
|
+
end
|
|
49
71
|
end
|
|
50
|
-
|
|
72
|
+
nil
|
|
51
73
|
end
|
|
52
74
|
|
|
53
75
|
# Fetch roles with name and options
|
|
76
|
+
# I don't actually use this.
|
|
54
77
|
#
|
|
55
78
|
# ==== Options
|
|
56
79
|
# +name+:: Role name to look for
|
|
@@ -86,7 +109,7 @@ module Capitate
|
|
|
86
109
|
matched_roles.to_a
|
|
87
110
|
end
|
|
88
111
|
|
|
89
|
-
# Fetch first role with name and options
|
|
112
|
+
# Fetch first role with name and options.
|
|
90
113
|
#
|
|
91
114
|
# ==== Options
|
|
92
115
|
# +name+:: Role name to look for
|
data/lib/capitate/version.rb
CHANGED
|
@@ -1,24 +1,34 @@
|
|
|
1
|
-
#
|
|
2
|
-
# For installing apps on the thoughpolice centos 5.1 image
|
|
3
|
-
#
|
|
1
|
+
# Centos 5.1 base install
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
|
|
4
|
+
|
|
5
|
+
require 'erb'
|
|
6
|
+
|
|
7
|
+
# Load capitate
|
|
8
|
+
require 'capitate'
|
|
9
|
+
require 'capitate/recipes'
|
|
10
10
|
|
|
11
|
+
# Load more recipes
|
|
12
|
+
Dir[File.dirname(__FILE__) + "/recipes/*.rb"].each { |recipe| load recipe }
|
|
13
|
+
|
|
14
|
+
# Add a templates dir
|
|
15
|
+
set :templates_dirs, [ File.dirname(__FILE__) + "/templates" ]
|
|
16
|
+
|
|
17
|
+
# Install task
|
|
11
18
|
namespace :install do
|
|
12
19
|
|
|
13
20
|
task :default do
|
|
14
21
|
|
|
15
|
-
|
|
16
|
-
# set :templates_dirs, [ File.dirname(__FILE__) + "/../templates" ]
|
|
17
|
-
|
|
18
|
-
set :user, "root"
|
|
19
|
-
set :run_method, :run
|
|
20
|
-
|
|
22
|
+
as_root
|
|
21
23
|
check_role
|
|
24
|
+
|
|
25
|
+
# NTP Setup
|
|
26
|
+
yum.install([ "ntp" ])
|
|
27
|
+
script.run_all <<-CMDS
|
|
28
|
+
chkconfig --levels 235 ntpd on
|
|
29
|
+
ntpdate 0.pool.ntp.org
|
|
30
|
+
/sbin/service ntpd start
|
|
31
|
+
CMDS
|
|
22
32
|
|
|
23
33
|
# Setup for web
|
|
24
34
|
# * Add admin group
|
|
@@ -26,41 +36,49 @@ namespace :install do
|
|
|
26
36
|
# * Create web apps directory
|
|
27
37
|
# * Add admin group to suders ALL=(ALL) ALL
|
|
28
38
|
script.run_all <<-CMDS
|
|
29
|
-
egrep "^admin" /etc/group || /usr/sbin/groupadd admin
|
|
30
|
-
sed -i -e 's/^id:5:initdefault:/id:3:initdefault:/g' /etc/inittab
|
|
39
|
+
egrep "^admin" /etc/group || /usr/sbin/groupadd admin
|
|
31
40
|
mkdir -p /var/www/apps
|
|
32
41
|
egrep "^%admin" /etc/sudoers || echo "%admin ALL=(ALL) ALL" >> /etc/sudoers
|
|
33
42
|
CMDS
|
|
34
43
|
|
|
35
44
|
# Package installs
|
|
36
|
-
yum.
|
|
37
|
-
#yum.update
|
|
45
|
+
yum.update
|
|
38
46
|
yum.install [ "gcc", "kernel-devel", "libevent-devel", "libxml2-devel", "openssl", "openssl-devel",
|
|
39
47
|
"aspell", "aspell-devel", "aspell-en", "aspell-es" ]
|
|
40
|
-
|
|
48
|
+
|
|
49
|
+
yum.clean
|
|
50
|
+
|
|
41
51
|
#
|
|
42
52
|
# App installs
|
|
43
53
|
#
|
|
44
|
-
|
|
45
|
-
ruby.centos.install
|
|
46
|
-
|
|
54
|
+
|
|
55
|
+
ruby.centos.install
|
|
47
56
|
nginx.centos.install
|
|
48
57
|
mysql.centos.install
|
|
49
58
|
sphinx.centos.install
|
|
59
|
+
|
|
50
60
|
monit.centos.install
|
|
61
|
+
# Install firewall rule manually
|
|
62
|
+
#monit.centos.iptables
|
|
63
|
+
|
|
64
|
+
sshd.monit.install
|
|
65
|
+
|
|
51
66
|
imagemagick.centos.install
|
|
52
67
|
memcached.centos.install
|
|
53
|
-
|
|
68
|
+
|
|
54
69
|
#
|
|
55
70
|
# Install monit hooks
|
|
56
71
|
#
|
|
57
72
|
nginx.monit.install
|
|
58
73
|
mysql.monit.install
|
|
59
74
|
memcached.monit.install
|
|
60
|
-
|
|
75
|
+
|
|
61
76
|
# Install gems
|
|
62
77
|
gems.install(fetch(:gems_to_install))
|
|
63
78
|
|
|
79
|
+
# Install renderer
|
|
80
|
+
renderer.install
|
|
81
|
+
|
|
64
82
|
# Cleanup
|
|
65
83
|
yum.clean
|
|
66
84
|
end
|
|
@@ -77,11 +95,17 @@ end
|
|
|
77
95
|
desc "Be root"
|
|
78
96
|
task :as_root do
|
|
79
97
|
set :user, "root"
|
|
98
|
+
set :run_method, :run
|
|
80
99
|
end
|
|
81
100
|
|
|
82
|
-
#
|
|
83
|
-
|
|
84
|
-
#
|
|
101
|
+
# Prompt for server if host not given
|
|
102
|
+
task :check_role do
|
|
103
|
+
# Can use cap HOSTS=192.168.1.111 install
|
|
104
|
+
# Otherwise prompt for the service
|
|
105
|
+
role :install, prompt.ask("Server: ") if find_servers_for_task(current_task).blank?
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# For for ruby install
|
|
85
109
|
after "ruby:centos:install" do
|
|
86
110
|
# Fix ruby install openssl
|
|
87
111
|
script.sh("ruby/fix_openssl.sh")
|
|
@@ -93,7 +117,7 @@ end
|
|
|
93
117
|
#
|
|
94
118
|
|
|
95
119
|
set :gems_to_install, [ "rake", "mysql -- --with-mysql-include=/usr/include/mysql --with-mysql-lib=/usr/lib/mysql --with-mysql-config",
|
|
96
|
-
"raspell", "rmagick", "mongrel", "mongrel_cluster", "json", "mime-types" ]
|
|
120
|
+
"raspell", "rmagick", "mongrel", "mongrel_cluster", "json", "mime-types", "hpricot" ]
|
|
97
121
|
|
|
98
122
|
|
|
99
123
|
# Ruby install
|
|
@@ -141,21 +165,25 @@ set :nginx_build_options, {
|
|
|
141
165
|
# Sphinx install
|
|
142
166
|
set :sphinx_prefix, "/usr/local/sphinx-0.9.8-rc1"
|
|
143
167
|
set :sphinx_build_options, {
|
|
144
|
-
:url => "http://www.sphinxsearch.com/downloads/sphinx-0.9.8-rc1.tar.gz",
|
|
145
|
-
|
|
146
|
-
:configure_options => "--with-mysql-includes=/usr/include/mysql --with-mysql-libs=/usr/lib/mysql \
|
|
147
|
-
--prefix=#{sphinx_prefix}",
|
|
168
|
+
:url => "http://www.sphinxsearch.com/downloads/sphinx-0.9.8-rc1.tar.gz",
|
|
169
|
+
:configure_options => "--with-mysql-includes=/usr/include/mysql --with-mysql-libs=/usr/lib64/mysql --prefix=#{sphinx_prefix}",
|
|
148
170
|
:symlink => { sphinx_prefix => "/usr/local/sphinx" }
|
|
149
171
|
}
|
|
150
|
-
|
|
172
|
+
# Other possible sphinx_build_options
|
|
173
|
+
# :url => "http://www.sphinxsearch.com/downloads/sphinx-0.9.7.tar.gz",
|
|
174
|
+
# :configure_options => "--with-mysql-includes=/usr/include/mysql --with-mysql-libs=/usr/lib/mysql --prefix=#{sphinx_prefix}",
|
|
151
175
|
|
|
152
176
|
|
|
153
177
|
# For mysql:install
|
|
154
178
|
set :mysql_pid_path, "/var/run/mysqld/mysqld.pid"
|
|
155
|
-
set :
|
|
179
|
+
set :mysql_port, 3306
|
|
156
180
|
|
|
157
181
|
# Imagemagick install
|
|
158
182
|
set :imagemagick_build_options, {
|
|
159
183
|
:url => "http://capitate.s3.amazonaws.com/ImageMagick.tar.gz",
|
|
160
184
|
:unpack_dir => "ImageMagick-*"
|
|
161
185
|
}
|
|
186
|
+
|
|
187
|
+
# For sshd:monit:install
|
|
188
|
+
set :sshd_pid_path, "/var/run/mysqld/mysqld.pid"
|
|
189
|
+
set :sshd_port, 2023
|
data/lib/deployment/deploy.rb
CHANGED
data/lib/recipes/centos/monit.rb
CHANGED
|
@@ -39,12 +39,12 @@ namespace :monit do
|
|
|
39
39
|
put template.load("monit/monitrc.erb"), "/tmp/monitrc"
|
|
40
40
|
run_via "mkdir -p #{monit_conf_dir} && install -o root -m 700 /tmp/monitrc /etc/monitrc && rm -f /tmp/monitrc"
|
|
41
41
|
|
|
42
|
-
# Patch initab
|
|
43
|
-
script.sh("monit/patch_inittab.sh")
|
|
44
|
-
|
|
45
42
|
# Build cert
|
|
46
43
|
put template.load("monit/monit.cnf"), "/tmp/monit.cnf"
|
|
47
44
|
script.sh("monit/cert.sh")
|
|
45
|
+
|
|
46
|
+
# Patch initab
|
|
47
|
+
script.sh("monit/patch_inittab.sh")
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
desc <<-DESC
|
data/lib/recipes/centos/mysql.rb
CHANGED
|
@@ -18,7 +18,7 @@ namespace :mysql do
|
|
|
18
18
|
|
|
19
19
|
# Install service
|
|
20
20
|
run_via "/sbin/chkconfig --level 345 mysqld on"
|
|
21
|
-
run_via "/sbin/service mysqld
|
|
21
|
+
run_via "/sbin/service mysqld restart"
|
|
22
22
|
|
|
23
23
|
# Set admin password
|
|
24
24
|
run_via "/usr/bin/mysqladmin -u root password #{mysql_admin_password_set}"
|
data/lib/recipes/centos/ruby.rb
CHANGED
data/lib/recipes/mysql.rb
CHANGED
|
@@ -6,7 +6,7 @@ namespace :mysql do
|
|
|
6
6
|
desc <<-DESC
|
|
7
7
|
Install mysql monit hooks.
|
|
8
8
|
|
|
9
|
-
*
|
|
9
|
+
*mysql_port*: Mysql port. _Defaults to 3306_\n
|
|
10
10
|
*mysql_pid_path*: Path to mysql pid file. _Defaults to /var/run/mysqld/mysqld.pid_\n
|
|
11
11
|
@set :mysql_pid_path, "/var/run/mysqld/mysqld.pid"@\n
|
|
12
12
|
*monit_conf_dir*: Destination for monitrc. _Defaults to "/etc/monit"_\n
|
|
@@ -16,7 +16,7 @@ namespace :mysql do
|
|
|
16
16
|
|
|
17
17
|
# Settings
|
|
18
18
|
fetch_or_default(:mysql_pid_path, "/var/run/mysqld/mysqld.pid")
|
|
19
|
-
fetch_or_default(:
|
|
19
|
+
fetch_or_default(:mysql_port, 3306)
|
|
20
20
|
fetch_or_default(:monit_conf_dir, "/etc/monit")
|
|
21
21
|
|
|
22
22
|
put template.load("mysql/mysql.monitrc.erb", binding), "/tmp/mysql.monitrc"
|
data/lib/recipes/sphinx.rb
CHANGED
|
@@ -50,11 +50,11 @@ namespace :sphinx do
|
|
|
50
50
|
fetch_or_default(:sphinx_log_root, "#{shared_path}/log")
|
|
51
51
|
fetch_or_default(:sphinx_pid_path, "#{shared_path}/pids/searchd.pid")
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
fetch_or_set(:sphinx_db_user, :db_user)
|
|
54
|
+
fetch_or_set(:sphinx_db_pass, :db_pass)
|
|
55
|
+
fetch_or_set(:sphinx_db_name, :db_name)
|
|
56
|
+
fetch_or_set(:sphinx_db_port, :db_port)
|
|
57
|
+
fetch_or_set(:sphinx_db_host, :db_host)
|
|
58
58
|
fetch_or_default(:sphinx_conf_host, "127.0.0.1")
|
|
59
59
|
|
|
60
60
|
put template.load(sphinx_conf_template), sphinx_conf_path
|
data/lib/recipes/sshd.rb
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
namespace :sshd do
|
|
2
|
+
|
|
3
|
+
namespace :monit do
|
|
4
|
+
|
|
5
|
+
desc <<-DESC
|
|
6
|
+
Install sshd monit hooks.
|
|
7
|
+
|
|
8
|
+
*sshd_port*: SSH daemon port. _Defaults to 22\n
|
|
9
|
+
*sshd_pid_path*: Path to mysql pid file. _Defaults to /var/run/sshd.pid_\n
|
|
10
|
+
*monit_conf_dir*: Destination for monitrc. _Defaults to "/etc/monit"_\n
|
|
11
|
+
DESC
|
|
12
|
+
task :install do
|
|
13
|
+
|
|
14
|
+
# Settings
|
|
15
|
+
fetch_or_default(:sshd_port, 3306)
|
|
16
|
+
fetch_or_default(:sshd_pid_path, "/var/run/sshd.pid")
|
|
17
|
+
fetch_or_default(:monit_conf_dir, "/etc/monit")
|
|
18
|
+
|
|
19
|
+
put template.load("sshd/sshd.monitrc.erb", binding), "/tmp/sshd.monitrc"
|
|
20
|
+
run_via "install -o root /tmp/sshd.monitrc #{monit_conf_dir}/sshd.monitrc"
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
end
|
|
@@ -12,16 +12,6 @@ set httpd port <%= monit_port %>
|
|
|
12
12
|
pemfile /var/certs/monit.pem
|
|
13
13
|
allow admin:<%= monit_password %>
|
|
14
14
|
|
|
15
|
-
# Core processes
|
|
16
|
-
# ---------------------------
|
|
17
|
-
|
|
18
|
-
check process sshd with pidfile /var/run/sshd.pid
|
|
19
|
-
start program "/sbin/service sshd start"
|
|
20
|
-
stop program "/sbin/service sshd stop"
|
|
21
|
-
if failed port 22 protocol ssh then restart
|
|
22
|
-
if 5 restarts within 5 cycles then timeout
|
|
23
|
-
|
|
24
|
-
|
|
25
15
|
# Includes
|
|
26
16
|
# ---------------------------
|
|
27
17
|
|
|
@@ -66,6 +66,7 @@ http {
|
|
|
66
66
|
# GZip fails on pre SP2 IE6 browsers (even though is says it can)
|
|
67
67
|
# Thanks, http://robsanheim.com/2008/02/07/beware-the-default-nginx-config-old-ie6-hates-gzip/
|
|
68
68
|
# TODO: This doesn't work with our version of nginx
|
|
69
|
+
#gzip_disable "MSIE [1-6]\.(?!.*SV1)";
|
|
69
70
|
#gzip_disable "MSIE [1-6]\.";
|
|
70
71
|
|
|
71
72
|
# Auto include
|
data/website/index.html
CHANGED
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
|
|
39
39
|
<div id="version" class="clickable box" onclick='document.location = "http://rubyforge.org/projects/capitate"; return false'>
|
|
40
40
|
<p>Get Version</p>
|
|
41
|
-
<a href="http://rubyforge.org/projects/capitate" class="numbers">0.2.
|
|
41
|
+
<a href="http://rubyforge.org/projects/capitate" class="numbers">0.2.8</a>
|
|
42
42
|
</div>
|
|
43
43
|
|
|
44
44
|
<div id="recipes">
|
|
45
45
|
<p>Documentation:
|
|
46
46
|
<a href="recipes/index.html">Recipes</a> →
|
|
47
|
-
<a href="http://
|
|
48
|
-
<a href="http://
|
|
47
|
+
<a href="http://github.com/gabriel/capitate/tree/master/lib/capitate/plugins">Plugins</a> →
|
|
48
|
+
<a href="http://github.com/gabriel/capitate/tree/master/lib/templates">Templates</a>
|
|
49
49
|
</p>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
@@ -81,7 +81,8 @@
|
|
|
81
81
|
|
|
82
82
|
<ul>
|
|
83
83
|
<li>Plugins to help install applications, via yum or manually unpacking, and building. Also to help upload files sanely, prompt for input, install gems, run shell scripts, etc.</li>
|
|
84
|
-
<li>Templates for init scripts
|
|
84
|
+
<li>Templates for init scripts and application configuration</li>
|
|
85
|
+
<li>Templates and recipes for common apps like monit, nginx, sphinx, mongrel, ruby and mysql</li>
|
|
85
86
|
<li>Common deployment setup and update_code tasks, such as symlinking in database.yml and more advanced recipes such as sphinx configuration.</li>
|
|
86
87
|
</ul>
|
|
87
88
|
|
|
@@ -89,13 +90,13 @@
|
|
|
89
90
|
<h3>Example: Using capitate to write an install task:</h3>
|
|
90
91
|
|
|
91
92
|
|
|
92
|
-
<p>See <a href="http://
|
|
93
|
+
<p>See <a href="http://github.com/gabriel/capitate/tree/master/lib/deployment/centos-5.1-64-web/install.rb">centos-5.1-64-web/install.rb</a></p>
|
|
93
94
|
|
|
94
95
|
|
|
95
96
|
<p>Load this in your Capfile:</p>
|
|
96
97
|
|
|
97
98
|
|
|
98
|
-
<pre><code>load "lib/deployment/
|
|
99
|
+
<pre><code>load "lib/deployment/centos-5.1-64-web/install.rb"</code></pre>
|
|
99
100
|
|
|
100
101
|
|
|
101
102
|
<p>and then:</p>
|
|
@@ -122,7 +123,7 @@
|
|
|
122
123
|
<p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people’s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
|
|
123
124
|
|
|
124
125
|
|
|
125
|
-
<p>The trunk repository is <a href="http://
|
|
126
|
+
<p>The trunk repository is <a href="http://github.com/gabriel/capitate/tree/master">http://github.com/gabriel/capitate/tree/master</a> for anonymous access.</p>
|
|
126
127
|
|
|
127
128
|
|
|
128
129
|
<h2>License</h2>
|
|
@@ -137,7 +138,7 @@
|
|
|
137
138
|
<p>Comments are welcome. Send an email to <a href="mailto:gabrielh@gmail.com">Gabriel Handford</a> via the <a href="http://groups.google.com/group/capitate">forum</a></p>
|
|
138
139
|
</div>
|
|
139
140
|
<p class="coda">
|
|
140
|
-
<a href="mailto:gabrielh@gmail.com">Gabriel Handford</a>,
|
|
141
|
+
<a href="mailto:gabrielh@gmail.com">Gabriel Handford</a>, 13th March 2008<br>
|
|
141
142
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
|
142
143
|
</p>
|
|
143
144
|
</div>
|
data/website/index.txt
CHANGED
|
@@ -24,17 +24,18 @@ h2. The basics
|
|
|
24
24
|
Capitate has:
|
|
25
25
|
|
|
26
26
|
* Plugins to help install applications, via yum or manually unpacking, and building. Also to help upload files sanely, prompt for input, install gems, run shell scripts, etc.
|
|
27
|
-
* Templates for init scripts
|
|
27
|
+
* Templates for init scripts and application configuration
|
|
28
|
+
* Templates and recipes for common apps like monit, nginx, sphinx, mongrel, ruby and mysql
|
|
28
29
|
* Common deployment setup and update_code tasks, such as symlinking in database.yml and more advanced recipes such as sphinx configuration.
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
h3. Example: Using capitate to write an install task:
|
|
32
33
|
|
|
33
|
-
See "
|
|
34
|
+
See "centos-5.1-64-web/install.rb":http://github.com/gabriel/capitate/tree/master/lib/deployment/centos-5.1-64-web/install.rb
|
|
34
35
|
|
|
35
36
|
Load this in your Capfile:
|
|
36
37
|
|
|
37
|
-
load "lib/deployment/
|
|
38
|
+
load "lib/deployment/centos-5.1-64-web/install.rb"
|
|
38
39
|
|
|
39
40
|
and then:
|
|
40
41
|
|
|
@@ -56,7 +57,7 @@ h2. How to submit patches
|
|
|
56
57
|
|
|
57
58
|
Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
|
|
58
59
|
|
|
59
|
-
The trunk repository is "http://
|
|
60
|
+
The trunk repository is "http://github.com/gabriel/capitate/tree/master":http://github.com/gabriel/capitate/tree/master for anonymous access.
|
|
60
61
|
|
|
61
62
|
h2. License
|
|
62
63
|
|
data/website/template.rhtml
CHANGED
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
<div id="recipes">
|
|
45
45
|
<p>Documentation:
|
|
46
46
|
<a href="recipes/index.html">Recipes</a> →
|
|
47
|
-
<a href="http://
|
|
48
|
-
<a href="http://
|
|
47
|
+
<a href="http://github.com/gabriel/capitate/tree/master/lib/capitate/plugins">Plugins</a> →
|
|
48
|
+
<a href="http://github.com/gabriel/capitate/tree/master/lib/templates">Templates</a>
|
|
49
49
|
</p>
|
|
50
50
|
</div>
|
|
51
51
|
|