Skip to content
Browse files

Merge pull request #9 from spazm/0.9.6_cleanup

0.9.6 cleanup
  • Loading branch information...
2 parents 6f6acfb + b1d79dd commit 19e37c704137e4e5c712586f1b1ef778eaede25c @nstielau nstielau committed Apr 12, 2012
View
8 cookbooks/graylog2/attributes/default.rb
@@ -1,6 +1,8 @@
default.graylog2.basedir = "/var/graylog2"
-default.graylog2.server.version = "0.9.5p1"
-default.graylog2.web_interface.version = "0.9.5p2"
+default.graylog2.server.version = "0.9.6p1-RC1"
+default.graylog2.web_interface.version = "0.9.6p1-RC1"
+
+default.graylog2.elasticsearch.version="0.19.2"
default.graylog2.mongodb.host = "localhost"
default.graylog2.mongodb.port = 27017
@@ -18,3 +20,5 @@
default.graylog2.send_stream_subscriptions = true
default.graylog2.stream_alarms_cron_minute = "*/15"
default.graylog2.stream_subscriptions_cron_minute = "*/15"
+
+default.graylog2.external_hostname = nil
View
5 cookbooks/graylog2/metadata.rb
@@ -2,12 +2,13 @@
maintainer_email "cloudteam@mdsol.com"
license "Apache 2.0"
description "Installs and configures Graylog2"
-version "0.0.5"
+version "0.0.6"
recipe "graylog2", "Installs and configures Graylog2"
# Only supporting Ubuntu 10.x
supports "ubuntu"
# OpsCode cookbook dependencies
-depends "apt" # http://community.opscode.com/cookbooks/apt
+depends "apt" # http://community.opscode.com/cookbooks/apt
depends "apache2" # http://community.opscode.com/cookbooks/apache2
+depends "mongodb" # http://community.opscode.com/cookbooks/mongodb
View
30 cookbooks/graylog2/recipes/server.rb
@@ -17,29 +17,33 @@
# limitations under the License.
#
-# Add APT public key for the 10gen MongoDB repo
-execute "apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10" do
- not_if 'apt-key list | grep "7F0CEB10"'
-end
-
-# Add the 10gen MongoDB repository to APT
-apt_repository "mongodb" do
- uri "http://downloads-distro.mongodb.org/repo/ubuntu-upstart"
- distribution "dist"
- components ["10gen"]
- action :add
-end
+# Install MongoDB from 10gen repository
+include_recipe "mongodb::10gen_repo"
+include_recipe "mongodb::default"
# Install required APT packages
package "openjdk-6-jre"
-package "mongodb-10gen"
# Create the release directory
directory "#{node.graylog2.basedir}/rel" do
mode 0755
recursive true
end
+# Download the elasticsearch dpkg
+
+remote_file "elasticsearch_dpkg" do
+ path "#{node.graylog2.basedir}/rel/elasticsearch-#{node.graylog2.elasticsearch.version}.deb"
+ source "https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-#{node.graylog2.elasticsearch.version}.deb"
+ action :create_if_missing
+end
+
+dpkg_package "elasticsearch" do
+ source "#{node.graylog2.basedir}/rel/elasticsearch-#{node.graylog2.elasticsearch.version}.deb"
+ version node.graylog2.elasticsearch.version
+ action :install
+end
+
# Download the desired version of Graylog2 server from GitHub
remote_file "download_server" do
path "#{node.graylog2.basedir}/rel/graylog2-server-#{node.graylog2.server.version}.tar.gz"
View
7 cookbooks/graylog2/recipes/web_interface.rb
@@ -63,11 +63,18 @@
mode 0644
end
+external_hostname = node.graylog2.external_hostname ? node.graylog2.external_hostname :
+ (node.has_key?('ec2') and node.ec2.has_key?('public_hostname')) ? node.ec2.public_hostname :
+ (node.has_key?('ec2') and node.ec2.has_key?('public_ipv4')) ? node.ec2.public_ipv4 :
+ node.has_key?('fqdn') ? node.fqdn :
+ "localhost"
+
# Create general.yml
template "#{node.graylog2.basedir}/web/config/general.yml" do
owner "nobody"
group "nogroup"
mode 0644
+ variables( :external_hostname => external_hostname )
end
# Chown the Graylog2 directory to nobody/nogroup to allow web servers to serve it
View
2 cookbooks/graylog2/templates/default/general.yml.erb
@@ -3,7 +3,7 @@
#
general:
- external_hostname: "<%= (node.ec2 && node.ec2.public_hostname) || node.fqdn || "localhost" %>" # Used for example to generate permalinks. Don't add 'http://' or trailing slashes.
+ external_hostname: "<%= @external_hostname %>" # Used for example to generate permalinks. Don't add 'http://' or trailing slashes.
date_format: "%d.%m.%Y - %H:%M:%S" # http://ruby-doc.org/core/classes/Time.html#M000298 (strftime syntax)
allow_deleting: <%= node.graylog2.allow_deleting %>

0 comments on commit 19e37c7

Please sign in to comment.
Something went wrong with that request. Please try again.