Skip to content
Snippets Groups Projects
Commit 93cb464e authored by Torstein Egge's avatar Torstein Egge
Browse files

cleanup, comments

parent c58a86f0
No related branches found
No related tags found
No related merge requests found
......@@ -31,19 +31,24 @@ node default {
}
node 'elk-server.openstacklocal' {
# include ::java
# Configure java
# JAVA_HOME needs to be set for various ELK components to work properly
class { 'java' :
package => 'openjdk-8-jre',
java_home => '/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java',
}
# Load Elastic Repo. Contains various packages
include elastic_stack::repo
# Default Elasticsearch setup
class { 'elasticsearch': }
# Default Kibana setup
class { 'kibana': }
#include nginx
# Set up a reverse proxy with nginx
# Needed in order to view the Kibana dashboard in a web browser
class { 'nginx': }
nginx::resource::server { 'default':
listen_port => 80,
......@@ -51,9 +56,10 @@ node 'elk-server.openstacklocal' {
listen_options => 'default_server',
}
# Configure logstash
include logstash
# TODO: Chain package, file thingies
# Install and configure heartbeat
package {'heartbeat-elastic':
ensure => present,
} ~> file {'/etc/heartbeat/heartbeat.yml':
......@@ -62,9 +68,9 @@ node 'elk-server.openstacklocal' {
} ~> service {'heartbeat-elastic':
ensure => running,
enable => true,
require => Package['heartbeat-elastic'],
}
# Load config file from repo
file {'/etc/filebeat/filebeat.yml':
ensure => present,
source => 'puppet:///modules/beats_conf/filebeat.yml',
......@@ -72,11 +78,12 @@ node 'elk-server.openstacklocal' {
notify => Service['filebeat'],
}
# Install filebeat
package {'filebeat':
ensure => present,
# require => File['/etc/filebeat/filebeat.yml'],
}
# Enable the filebeat nginx module
file { '/etc/filebeat/modules.d/nginx.yml':
ensure => link,
target => '/etc/filebeat/modules.d/nginx.yml.disabled',
......@@ -84,6 +91,7 @@ node 'elk-server.openstacklocal' {
notify => Service['filebeat'],
}
# Enable the filebeat system module
file { '/etc/filebeat/modules.d/system.yml':
ensure => link,
target => '/etc/filebeat/modules.d/system.yml.disabled',
......@@ -94,22 +102,24 @@ node 'elk-server.openstacklocal' {
service {'filebeat':
ensure => running,
enable => true,
# require => File['/etc/filebeat/filebeat.yml'],
# require => File['/etc/filebeat/modules.d/system.yml'],
# require => File['/etc/filebeat/modules.d/nginx.yml'],
}
### Config files for logstash
# Make logstash use beats as an input
logstash::configfile { 'beats':
content => 'input { beats { port => 5044 } }',
path => '/etc/logstash/conf.d/02-beats-input.conf',
}
# Use heartbeat as an input
logstash::configfile { 'heartbeat':
content => 'input { heartbeat {} }',
path => '/etc/logstash/conf.d/03-heartbeat-input.conf',
}
# Configure output to Elasticsearch
logstash::configfile { 'es-01-out':
source => 'puppet:///modules/logstash_conf/30-elasticsearch-output.conf',
path => '/etc/logstash/conf.d/30-elasticsearch-output.conf'
......@@ -118,9 +128,13 @@ node 'elk-server.openstacklocal' {
}
node 'app-server.openstacklocal' {
# Set up a default apache server
include apache
# Load Elastic stack repo to get various packages
include elastic_stack::repo
# Configure filebeat
file {'/etc/filebeat/filebeat.yml':
ensure => present,
source => 'puppet:///modules/beats_conf/filebeat.yml',
......@@ -128,12 +142,12 @@ node 'app-server.openstacklocal' {
notify => Service['filebeat'],
}
# Install filebeat
package {'filebeat':
ensure => present,
# require => File['/etc/filebeat/filebeat.yml'],
}
# TODO: change to ~>
# Enable the filebeat apache module
file { '/etc/filebeat/modules.d/apache.yml':
ensure => link,
target => '/etc/filebeat/modules.d/apache.yml.disabled',
......@@ -141,6 +155,7 @@ node 'app-server.openstacklocal' {
notify => Service['filebeat'],
}
# Enable the filebeat apache module
file { '/etc/filebeat/modules.d/system.yml':
ensure => link,
target => '/etc/filebeat/modules.d/system.yml.disabled',
......@@ -151,8 +166,5 @@ node 'app-server.openstacklocal' {
service {'filebeat':
ensure => running,
enable => true,
# require => File['/etc/filebeat/filebeat.yml'],
# require => File['/etc/filebeat/modules.d/system.yml'],
# require => File['/etc/filebeat/modules.d/nginx.yml'],
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment