deprec 2.1.19 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +11 -1
- data/{README → README.md} +33 -68
- data/bin/hosts.rb +44 -0
- data/docs/nagios.txt +28 -0
- data/lib/deprec/capistrano_extensions.rb +21 -32
- data/lib/deprec/recipes/apache.rb +54 -73
- data/lib/deprec/recipes/deprec.rb +30 -48
- data/lib/deprec/recipes/git.rb +2 -85
- data/lib/deprec/recipes/haproxy.rb +3 -11
- data/lib/deprec/recipes/mri.rb +23 -40
- data/lib/deprec/recipes/mysql.rb +6 -23
- data/lib/deprec/recipes/nagios.rb +2 -17
- data/lib/deprec/recipes/nagios3.rb +180 -0
- data/lib/deprec/recipes/network.rb +60 -28
- data/lib/deprec/recipes/nrpe.rb +82 -0
- data/lib/deprec/recipes/passenger.rb +15 -12
- data/lib/deprec/recipes/postgresql.rb +2 -2
- data/lib/deprec/recipes/rack.rb +44 -0
- data/lib/deprec/recipes/rails.rb +10 -32
- data/lib/deprec/recipes/ree.rb +27 -18
- data/lib/deprec/recipes/rubygems.rb +29 -0
- data/lib/deprec/recipes/sqlite.rb +1 -1
- data/lib/deprec/recipes/ssh.rb +1 -0
- data/lib/deprec/recipes/svn.rb +1 -160
- data/lib/deprec/recipes/users.rb +19 -16
- data/lib/deprec/recipes_minus_rails.rb +39 -36
- data/lib/deprec/templates/apache/CHANGES.txt +11 -0
- data/lib/deprec/templates/mysql/my.cnf.erb +21 -31
- data/lib/deprec/templates/{nagios → nagios.old}/README +0 -0
- data/lib/deprec/templates/nagios.old/apache_vhost.erb +25 -0
- data/lib/deprec/templates/{nagios → nagios.old}/cgi.cfg.erb +0 -0
- data/lib/deprec/templates/nagios.old/check_linux_free_memory.pl +118 -0
- data/lib/deprec/templates/{nagios → nagios.old}/check_mongrel_cluster.rb +0 -0
- data/lib/deprec/templates/nagios.old/htpasswd.users +1 -0
- data/lib/deprec/templates/{nagios → nagios.old}/mrtg.cfg +0 -0
- data/lib/deprec/templates/{nagios → nagios.old}/nagios.cfg.erb +0 -0
- data/lib/deprec/templates/{nagios → nagios.old}/nrpe.cfg.erb +0 -0
- data/lib/deprec/templates/{nagios → nagios.old}/nrpe.xinetd.erb +0 -0
- data/lib/deprec/templates/{nagios → nagios.old}/objects/commands.cfg.erb +0 -0
- data/lib/deprec/templates/{nagios → nagios.old}/objects/contacts.cfg.erb +0 -0
- data/lib/deprec/templates/{nagios → nagios.old}/objects/hosts.cfg.erb +0 -0
- data/lib/deprec/templates/{nagios → nagios.old}/objects/localhost.cfg.erb +0 -0
- data/lib/deprec/templates/{nagios → nagios.old}/objects/services.cfg.erb +0 -0
- data/lib/deprec/templates/{nagios → nagios.old}/objects/timeperiods.cfg.erb +0 -0
- data/lib/deprec/templates/{nagios → nagios.old}/resource.cfg.erb +0 -0
- data/lib/deprec/templates/nagios/apache2.conf +55 -0
- data/lib/deprec/templates/nagios/cgi.cfg +25 -0
- data/lib/deprec/templates/nagios/commands.cfg +52 -0
- data/lib/deprec/templates/nagios/conf.d/contacts_nagios2.cfg +23 -0
- data/lib/deprec/templates/nagios/conf.d/extinfo_nagios2.cfg +13 -0
- data/lib/deprec/templates/nagios/conf.d/generic-host_nagios2.cfg +19 -0
- data/lib/deprec/templates/nagios/conf.d/generic-service_nagios2.cfg +26 -0
- data/lib/deprec/templates/nagios/conf.d/hostgroups_nagios2.cfg +48 -0
- data/lib/deprec/templates/nagios/conf.d/hosts/localhost_nagios2.cfg +59 -0
- data/lib/deprec/templates/nagios/conf.d/services_nagios2.cfg +45 -0
- data/lib/deprec/templates/nagios/conf.d/timeperiods_nagios2.cfg +50 -0
- data/lib/deprec/templates/nagios/host_template.erb +6 -0
- data/lib/deprec/templates/nagios/htpasswd.users +1 -1
- data/lib/deprec/templates/nagios/nagios.cfg +1326 -0
- data/lib/deprec/templates/nagios/nrpe.cfg +28 -0
- data/lib/deprec/templates/nagios/resource.cfg +31 -0
- data/lib/deprec/templates/passenger/apache_vhost.erb +2 -2
- data/lib/deprec/templates/passenger/logrotate.conf.erb +1 -1
- data/lib/deprec/templates/passenger/passenger.conf.erb +12 -11
- data/lib/deprec/templates/passenger/passenger.load.erb +1 -1
- metadata +43 -42
- data/lib/deprec/recipes/wordpress.rb +0 -96
@@ -0,0 +1,28 @@
|
|
1
|
+
# Generated by deprec
|
2
|
+
|
3
|
+
log_facility=daemon
|
4
|
+
pid_file=/var/run/nagios/nrpe.pid
|
5
|
+
server_port=5666
|
6
|
+
nrpe_user=nagios
|
7
|
+
nrpe_group=nagios
|
8
|
+
allowed_hosts=localhost,<%= nrpe_allowed_hosts %>
|
9
|
+
dont_blame_nrpe=0
|
10
|
+
debug=0
|
11
|
+
command_timeout=60
|
12
|
+
connection_timeout=300
|
13
|
+
|
14
|
+
command[check_users]=/usr/lib/nagios/plugins/check_users -w 5 -c 10
|
15
|
+
command[check_load]=/usr/lib/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
|
16
|
+
command[check_hda1]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1
|
17
|
+
command[check_zombie_procs]=/usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
|
18
|
+
command[check_all_disks]=/usr/lib/nagios/plugins/check_disk -w 8% -c 5% -A -x /dev/shm -X nfs -i /boot
|
19
|
+
command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 500 -c 800
|
20
|
+
command[check_swap]=/usr/lib/nagios/plugins/check_swap -w '50%' -c '25%'
|
21
|
+
command[check_mem]=/usr/lib/nagios/plugins/check_mem.sh -w 250 -c 150 -p
|
22
|
+
command[check_chef_client]=/usr/lib/nagios/plugins/check_procs -w 1:2 -c 1:2 -C chef-client
|
23
|
+
command[check_smtp]=/usr/lib/nagios/plugins/check_smtp -H
|
24
|
+
command[check_nginx]=/usr/lib/nagios/plugins/check_procs -w 2:3 -c 1:5 -C nginx
|
25
|
+
command[check_sphinx]=/usr/lib/nagios/plugins/check_procs -c 1:1 -C searchd
|
26
|
+
|
27
|
+
include=/etc/nagios/nrpe_local.cfg
|
28
|
+
include_dir=/etc/nagios/nrpe.d/
|
@@ -0,0 +1,31 @@
|
|
1
|
+
###########################################################################
|
2
|
+
#
|
3
|
+
# RESOURCE.CFG - Resource File for Nagios
|
4
|
+
#
|
5
|
+
# You can define $USERx$ macros in this file, which can in turn be used
|
6
|
+
# in command definitions in your host config file(s). $USERx$ macros are
|
7
|
+
# useful for storing sensitive information such as usernames, passwords,
|
8
|
+
# etc. They are also handy for specifying the path to plugins and
|
9
|
+
# event handlers - if you decide to move the plugins or event handlers to
|
10
|
+
# a different directory in the future, you can just update one or two
|
11
|
+
# $USERx$ macros, instead of modifying a lot of command definitions.
|
12
|
+
#
|
13
|
+
# The CGIs will not attempt to read the contents of resource files, so
|
14
|
+
# you can set restrictive permissions (600 or 660) on them.
|
15
|
+
#
|
16
|
+
# Nagios supports up to 32 $USERx$ macros ($USER1$ through $USER32$)
|
17
|
+
#
|
18
|
+
# Resource files may also be used to store configuration directives for
|
19
|
+
# external data sources like MySQL...
|
20
|
+
#
|
21
|
+
###########################################################################
|
22
|
+
|
23
|
+
# Sets $USER1$ to be the path to the plugins
|
24
|
+
$USER1$=/usr/lib/nagios/plugins
|
25
|
+
|
26
|
+
# Sets $USER2$ to be the path to event handlers
|
27
|
+
#$USER2$=/usr/lib/nagios/plugins/eventhandlers
|
28
|
+
|
29
|
+
# Store some usernames and passwords (hidden from the CGIs)
|
30
|
+
#$USER3$=someuser
|
31
|
+
#$USER4$=somepassword
|
@@ -9,8 +9,8 @@
|
|
9
9
|
CustomLog <%= apache_log_dir %>/<%= application %>-access.log combined
|
10
10
|
ErrorLog <%= apache_log_dir %>/<%= application %>-error.log
|
11
11
|
|
12
|
-
RackEnv <%=
|
13
|
-
RailsEnv <%=
|
12
|
+
RackEnv <%= rack_env %>
|
13
|
+
RailsEnv <%= rack_env %>
|
14
14
|
# RailsAllowModRewrite <%= passenger_rails_allow_mod_rewrite %>
|
15
15
|
#
|
16
16
|
# Check for maintenance file and redirect all requests
|
@@ -3,19 +3,20 @@
|
|
3
3
|
# http://www.modrails.com/documentation/Users%20guide.html#_configuring_phusion_passenger
|
4
4
|
<IfModule passenger_module>
|
5
5
|
|
6
|
-
PassengerRoot <%=
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
PassengerRoot <%= passenger_root %>
|
7
|
+
PassengerRuby <%= passenger_ruby %>
|
8
|
+
|
9
|
+
# PassengerLogLevel <%= passenger_log_level %>
|
10
|
+
# PassengerUserSwitching <%= passenger_user_switching %>
|
11
|
+
# PassengerDefaultUser <%= passenger_default_user %>
|
12
|
+
# PassengerMaxPoolSize <%= passenger_max_pool_size %>
|
13
|
+
# PassengerMaxInstancesPerApp <%= passenger_max_instances_per_app %>
|
14
|
+
# PassengerPoolIdleTime <%= passenger_pool_idle_time %>
|
14
15
|
|
15
16
|
# Ruby on Rails Options
|
16
17
|
|
17
|
-
RailsAutoDetect <%= passenger_rails_autodetect %>
|
18
|
-
RailsSpawnMethod <%= passenger_rails_spawn_method %>
|
18
|
+
# RailsAutoDetect <%= passenger_rails_autodetect %>
|
19
|
+
# RailsSpawnMethod <%= passenger_rails_spawn_method %>
|
19
20
|
|
20
|
-
NameVirtualHost *:80
|
21
|
+
# NameVirtualHost *:80
|
21
22
|
</IfModule>
|
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deprec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 45
|
5
4
|
prerelease:
|
6
|
-
|
7
|
-
- 2
|
8
|
-
- 1
|
9
|
-
- 19
|
10
|
-
version: 2.1.19
|
5
|
+
version: 2.2.0
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Mike Bailey
|
@@ -15,8 +10,7 @@ autorequire:
|
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
12
|
|
18
|
-
date: 2011-
|
19
|
-
default_executable: depify
|
13
|
+
date: 2011-07-10 00:00:00 Z
|
20
14
|
dependencies:
|
21
15
|
- !ruby/object:Gem::Dependency
|
22
16
|
name: capistrano
|
@@ -26,11 +20,6 @@ dependencies:
|
|
26
20
|
requirements:
|
27
21
|
- - ">"
|
28
22
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 27
|
30
|
-
segments:
|
31
|
-
- 2
|
32
|
-
- 5
|
33
|
-
- 0
|
34
23
|
version: 2.5.0
|
35
24
|
type: :runtime
|
36
25
|
version_requirements: *id001
|
@@ -42,11 +31,6 @@ dependencies:
|
|
42
31
|
requirements:
|
43
32
|
- - ">="
|
44
33
|
- !ruby/object:Gem::Version
|
45
|
-
hash: 29
|
46
|
-
segments:
|
47
|
-
- 1
|
48
|
-
- 2
|
49
|
-
- 1
|
50
34
|
version: 1.2.1
|
51
35
|
type: :runtime
|
52
36
|
version_requirements: *id002
|
@@ -59,6 +43,7 @@ extensions: []
|
|
59
43
|
extra_rdoc_files: []
|
60
44
|
|
61
45
|
files:
|
46
|
+
- bin/hosts.rb
|
62
47
|
- bin/depify
|
63
48
|
- docs/README.rails
|
64
49
|
- docs/config_gen_explained.txt
|
@@ -71,6 +56,7 @@ files:
|
|
71
56
|
- docs/xen/xen-tools-notes.txt
|
72
57
|
- docs/xen/xen_on_hardy.txt
|
73
58
|
- docs/xen/traffic_monitoring_with_vnstat.txt
|
59
|
+
- docs/nagios.txt
|
74
60
|
- lib/deprec_cmd_completion.sh
|
75
61
|
- lib/deprec_minus_rails.rb
|
76
62
|
- lib/deprec/recipes.rb
|
@@ -80,6 +66,7 @@ files:
|
|
80
66
|
- lib/deprec/recipes/ddclient.rb
|
81
67
|
- lib/deprec/recipes/wpmu.rb
|
82
68
|
- lib/deprec/recipes/collectd.rb
|
69
|
+
- lib/deprec/recipes/nrpe.rb
|
83
70
|
- lib/deprec/recipes/ntp.rb
|
84
71
|
- lib/deprec/recipes/ssh.rb
|
85
72
|
- lib/deprec/recipes/bash.rb
|
@@ -90,12 +77,14 @@ files:
|
|
90
77
|
- lib/deprec/recipes/couchdb.rb
|
91
78
|
- lib/deprec/recipes/lvm.rb
|
92
79
|
- lib/deprec/recipes/syslog.rb
|
80
|
+
- lib/deprec/recipes/rack.rb
|
93
81
|
- lib/deprec/recipes/utils.rb
|
94
82
|
- lib/deprec/recipes/php.rb
|
95
83
|
- lib/deprec/recipes/canonical.rb
|
96
84
|
- lib/deprec/recipes/mongrel.rb
|
97
85
|
- lib/deprec/recipes/heartbeat.rb
|
98
86
|
- lib/deprec/recipes/passenger.rb
|
87
|
+
- lib/deprec/recipes/nagios3.rb
|
99
88
|
- lib/deprec/recipes/sqlite.rb
|
100
89
|
- lib/deprec/recipes/ar_sendmail.rb
|
101
90
|
- lib/deprec/recipes/trac.rb
|
@@ -106,6 +95,7 @@ files:
|
|
106
95
|
- lib/deprec/recipes/ubuntu.rb
|
107
96
|
- lib/deprec/recipes/ree.rb
|
108
97
|
- lib/deprec/recipes/syslog_ng.rb
|
98
|
+
- lib/deprec/recipes/rubygems.rb
|
109
99
|
- lib/deprec/recipes/mysql.rb
|
110
100
|
- lib/deprec/recipes/ec2.rb
|
111
101
|
- lib/deprec/recipes/sphinx.rb
|
@@ -119,7 +109,6 @@ files:
|
|
119
109
|
- lib/deprec/recipes/apache.rb
|
120
110
|
- lib/deprec/recipes/svn.rb
|
121
111
|
- lib/deprec/recipes/users.rb
|
122
|
-
- lib/deprec/recipes/wordpress.rb
|
123
112
|
- lib/deprec/recipes/postfix.rb
|
124
113
|
- lib/deprec/recipes/haproxy.rb
|
125
114
|
- lib/deprec/recipes/xentools.rb
|
@@ -180,6 +169,23 @@ files:
|
|
180
169
|
- lib/deprec/templates/haproxy/haproxy-init.d
|
181
170
|
- lib/deprec/templates/haproxy/haproxy.cfg.erb
|
182
171
|
- lib/deprec/templates/ntp/ntp.conf.erb
|
172
|
+
- lib/deprec/templates/nagios.old/README
|
173
|
+
- lib/deprec/templates/nagios.old/cgi.cfg.erb
|
174
|
+
- lib/deprec/templates/nagios.old/resource.cfg.erb
|
175
|
+
- lib/deprec/templates/nagios.old/htpasswd.users
|
176
|
+
- lib/deprec/templates/nagios.old/nagios.cfg.erb
|
177
|
+
- lib/deprec/templates/nagios.old/check_mongrel_cluster.rb
|
178
|
+
- lib/deprec/templates/nagios.old/nrpe.cfg.erb
|
179
|
+
- lib/deprec/templates/nagios.old/check_linux_free_memory.pl
|
180
|
+
- lib/deprec/templates/nagios.old/objects/timeperiods.cfg.erb
|
181
|
+
- lib/deprec/templates/nagios.old/objects/services.cfg.erb
|
182
|
+
- lib/deprec/templates/nagios.old/objects/localhost.cfg.erb
|
183
|
+
- lib/deprec/templates/nagios.old/objects/commands.cfg.erb
|
184
|
+
- lib/deprec/templates/nagios.old/objects/hosts.cfg.erb
|
185
|
+
- lib/deprec/templates/nagios.old/objects/contacts.cfg.erb
|
186
|
+
- lib/deprec/templates/nagios.old/apache_vhost.erb
|
187
|
+
- lib/deprec/templates/nagios.old/mrtg.cfg
|
188
|
+
- lib/deprec/templates/nagios.old/nrpe.xinetd.erb
|
183
189
|
- lib/deprec/templates/vnstat/config.php
|
184
190
|
- lib/deprec/templates/syslog/syslog.conf.erb
|
185
191
|
- lib/deprec/templates/syslog/syslogd.erb
|
@@ -205,6 +211,7 @@ files:
|
|
205
211
|
- lib/deprec/templates/apache/ports.conf.erb
|
206
212
|
- lib/deprec/templates/apache/apache2.conf.erb
|
207
213
|
- lib/deprec/templates/apache/namevirtualhosts.conf
|
214
|
+
- lib/deprec/templates/apache/CHANGES.txt
|
208
215
|
- lib/deprec/templates/apache/vhost.erb
|
209
216
|
- lib/deprec/templates/apache/default.erb
|
210
217
|
- lib/deprec/templates/deprec/caprc.erb
|
@@ -220,22 +227,23 @@ files:
|
|
220
227
|
- lib/deprec/templates/syslog_ng/syslog-ng.conf-client
|
221
228
|
- lib/deprec/templates/ssh/sshd_config.erb
|
222
229
|
- lib/deprec/templates/ssh/ssh_config.erb
|
223
|
-
- lib/deprec/templates/nagios/
|
224
|
-
- lib/deprec/templates/nagios/
|
225
|
-
- lib/deprec/templates/nagios/
|
230
|
+
- lib/deprec/templates/nagios/nrpe.cfg
|
231
|
+
- lib/deprec/templates/nagios/resource.cfg
|
232
|
+
- lib/deprec/templates/nagios/host_template.erb
|
233
|
+
- lib/deprec/templates/nagios/conf.d/timeperiods_nagios2.cfg
|
234
|
+
- lib/deprec/templates/nagios/conf.d/extinfo_nagios2.cfg
|
235
|
+
- lib/deprec/templates/nagios/conf.d/contacts_nagios2.cfg
|
236
|
+
- lib/deprec/templates/nagios/conf.d/services_nagios2.cfg
|
237
|
+
- lib/deprec/templates/nagios/conf.d/hostgroups_nagios2.cfg
|
238
|
+
- lib/deprec/templates/nagios/conf.d/generic-host_nagios2.cfg
|
239
|
+
- lib/deprec/templates/nagios/conf.d/hosts/localhost_nagios2.cfg
|
240
|
+
- lib/deprec/templates/nagios/conf.d/generic-service_nagios2.cfg
|
226
241
|
- lib/deprec/templates/nagios/htpasswd.users
|
227
|
-
- lib/deprec/templates/nagios/
|
228
|
-
- lib/deprec/templates/nagios/
|
229
|
-
- lib/deprec/templates/nagios/
|
242
|
+
- lib/deprec/templates/nagios/commands.cfg
|
243
|
+
- lib/deprec/templates/nagios/nagios.cfg
|
244
|
+
- lib/deprec/templates/nagios/cgi.cfg
|
230
245
|
- lib/deprec/templates/nagios/check_linux_free_memory.pl
|
231
|
-
- lib/deprec/templates/nagios/
|
232
|
-
- lib/deprec/templates/nagios/objects/services.cfg.erb
|
233
|
-
- lib/deprec/templates/nagios/objects/localhost.cfg.erb
|
234
|
-
- lib/deprec/templates/nagios/objects/commands.cfg.erb
|
235
|
-
- lib/deprec/templates/nagios/objects/hosts.cfg.erb
|
236
|
-
- lib/deprec/templates/nagios/objects/contacts.cfg.erb
|
237
|
-
- lib/deprec/templates/nagios/mrtg.cfg
|
238
|
-
- lib/deprec/templates/nagios/nrpe.xinetd.erb
|
246
|
+
- lib/deprec/templates/nagios/apache2.conf
|
239
247
|
- lib/deprec/templates/mysql/create_databases.sql
|
240
248
|
- lib/deprec/templates/mysql/sphinx.conf.stage
|
241
249
|
- lib/deprec/templates/mysql/database.yml.prod
|
@@ -255,9 +263,8 @@ files:
|
|
255
263
|
- CHANGELOG
|
256
264
|
- COPYING
|
257
265
|
- LICENSE
|
258
|
-
- README
|
266
|
+
- README.md
|
259
267
|
- THANKS
|
260
|
-
has_rdoc: true
|
261
268
|
homepage: http://www.deprec.org/
|
262
269
|
licenses: []
|
263
270
|
|
@@ -271,23 +278,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
271
278
|
requirements:
|
272
279
|
- - ">="
|
273
280
|
- !ruby/object:Gem::Version
|
274
|
-
hash: 3
|
275
|
-
segments:
|
276
|
-
- 0
|
277
281
|
version: "0"
|
278
282
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
279
283
|
none: false
|
280
284
|
requirements:
|
281
285
|
- - ">="
|
282
286
|
- !ruby/object:Gem::Version
|
283
|
-
hash: 3
|
284
|
-
segments:
|
285
|
-
- 0
|
286
287
|
version: "0"
|
287
288
|
requirements: []
|
288
289
|
|
289
290
|
rubyforge_project: deprec
|
290
|
-
rubygems_version: 1.5
|
291
|
+
rubygems_version: 1.8.5
|
291
292
|
signing_key:
|
292
293
|
specification_version: 3
|
293
294
|
summary: deployment recipes for capistrano
|
@@ -1,96 +0,0 @@
|
|
1
|
-
# Copyright 2006-2008 by Mike Bailey. All rights reserved.
|
2
|
-
Capistrano::Configuration.instance(:must_exist).load do
|
3
|
-
|
4
|
-
require 'digest'
|
5
|
-
|
6
|
-
default :application, 'wordpress'
|
7
|
-
set(:wordpress_domain) { Capistrano::CLI.ui.ask 'Enter domain wordpress will be served on' }
|
8
|
-
set :db_name, 'wordpress'
|
9
|
-
set :db_user, 'wordpress'
|
10
|
-
set(:db_pass) { Capistrano::CLI.ui.ask 'Enter db password for wordpress' }
|
11
|
-
set(:db_host) { Capistrano::CLI.ui.ask 'Enter db hostname for wordpress' }
|
12
|
-
set :db_charset, 'utf8'
|
13
|
-
set :db_collate, ''
|
14
|
-
|
15
|
-
set(:auth_key) { Digest::SHA1.hexdigest srand.to_s }
|
16
|
-
set(:secure_auth_key) { Digest::SHA1.hexdigest srand.to_s }
|
17
|
-
set(:logged_in_key) { Digest::SHA1.hexdigest srand.to_s }
|
18
|
-
|
19
|
-
set(:wordpress_install_dir) { "#{deploy_to}/public" }
|
20
|
-
|
21
|
-
|
22
|
-
namespace :deprec do
|
23
|
-
namespace :wordpress do
|
24
|
-
|
25
|
-
SRC_PACKAGES[:wordpress] =
|
26
|
-
{
|
27
|
-
:url => "http://wordpress.org/latest.tar.gz",
|
28
|
-
:dir => 'wordpress'
|
29
|
-
}
|
30
|
-
|
31
|
-
desc "Install Wordpress"
|
32
|
-
task :install do
|
33
|
-
install_deps unless ENV['SKIP_DEPS'] # save time by skipping deps (when reinstalling)
|
34
|
-
deprec2.download_src(SRC_PACKAGES[:wordpress], src_dir)
|
35
|
-
deprec2.unpack_src(SRC_PACKAGES[:wordpress], src_dir)
|
36
|
-
deprec2.mkdir wordpress_install_dir, :via => :sudo
|
37
|
-
sudo "cp -r #{src_dir}/wordpress/* #{wordpress_install_dir}/"
|
38
|
-
end
|
39
|
-
|
40
|
-
task :install_deps do
|
41
|
-
top.deprec.apache.install
|
42
|
-
top.deprec.php.install
|
43
|
-
end
|
44
|
-
|
45
|
-
PROJECT_CONFIG_FILES[:wordpress] = [
|
46
|
-
|
47
|
-
{:template => "wp-config.php.erb",
|
48
|
-
:path => 'wp-config.php',
|
49
|
-
:mode => 0755,
|
50
|
-
:owner => 'root:root'},
|
51
|
-
|
52
|
-
{:template => "apache2_wordpress_vhost.conf.erb",
|
53
|
-
:path => 'apache2_wordpress_vhost.conf',
|
54
|
-
:mode => 0755,
|
55
|
-
:owner => 'root:root'}
|
56
|
-
|
57
|
-
]
|
58
|
-
|
59
|
-
desc "Generate configuration file(s) for mongrel from template(s)"
|
60
|
-
task :config_gen do
|
61
|
-
config_gen_project
|
62
|
-
end
|
63
|
-
|
64
|
-
task :config_gen_project do
|
65
|
-
PROJECT_CONFIG_FILES[:wordpress].each do |file|
|
66
|
-
deprec2.render_template(:wordpress, file)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
desc "Push wordpress config files to server"
|
71
|
-
task :config, :roles => :wordpress do
|
72
|
-
config_project
|
73
|
-
end
|
74
|
-
|
75
|
-
task :config_project, :roles => :wordpress do
|
76
|
-
deprec2.push_configs(:wordpress, PROJECT_CONFIG_FILES[:wordpress])
|
77
|
-
sudo "ln -sf #{deploy_to}/wordpress/wp-config.php #{wordpress_install_dir}/wp-config.php"
|
78
|
-
sudo "ln -sf #{deploy_to}/wordpress/apache2_wordpress_vhost.conf #{apache_vhost_dir}/#{application}.conf"
|
79
|
-
end
|
80
|
-
|
81
|
-
desc <<-EOF
|
82
|
-
Create a database for WordPress on your web server, as well as
|
83
|
-
a MySQL user who has all privileges for accessing and modifying it.
|
84
|
-
EOF
|
85
|
-
task :create_database, :roles => lambda { db_host } do
|
86
|
-
run <<-EOF
|
87
|
-
mysql -u root -e 'create database #{DB_NAME}'
|
88
|
-
mysql -u root -e 'grant all on #{DB_NAME}.* to '#{DB_USER}'@'%' identified by '#{DB_PASSWORD}'
|
89
|
-
mysql -u root -e 'flush privileges'
|
90
|
-
EOF
|
91
|
-
end
|
92
|
-
|
93
|
-
end
|
94
|
-
end
|
95
|
-
|
96
|
-
end
|