Skip to content

Commit

Permalink
Adding option to include additional java_opts (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
timdeluxe authored Nov 4, 2021
1 parent b7d3ca4 commit 9345c30
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ Sets the initial Java heap size (-Xms) for Graylog. Defaults to `1g`.

Sets the maximum Java heap size (-Xmx) for Graylog. Defaults to `1g`.

##### `java_opts`

Additional java options for Graylog. Defaults to ``.

##### `restart_on_package_upgrade`

This setting restarts the `graylog-server` service if the os package is upgraded.
Expand Down
1 change: 1 addition & 0 deletions manifests/allinone.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
config => $graylog['config'],
java_initial_heap_size => $graylog['java_initial_heap_size'],
java_max_heap_size => $graylog['java_max_heap_size'],
java_opts => $graylog['java_opts'],
}
}
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@

$java_initial_heap_size = '1g'
$java_max_heap_size = '1g'
$java_opts = ''
}
7 changes: 5 additions & 2 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
$enable = true,
$java_initial_heap_size = $graylog::params::java_initial_heap_size,
$java_max_heap_size = $graylog::params::java_max_heap_size,
$java_opts = $graylog::params::java_opts,
Boolean $restart_on_package_upgrade = false,
) inherits graylog::params {
if $config == undef {
Expand Down Expand Up @@ -61,7 +62,8 @@
content => epp("${module_name}/server/environment.epp",
{
'java_initial_heap_size' => $java_initial_heap_size,
'java_max_heap_size' => $java_max_heap_size
'java_max_heap_size' => $java_max_heap_size,
'java_opts' => $java_opts
}),
}
}
Expand All @@ -74,7 +76,8 @@
content => epp("${module_name}/server/environment.epp",
{
'java_initial_heap_size' => $java_initial_heap_size,
'java_max_heap_size' => $java_max_heap_size
'java_max_heap_size' => $java_max_heap_size,
'java_opts' => $java_opts
}),
}
}
Expand Down
5 changes: 4 additions & 1 deletion templates/server/environment.epp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%- | String $java_initial_heap_size = '1g', String $java_max_heap_size = '1g' | -%>
<%- | String $java_initial_heap_size = '1g', String $java_max_heap_size = '1g', String $java_opts = "" | -%>
# Path to the java executable.
JAVA=/usr/bin/java

Expand All @@ -8,6 +8,9 @@ GRAYLOG_SERVER_JAVA_OPTS="-Xms<%= $java_initial_heap_size %> -Xmx<%= $java_max_h
# Avoid endless loop with some TLSv1.3 implementations.
GRAYLOG_SERVER_JAVA_OPTS="$GRAYLOG_SERVER_JAVA_OPTS -Djdk.tls.acknowledgeCloseNotify=true"

# Additional java opts
GRAYLOG_SERVER_JAVA_OPTS="$GRAYLOG_SERVER_JAVA_OPTS <%= $java_opts %>"

# Pass some extra args to graylog-server. (i.e. "-d" to enable debug mode)
GRAYLOG_SERVER_ARGS=""

Expand Down
1 change: 1 addition & 0 deletions tests/vagrant.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
},
java_initial_heap_size => '2g',
java_max_heap_size => '2g',
java_opts => '-Dcom.sun.management.jmxremote',
}
}

0 comments on commit 9345c30

Please sign in to comment.