magic_recipes_two 0.0.25 → 0.0.26
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.
- checksums.yaml +4 -4
- data/lib/capistrano/magic_recipes/version.rb +1 -1
- data/lib/capistrano/tasks/monit.rake +23 -20
- data/lib/capistrano/tasks/nginx.rake +11 -1
- data/lib/capistrano/tasks/thin.rake +12 -2
- data/lib/generators/capistrano/magic_recipes/templates/monit/monitrc.erb +5 -7
- data/lib/generators/capistrano/magic_recipes/templates/monit/thin.erb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4f9505d5b722c1501903912e12ada771884aa03
|
4
|
+
data.tar.gz: 9320a6d1a5d8ebff1f57441517f540a74fe2f390
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0dbf4d5a541f8673c9acb39e085b3e4963cfb7e0649dd6895a3a0b45846a14a5d380a0d3d051c12982a6899a3b5fc0f6e5cfa630ca2b8d2f82b2d210136bdb2
|
7
|
+
data.tar.gz: ba065981aed2ad19f29f80721f4b78e4f577f10ba37c4279ebe9c331acc7f556821c79c16235fcdbd04cc7c9db82c2f1360b638eaeac2f0f4a1d1429a7846bf9
|
@@ -3,30 +3,33 @@ include Capistrano::MagicRecipes::BaseHelpers
|
|
3
3
|
|
4
4
|
namespace :load do
|
5
5
|
task :defaults do
|
6
|
-
set :monit_roles,
|
7
|
-
set :monit_interval,
|
8
|
-
set :monit_bin,
|
6
|
+
set :monit_roles, -> { :web }
|
7
|
+
set :monit_interval, -> { 30 }
|
8
|
+
set :monit_bin, -> { '/usr/bin/monit' }
|
9
|
+
set :monit_logfile, -> { '/var/log/monit.log' }
|
10
|
+
set :monit_idfile, -> { '/var/lib/monit/id' }
|
11
|
+
set :monit_statefile, -> { '/var/lib/monit/state' }
|
9
12
|
## Mailer
|
10
|
-
set :monit_mail_server,
|
11
|
-
set :monit_mail_port,
|
12
|
-
set :monit_mail_authentication,
|
13
|
-
set :monit_mail_username,
|
14
|
-
set :monit_mail_password,
|
15
|
-
set :monit_mail_to,
|
16
|
-
set :monit_mail_from,
|
17
|
-
set :monit_mail_reply_to,
|
13
|
+
set :monit_mail_server, -> { "smtp.gmail.com" }
|
14
|
+
set :monit_mail_port, -> { 587 }
|
15
|
+
set :monit_mail_authentication, -> { false } # SSLAUTO|SSLV2|SSLV3|TLSV1|TLSV11|TLSV12
|
16
|
+
set :monit_mail_username, -> { "foo@example.com" }
|
17
|
+
set :monit_mail_password, -> { "secret" }
|
18
|
+
set :monit_mail_to, -> { "foo@example.com" }
|
19
|
+
set :monit_mail_from, -> { "monit@foo.bar" }
|
20
|
+
set :monit_mail_reply_to, -> { "support@foo.bar" }
|
18
21
|
## Additional stuff for postrgres
|
19
|
-
set :postgresql_roles,
|
20
|
-
set :postgresql_pid,
|
22
|
+
set :postgresql_roles, -> { :db }
|
23
|
+
set :postgresql_pid, -> { "/var/run/postgresql/9.1-main.pid" }
|
21
24
|
## WebClient
|
22
|
-
set :monit_http_client,
|
23
|
-
set :monit_http_domain,
|
24
|
-
set :monit_http_port,
|
25
|
-
set :monit_http_use_ssl,
|
25
|
+
set :monit_http_client, -> { true }
|
26
|
+
set :monit_http_domain, -> { false }
|
27
|
+
set :monit_http_port, -> { 2812 }
|
28
|
+
set :monit_http_use_ssl, -> { false }
|
26
29
|
set :monit_http_allow_self_certification, -> { false }
|
27
|
-
set :monit_http_pemfile,
|
28
|
-
set :monit_http_username,
|
29
|
-
set :monit_http_password,
|
30
|
+
set :monit_http_pemfile, -> { "/etc/monit/monit.pem" }
|
31
|
+
set :monit_http_username, -> { "admin" }
|
32
|
+
set :monit_http_password, -> { "monitor" }
|
30
33
|
##v Website
|
31
34
|
end
|
32
35
|
end
|
@@ -130,4 +130,14 @@ namespace :nginx do
|
|
130
130
|
end
|
131
131
|
end
|
132
132
|
end
|
133
|
-
end
|
133
|
+
end
|
134
|
+
|
135
|
+
|
136
|
+
namespace :deploy do
|
137
|
+
after 'deploy:finished', :restart_nginx_app do
|
138
|
+
invoke "nginx:site:add"
|
139
|
+
invoke "nginx:site:enable"
|
140
|
+
invoke "nginx:restart"
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
@@ -48,9 +48,19 @@ namespace :thin do
|
|
48
48
|
|
49
49
|
end
|
50
50
|
|
51
|
-
|
52
|
-
|
51
|
+
|
52
|
+
# => after 'deploy:published', nil do
|
53
|
+
# => on release_roles fetch(:thin_roles) do
|
54
|
+
# => invoke "thin:reconf"
|
55
|
+
# => invoke "thin:restart"
|
56
|
+
# => end
|
57
|
+
# => end
|
58
|
+
|
59
|
+
|
60
|
+
namespace :deploy do
|
61
|
+
before 'deploy:finished', :restart_thin_apps do
|
53
62
|
invoke "thin:reconf"
|
54
63
|
invoke "thin:restart"
|
55
64
|
end
|
56
65
|
end
|
66
|
+
|
@@ -1,8 +1,8 @@
|
|
1
1
|
set daemon <%= fetch(:monit_interval) %>
|
2
2
|
|
3
|
-
set logfile
|
4
|
-
set idfile
|
5
|
-
set statefile
|
3
|
+
set logfile <%= fetch(:monit_logfile) %>
|
4
|
+
set idfile <%= fetch(:monit_idfile) %>
|
5
|
+
set statefile <%= fetch(:monit_statefile) %>
|
6
6
|
|
7
7
|
set eventqueue
|
8
8
|
basedir /var/lib/monit/events
|
@@ -26,9 +26,9 @@ set mail-format {
|
|
26
26
|
M O N I T
|
27
27
|
|
28
28
|
<% if fetch(:monit_http_client) %><% if fetch(:monit_http_domain) %>
|
29
|
-
Web: <%= fetch(:monit_http_use_ssl) ? "https" : "http" %>://<%= fetch(:monit_http_domain)
|
29
|
+
Web: <%= fetch(:monit_http_use_ssl) ? "https" : "http" %>://<%= fetch(:monit_http_domain) %>:<%= fetch(:monit_http_port) %>/
|
30
30
|
<% else %>
|
31
|
-
Web: <%= fetch(:monit_http_use_ssl) ? "https" : "http" %>://<%= fetch(:app_server_ip)
|
31
|
+
Web: <%= fetch(:monit_http_use_ssl) ? "https" : "http" %>://<%= fetch(:app_server_ip) %>:<%= fetch(:monit_http_port) %>/
|
32
32
|
<% end %><% end %>
|
33
33
|
}
|
34
34
|
|
@@ -46,8 +46,6 @@ set httpd port <%= fetch(:monit_http_port) %>
|
|
46
46
|
<% if fetch(:monit_http_domain) %>
|
47
47
|
use address <%= fetch(:monit_http_domain) %>
|
48
48
|
<% end %>
|
49
|
-
# allow careagents.cloudapp.net
|
50
|
-
# allow 191.233.74.184
|
51
49
|
# allow 127.0.0.1
|
52
50
|
<% if fetch(:monit_http_use_ssl) %>
|
53
51
|
ssl enable
|
@@ -3,8 +3,8 @@
|
|
3
3
|
check process <%= fetch(:application) %>_<%= fetch(:stage) %>_thin_<%= n %> with pidfile <%= deploy_to %>/shared/pids/thin_<%= fetch(:application) %>_<%= fetch(:stage) %>.<%= n %>.pid
|
4
4
|
group thin-<%= fetch(:application) %>
|
5
5
|
group thin-<%= fetch(:stage) %>
|
6
|
-
start program = "/bin/su - <%=
|
7
|
-
stop program = "/bin/su - <%=
|
6
|
+
start program = "/bin/su - <%= @role.user %> -c 'cd <%= current_path %> ; bundle exec thin start -C config/thin_app_<%= fetch(:stage) %>.yml -o <%= n %>' "
|
7
|
+
stop program = "/bin/su - <%= @role.user %> -c 'cd <%= current_path %> ; bundle exec thin stop -C config/thin_app_<%= fetch(:stage) %>.yml -o <%= n %>' "
|
8
8
|
if mem > 200.0 MB for 1 cycles then restart
|
9
9
|
if cpu > 50% for 3 cycles then restart
|
10
10
|
if 5 restarts within 5 cycles then timeout
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: magic_recipes_two
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Torsten Wetzel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|