diff --git a/manifests/init.pp b/manifests/init.pp index 3a96b781..127b8300 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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 = '/', @@ -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', @@ -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'], } diff --git a/templates/sonar.properties.erb b/templates/sonar.properties.erb index c3a0e1df..0a5a7b4c 100644 --- a/templates/sonar.properties.erb +++ b/templates/sonar.properties.erb @@ -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 -%> @@ -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