From 3eaa28f5b4dae2e7bb7494cc2e7b3f08591319d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Menuel?= Date: Tue, 7 Nov 2023 10:14:49 +0100 Subject: [PATCH] add support for additional options for sonar.properties. Closes: #30 --- REFERENCE.md | 9 +++++++++ manifests/init.pp | 4 ++++ templates/sonar.properties.epp | 11 ++++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/REFERENCE.md b/REFERENCE.md index 08df95d..ecb4785 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -73,6 +73,7 @@ The following parameters are available in the `sonarqube` class: * [`search_java_additional_opts`](#-sonarqube--search_java_additional_opts) * [`helper_dir`](#-sonarqube--helper_dir) * [`system_passcode`](#-sonarqube--system_passcode) +* [`additional_opts`](#-sonarqube--additional_opts) ##### `arch` @@ -336,6 +337,14 @@ Optional system_passcode setting for monitoring. Default value: `undef` +##### `additional_opts` + +Data type: `Optional[Hash]` + +Optional additional options to add to sonar.properties + +Default value: `undef` + ### `sonarqube::runner` Install and configure SonarQube Runner diff --git a/manifests/init.pp b/manifests/init.pp index 52e899f..acd7e94 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -127,6 +127,9 @@ # @param system_passcode # Optional system_passcode setting for monitoring. # +# @param additional_opts +# Optional additional options to add to sonar.properties +# class sonarqube ( # required parameters String $arch, @@ -169,6 +172,7 @@ Optional[Hash] $sso = undef, Optional[String] $web_java_opts = undef, Optional[String] $system_passcode = undef, + Optional[Hash] $additional_opts = undef, ) { Exec { path => '/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin', diff --git a/templates/sonar.properties.epp b/templates/sonar.properties.epp index fadcedb..1d7eda3 100644 --- a/templates/sonar.properties.epp +++ b/templates/sonar.properties.epp @@ -482,4 +482,13 @@ crowd.application: <%= $sonarqube::crowd['application'] %> # Crowd application password. crowd.password: <%= $sonarqube::crowd['password'] %> -<% } %> +<% } -%> + +<% if $sonarqube::additional_opts { %> +#------------------- +# Additional options +#------------------- +<% $sonarqube::additional_opts.each |$config, $value| { -%> +<%= $config %>=<%= $value %> +<% } -%> +<% } -%>