Skip to content

Commit

Permalink
configure email delivery
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolay Sturm committed Mar 19, 2012
1 parent b07863e commit d5612a1
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 5 deletions.
12 changes: 12 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
default['graylog2']['amqp']['virtualhost'] = '/'
default['graylog2']['amqp']['subscribed_queues'] = ['queue1:gelf', 'queue2:syslog']

# 'smtp' or 'sendmail'
default['graylog2']['email']['transport'] = 'smtp'
# further email settings are only relevant for 'smtp' transport
default['graylog2']['email']['domain'] = 'example.org'
default['graylog2']['email']['enable_starttls_auto'] = 'true'
default['graylog2']['email']['port'] = 25
default['graylog2']['email']['relay'] = 'smtp.example.org'
# 'plain', 'login', 'cram_md5', use false to disable
default['graylog2']['email']['smtpauth']['type'] = 'plain'
default['graylog2']['email']['smtpauth']['user'] = 'somebody'
default['graylog2']['email']['smtpauth']['password'] = 'secret'

default['graylog2']['elasticsearch']['url'] = 'http://localhost:9200/'

default['graylog2']['gelf']['use'] = 'true'
Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
license "Apache 2.0"
description "Graylog2 log management and exception tracking"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.0.4"
version "0.1.0"

depends "elasticsearch"
depends "java"
Expand Down
15 changes: 11 additions & 4 deletions recipes/_web_config.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Install web interface configuration

template "#{node['graylog2']['prefix']}/graylog2-web-interface-#{node['graylog2']['web_interface']['version']}/config/mongoid.yml" do
template "#{node['graylog2']['prefix']}/graylog2-web-interface-#{node['graylog2']['web_interface']['version']}/config/email.yml" do
owner node['graylog2']['user']
group node['graylog2']['group']
mode "0400"

notifies :run, resources(:execute => "restart passenger")
mode "0644"
end

public_hostname = node['fqdn']
Expand All @@ -23,3 +21,12 @@

notifies :run, resources(:execute => "restart passenger")
end

template "#{node['graylog2']['prefix']}/graylog2-web-interface-#{node['graylog2']['web_interface']['version']}/config/mongoid.yml" do
owner node['graylog2']['user']
group node['graylog2']['group']
mode "0400"

notifies :run, resources(:execute => "restart passenger")
end

13 changes: 13 additions & 0 deletions templates/default/email.yml.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
production:
via: <%= node['graylog2']['email']['transport'] %>
<% if node['graylog2']['email']['transport'] == 'smtp' -%>
host: <%= node['graylog2']['email']['relay'] %>
domain: <%= node['graylog2']['email']['domain'] %>
enable_starttls_auto: <%= node['graylog2']['email']['enable_starttls_auto'] %>
port: <%= node['graylog2']['email']['port'] %>
<% if node['graylog2']['email']['smtpauth']['type'] -%>
auth: <%= node['graylog2']['email']['smtpauth']['type'] %>
user: <%= node['graylog2']['email']['smtpauth']['user'] %>
password: <%= node['graylog2']['email']['smtpauth']['password'] %>
<% end -%>
<% end -%>

0 comments on commit d5612a1

Please sign in to comment.