Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
control-repo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
puppet
control-repo
Commits
93cb464e
Commit
93cb464e
authored
3 years ago
by
Torstein Egge
Browse files
Options
Downloads
Patches
Plain Diff
cleanup, comments
parent
c58a86f0
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
manifests/site.pp
+27
-15
27 additions, 15 deletions
manifests/site.pp
with
27 additions
and
15 deletions
manifests/site.pp
+
27
−
15
View file @
93cb464e
...
...
@@ -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'],
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment