Skip to content
This repository has been archived by the owner on Feb 21, 2020. It is now read-only.

Add possibility to configure compute engine #81

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
$home = undef,
$host = undef,
$port = 9000,
$portAjp = -1,
$portajp = -1,
$download_url = 'https://sonarsource.bintray.com/Distribution/sonarqube',
$download_dir = '/usr/local/src',
$context_path = '/',
Expand All @@ -47,6 +47,8 @@
$http_proxy = {},
$profile = false,
$web_java_opts = undef,
$ce_java_opts = undef,
$ce_workercount = undef,
$search_java_opts = undef,
$search_host = '127.0.0.1',
$search_port = '9001',
Expand Down Expand Up @@ -136,7 +138,8 @@
->
# ===== Install SonarQube =====
exec { 'untar':
command => "unzip -o ${tmpzip} -d ${installroot} && chown -R ${user}:${group} ${installroot}/${package_name}-${version} && chown -R ${user}:${group} ${real_home}",
command => "unzip -o ${tmpzip} -d ${installroot} && chown -R \
${user}:${group} ${installroot}/${package_name}-${version} && chown -R ${user}:${group} ${real_home}",
creates => "${installroot}/${package_name}-${version}/bin",
notify => Service['sonarqube'],
}
Expand Down
29 changes: 28 additions & 1 deletion templates/sonar.properties.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ sonar.web.host: <%= @host %>
#sonar.web.host: 0.0.0.0
<% end -%>
sonar.web.port: <%= @port %>
sonar.ajp.port: <%= @portAjp %>
sonar.ajp.port: <%= @portajp %>
<% if has_variable?('context_path') -%>
sonar.web.context: <%= @context_path %>
<% end -%>
Expand Down Expand Up @@ -103,6 +103,33 @@ sonar.web.https.keystoreType=<%= @https['keystoretype'] %>

<% end -%>

#--------------------------------------------------------------------------------------------------
# COMPUTE ENGINE
# The Compute Engine is responsible for processing background tasks.
# Compute Engine is executed in a dedicated Java process. Default heap size is 512Mb.
# Use the following property to customize JVM options.
# Recommendations:
#
# The HotSpot Server VM is recommended. The property -server should be added if server mode
# is not enabled by default on your environment:
# http://docs.oracle.com/javase/8/docs/technotes/guides/vm/server-class.html
#
<% if @ce_java_opts -%>
sonar.ce.javaOpts=<%= @ce_java_opts %>
<% end -%>

# Same as previous property, but allows to not repeat all other settings like -Xmx
#sonar.ce.javaAdditionalOpts=
# The number of workers in the Compute Engine. Value must be greater than zero.
# By default the Compute Engine uses a single worker and therefore processes tasks one at a time.
# Recommendations:
#
# Using N workers will require N times as much Heap memory (see property
# sonar.ce.javaOpts to tune heap) and produce N times as much IOs on disk, database and
# Elasticsearch. The number of workers must suit your environment.
<% if @ce_workercount -%>
sonar.ce.workerCount=<%= @ce_workercount %>
<% end -%>

#--------------------------------------------------------------------------------------------------
# ELASTICSEARCH
Expand Down