le1t0-deprec 2.1.6.029 → 2.1.6.030
Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG
CHANGED
data/lib/deprec/recipes/rails.rb
CHANGED
@@ -35,10 +35,12 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
35
35
|
end
|
36
36
|
|
37
37
|
before 'deploy:migrate' do
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
if exists?(:running_cold_deploy) && running_cold_deploy
|
39
|
+
unless ENV['DO_SEED']
|
40
|
+
top.deprec.rails.database.create
|
41
|
+
else
|
42
|
+
top.deprec.rails.database.seed
|
43
|
+
end
|
42
44
|
end
|
43
45
|
end
|
44
46
|
|
File without changes
|
@@ -0,0 +1,156 @@
|
|
1
|
+
# Copyright 2010 by le1t0@github. All rights reserved.
|
2
|
+
Capistrano::Configuration.instance(:must_exist).load do
|
3
|
+
namespace :deprec do
|
4
|
+
namespace :syslog_ng do
|
5
|
+
|
6
|
+
set :syslog_ng_server, nil
|
7
|
+
set :syslog_ng_server_port, 5140
|
8
|
+
set :syslog_ng_is_server, false # set this option to true if the server(s) mentioned in your recipe are syslog servers
|
9
|
+
set :syslog_ng_server_max_connections, 100
|
10
|
+
|
11
|
+
set :syslog_ng_options, {
|
12
|
+
:chain_hostnames => 0,
|
13
|
+
:time_reopen => 10,
|
14
|
+
:time_reap => 360,
|
15
|
+
#:sync => 0,
|
16
|
+
:log_fifo_size => 2048,
|
17
|
+
:create_dirs => :yes,
|
18
|
+
#:owner => :root,
|
19
|
+
:group => :adm,
|
20
|
+
:perm => :"0640",
|
21
|
+
#:dir_owner => :root,
|
22
|
+
#:dir_group => :root,
|
23
|
+
:dir_perm => :"0755",
|
24
|
+
:use_dns => :no,
|
25
|
+
#:log_msg_size => 2048,
|
26
|
+
:stats_freq => 0,
|
27
|
+
:bad_hostname => :"^gconfd$",
|
28
|
+
}
|
29
|
+
set :syslog_ng_logs, {
|
30
|
+
:s_all => {
|
31
|
+
:df_auth => :f_auth,
|
32
|
+
:df_syslog => :f_syslog,
|
33
|
+
:df_cron => :f_cron,
|
34
|
+
:df_daemon => :f_daemon,
|
35
|
+
:df_kern => :f_kern,
|
36
|
+
:df_lpr => :f_lpr,
|
37
|
+
:df_mail => :f_mail,
|
38
|
+
:df_user => :f_user,
|
39
|
+
:df_uucp => :f_uucp,
|
40
|
+
:df_facility_dot_info => [ :f_mail, :f_at_least_info ],
|
41
|
+
:df_facility_dot_warn => [ :f_mail, :f_at_least_warn ],
|
42
|
+
:df_facility_dot_err => [ :f_mail, :f_at_least_err ],
|
43
|
+
:df_news_dot_crit => [ :f_news, :f_at_least_crit ],
|
44
|
+
:df_news_dot_err => [ :f_news, :f_at_least_err ],
|
45
|
+
:df_news_dot_notice => [ :f_news, :f_at_least_notice ],
|
46
|
+
:df_debug => :f_debug,
|
47
|
+
:df_messages => :f_messages,
|
48
|
+
:du_all => :f_emerg,
|
49
|
+
:dp_xconsole => :f_xconsole
|
50
|
+
}
|
51
|
+
}
|
52
|
+
set :syslog_ng_sources, {
|
53
|
+
:s_all => [
|
54
|
+
"internal()",
|
55
|
+
"unix-stream(/dev/log)",
|
56
|
+
"file(\"/proc/kmsg\" log_prefix(\"kernel: \"))"
|
57
|
+
]
|
58
|
+
}
|
59
|
+
set :syslog_ng_filters, {
|
60
|
+
:f_auth => "facility(auth, authpriv)",
|
61
|
+
:f_syslog => "not facility(auth, authpriv)",
|
62
|
+
:f_cron => "facility(cron)",
|
63
|
+
:f_daemon => "facility(daemon)",
|
64
|
+
:f_kern => "facility(kern)",
|
65
|
+
:f_lpr => "facility(lpr)",
|
66
|
+
:f_mail => "facility(mail)",
|
67
|
+
:f_news => "facility(news)",
|
68
|
+
:f_user => "facility(user)",
|
69
|
+
:f_uucp => "facility(uucp)",
|
70
|
+
:f_at_least_info => "level(info..emerg)",
|
71
|
+
:f_at_least_notice => "level(notice..emerg)",
|
72
|
+
:f_at_least_warn => "level(warn..emerg)",
|
73
|
+
:f_at_least_err => "level(err..emerg)",
|
74
|
+
:f_at_least_crit => "level(crit..emerg)",
|
75
|
+
:f_debug => "level(debug) and not facility(auth, authpriv, news, mail)",
|
76
|
+
:f_messages => "level(info,notice,warn) and not facility(auth,authpriv,cron,daemon,mail,news)",
|
77
|
+
:f_emerg => "level(emerg)",
|
78
|
+
:f_xconsole => "facility(daemon,mail) or level(debug,info,notice,warn) or (facility(news) and level(crit,err,notice))",
|
79
|
+
:f_daemons => "program(\"(rails|apache|postfix|haproxy|mysql|keepalived|sphinx|firewall)-.*\")"
|
80
|
+
}
|
81
|
+
set :syslog_ng_destinations, {
|
82
|
+
:df_auth => "file(\"/var/log/auth.log\")",
|
83
|
+
:df_syslog => "file(\"/var/log/syslog\")",
|
84
|
+
:df_cron => "file(\"/var/log/cron.log\")",
|
85
|
+
:df_daemon => "file(\"/var/log/daemon.log\")",
|
86
|
+
:df_kern => "file(\"/var/log/kern.log\")",
|
87
|
+
:df_lpr => "file(\"/var/log/lpr.log\")",
|
88
|
+
:df_mail => "file(\"/var/log/mail.log\")",
|
89
|
+
:df_user => "file(\"/var/log/user.log\")",
|
90
|
+
:df_uucp => "file(\"/var/log/uucp.log\")",
|
91
|
+
:df_facility_dot_info => "file(\"/var/log/$FACILITY.info\")",
|
92
|
+
:df_facility_dot_notice => "file(\"/var/log/$FACILITY.notice\")",
|
93
|
+
:df_facility_dot_warn => "file(\"/var/log/$FACILITY.warn\")",
|
94
|
+
:df_facility_dot_err => "file(\"/var/log/$FACILITY.err\")",
|
95
|
+
:df_facility_dot_crit => "file(\"/var/log/$FACILITY.crit\")",
|
96
|
+
:df_news_dot_notice => "file(\"/var/log/news/news.notice\" owner(\"news\"))",
|
97
|
+
:df_news_dot_err => "file(\"/var/log/news/news.err\" owner(\"news\"))",
|
98
|
+
:df_news_dot_crit => "file(\"/var/log/news/news.crit\" owner(\"news\"))",
|
99
|
+
:df_debug => "file(\"/var/log/debug\")",
|
100
|
+
:df_messages => "file(\"/var/log/messages\")",
|
101
|
+
:dp_xconsole => "pipe(\"/dev/xconsole\")",
|
102
|
+
:du_all => "usertty(\"*\")",
|
103
|
+
:df_daemons => "file(\"/var/log/daemons/$PROGRAM/$YEAR$MONTH/$DAY/$PROGRAM-$YEAR$MONTH$DAY\")"
|
104
|
+
}
|
105
|
+
|
106
|
+
desc "Install syslog-ng"
|
107
|
+
task :install do
|
108
|
+
install_deps
|
109
|
+
end
|
110
|
+
|
111
|
+
# install dependencies for syslog-ng
|
112
|
+
task :install_deps do
|
113
|
+
apt.install( {:base => %w(syslog-ng)}, :stable )
|
114
|
+
end
|
115
|
+
|
116
|
+
SYSTEM_CONFIG_FILES[:syslog_ng] = [
|
117
|
+
|
118
|
+
{ :template => 'syslog-ng.conf.erb',
|
119
|
+
:path => '/etc/syslog-ng/syslog-ng.conf',
|
120
|
+
:mode => 0644,
|
121
|
+
:owner => 'root:root'}
|
122
|
+
|
123
|
+
]
|
124
|
+
|
125
|
+
desc "Generate Syslog-ng configs"
|
126
|
+
task :config_gen do
|
127
|
+
SYSTEM_CONFIG_FILES[:syslog_ng].each do |file|
|
128
|
+
deprec2.render_template(:syslog_ng, file)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
desc "Push Syslog-ng config files to server"
|
133
|
+
task :config, :roles => :all_hosts do
|
134
|
+
deprec2.push_configs(:syslog_ng, SYSTEM_CONFIG_FILES[:syslog_ng])
|
135
|
+
restart
|
136
|
+
end
|
137
|
+
|
138
|
+
desc "Start Syslog-ng"
|
139
|
+
task :start, :roles => :all_hosts do
|
140
|
+
run "#{sudo} /etc/init.d/syslog-ng start"
|
141
|
+
end
|
142
|
+
|
143
|
+
desc "Stop Syslog-ng"
|
144
|
+
task :stop, :roles => :all_hosts do
|
145
|
+
run "#{sudo} /etc/init.d/syslog-ng stop"
|
146
|
+
end
|
147
|
+
|
148
|
+
desc "Restart Syslog-ng"
|
149
|
+
task :restart, :roles => :all_hosts do
|
150
|
+
run "#{sudo} /etc/init.d/syslog-ng restart"
|
151
|
+
end
|
152
|
+
|
153
|
+
end
|
154
|
+
|
155
|
+
end
|
156
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
options {<% syslog_ng_options.reverse_merge(syslog_ng_is_server ? {
|
2
|
+
:keep_hostname => :yes
|
3
|
+
} : {}).each do |key, value| %>
|
4
|
+
<%= value.nil? ? "" : "#{key}(#{value.is_a?(String) ? "\"#{value}\"" : value.to_s});" %>
|
5
|
+
<% end %>};
|
6
|
+
|
7
|
+
<% syslog_ng_sources.reverse_merge(syslog_ng_is_server ? {
|
8
|
+
:s_net => "tcp(ip(#{syslog_ng_server}) port(#{syslog_ng_server_port || 5140}) max-connections(#{syslog_ng_server_max_connections || 10}));"
|
9
|
+
} : {}).each do |name, syslog_ng_source_list| %>
|
10
|
+
source <%= name %> {
|
11
|
+
<% [syslog_ng_source_list].flatten.each do |syslog_ng_source| %>
|
12
|
+
<%= syslog_ng_source.gsub(/;$/, '') %>;
|
13
|
+
<% end %>
|
14
|
+
};
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
<% syslog_ng_filters.each do |name, syslog_ng_filter_list| %>
|
18
|
+
filter <%= name %> {
|
19
|
+
<% [syslog_ng_filter_list].flatten.each do |syslog_ng_filter| %>
|
20
|
+
<%= syslog_ng_filter.gsub(/;$/, '') %>;
|
21
|
+
<% end %>
|
22
|
+
};
|
23
|
+
<% end %>
|
24
|
+
|
25
|
+
<% syslog_ng_destinations.reverse_merge(syslog_ng_server.nil? || syslog_ng_is_server ? {} : { :d_log_server => "tcp(\"#{syslog_ng_server}\" port(#{syslog_ng_server_port || 5140}));" }).each do |name, syslog_ng_destination_list| %>
|
26
|
+
destination <%= name %> {
|
27
|
+
<% [syslog_ng_destination_list].flatten.each do |syslog_ng_destination| %>
|
28
|
+
<%= syslog_ng_destination.gsub(/;$/, '') %>;
|
29
|
+
<% end %>
|
30
|
+
};
|
31
|
+
<% end %>
|
32
|
+
|
33
|
+
<% syslog_ng_logs.reverse_merge(syslog_ng_is_server ? {
|
34
|
+
:s_net => {
|
35
|
+
:df_daemons => {
|
36
|
+
:filters => :f_daemons,
|
37
|
+
:flags => :final
|
38
|
+
}
|
39
|
+
}
|
40
|
+
} : {}).each do |source_name, destinations_filters|
|
41
|
+
if source_name == :s_all && syslog_ng_server
|
42
|
+
destinations_filters.reverse_merge!(
|
43
|
+
[ :df_daemons, :d_log_server ] => { :filters => :f_daemons, :flags => :final})
|
44
|
+
end
|
45
|
+
destinations_filters.each do |destinations, filters| %>
|
46
|
+
log {
|
47
|
+
source(<%= source_name %>);
|
48
|
+
<% [filters.is_a?(Hash) ? filters[:filters] : filters].flatten.each do |syslog_filter| %>
|
49
|
+
filter(<%= syslog_filter %>);
|
50
|
+
<% end %>
|
51
|
+
<% [destinations].flatten.each do |destination| %>
|
52
|
+
destination(<%= destination %>);
|
53
|
+
<% end %>
|
54
|
+
<% [filters.is_a?(Hash) ? filters[:flags] : []].flatten.each do |flag| %>
|
55
|
+
flags(<%= flag %>);
|
56
|
+
<% end %>
|
57
|
+
};
|
58
|
+
<% end %>
|
metadata
CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
|
|
6
6
|
- 2
|
7
7
|
- 1
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 2.1.6.
|
9
|
+
- 30
|
10
|
+
version: 2.1.6.030
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Le1t0
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-07-
|
18
|
+
date: 2010-07-20 00:00:00 +02:00
|
19
19
|
default_executable: depify
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -113,7 +113,8 @@ files:
|
|
113
113
|
- lib/deprec/recipes/ssl.rb
|
114
114
|
- lib/deprec/recipes/starling.rb
|
115
115
|
- lib/deprec/recipes/svn.rb
|
116
|
-
- lib/deprec/recipes/syslog.rb
|
116
|
+
- lib/deprec/recipes/syslog/syslog.rb
|
117
|
+
- lib/deprec/recipes/syslog/syslog_ng.rb
|
117
118
|
- lib/deprec/recipes/trac.rb.disabled
|
118
119
|
- lib/deprec/recipes/tsung.rb.unmaintained
|
119
120
|
- lib/deprec/recipes/ubuntu.rb
|
@@ -235,6 +236,7 @@ files:
|
|
235
236
|
- lib/deprec/templates/subversion/svn.apache.vhost.erb
|
236
237
|
- lib/deprec/templates/syslog/syslog.conf.erb
|
237
238
|
- lib/deprec/templates/syslog/syslogd.erb
|
239
|
+
- lib/deprec/templates/syslog_ng/syslog-ng.conf.erb
|
238
240
|
- lib/deprec/templates/trac/apache_vhost.conf.erb
|
239
241
|
- lib/deprec/templates/trac/nginx_vhost.conf.erb
|
240
242
|
- lib/deprec/templates/trac/trac.ini.erb
|