From 7ac3ee72150d9fd90d66624b84529b4057aa1aa0 Mon Sep 17 00:00:00 2001 From: Jarkko Oranen Date: Wed, 14 Apr 2021 15:08:11 +0300 Subject: [PATCH 01/14] Clean up config.pp --- manifests/config.pp | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index ebc676fb..a4acd817 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -13,7 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # ----------------------------------------------------------------------------- -class jira::config inherits jira { +class jira::config { + + # This class should be used from init.pp with a dependency on jira::install + # and sending a refresh to jira::service + assert_private() + File { owner => $jira::user, group => $jira::group, @@ -30,65 +35,45 @@ file { "${jira::webappdir}/bin/user.sh": content => template('jira/user.sh.erb'), mode => '0755', - require => [ - Class['jira::install'], - File[$jira::webappdir], - File[$jira::homedir], - ], } - -> file { "${jira::webappdir}/bin/setenv.sh": + file { "${jira::webappdir}/bin/setenv.sh": content => template('jira/setenv.sh.erb'), mode => '0755', - require => Class['jira::install'], - notify => Class['jira::service'], } - -> file { "${jira::homedir}/dbconfig.xml": + file { "${jira::homedir}/dbconfig.xml": content => epp('jira/dbconfig.xml.epp'), mode => '0600', - require => [Class['jira::install'],File[$jira::homedir]], - notify => Class['jira::service'], } if $jira::script_check_java_manage { file { "${jira::webappdir}/bin/check-java.sh": content => template($jira::script_check_java_template), mode => '0755', - require => [ - Class['jira::install'], - File["${jira::webappdir}/bin/setenv.sh"], - ], - notify => Class['jira::service'], + require => File["${jira::webappdir}/bin/setenv.sh"], } } file { "${jira::webappdir}/conf/server.xml": content => template('jira/server.xml.erb'), mode => '0600', - require => Class['jira::install'], - notify => Class['jira::service'], } - -> file { "${jira::webappdir}/conf/context.xml": + + file { "${jira::webappdir}/conf/context.xml": content => template('jira/context.xml.erb'), mode => '0600', - require => Class['jira::install'], - notify => Class['jira::service'], } file { "${jira::homedir}/jira-config.properties": content => template('jira/jira-config.properties.erb'), mode => '0600', - require => [Class['jira::install'],File[$jira::homedir]], - notify => Class['jira::service'], } if $jira::datacenter { file { "${jira::homedir}/cluster.properties": content => template('jira/cluster.properties.erb'), mode => '0600', - require => [Class['jira::install'],File[$jira::homedir]], - notify => Class['jira::service'], } } } From 01dbb4ddca6c8f3e84bfdb6868eef733801834ef Mon Sep 17 00:00:00 2001 From: Jarkko Oranen Date: Wed, 14 Apr 2021 15:30:50 +0300 Subject: [PATCH 02/14] Refactor configuration from init.pp to config.pp --- manifests/config.pp | 89 +++++++++++++++++++++++++++++++++++++- manifests/init.pp | 76 -------------------------------- templates/dbconfig.xml.epp | 10 ++--- 3 files changed, 93 insertions(+), 82 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index a4acd817..28d50a5f 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -13,10 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # ----------------------------------------------------------------------------- -class jira::config { +class jira::config inherits jira { + # This class should be used from init.pp with a dependency on jira::install # and sending a refresh to jira::service + # We need to inherit jira because the templates use lots of @var assert_private() File { @@ -32,6 +34,91 @@ # can't use pick_default: https://tickets.puppetlabs.com/browse/MODULES-11018 $dbschema = if $jira::dbschema { $jira::dbschema } else { $dbschema_default } + + if $jira::java_opts { + deprecation('jira::java_opts', 'jira::java_opts is deprecated. Please use jira::jvm_extra_args') + $jvm_extra_args_real = "${jira::java_opts} ${jira::jvm_extra_args}" + } else { + $jvm_extra_args_real = $jira::jvm_extra_args + } + + # Allow some backwards compatibility; + if $jira::poolsize { + deprecation('jira::poolsize', 'jira::poolsize is deprecated and simply sets max-pool-size. Please use jira::pool_max_size instead and remove this configuration') + $pool_max_size_real = pick($jira::pool_max_size, $jira::poolsize) + } else { + $pool_max_size_real = $jira::pool_max_size + } + + if $jira::tomcat_redirect_https_port { + unless $jira::tomcat_native_ssl { + fail('You need to set jira::tomcat_native_ssl to true when using jira::tomcat_redirect_https_port') + } + } + + if $jira::dbport { + $dbport_real = $jira::dbport + } else { + $dbport_real = $jira::db ? { + 'postgresql' => '5432', + 'mysql' => '3306', + 'oracle' => '1521', + 'sqlserver' => '1433', + 'h2' => '', + } + } + + if $jira::dbdriver { + $dbdriver_real = $jira::dbdriver + } else { + $dbdriver_real = $jira::db ? { + 'postgresql' => 'org.postgresql.Driver', + 'mysql' => 'com.mysql.jdbc.Driver', + 'oracle' => 'oracle.jdbc.OracleDriver', + 'sqlserver' => 'com.microsoft.sqlserver.jdbc.SQLServerDriver', + 'h2' => 'org.h2.Driver', + } + } + + if $jira::dbtype { + $dbtype_real = $jira::dbtype + } else { + $dbtype_real = $jira::db ? { + 'postgresql' => 'postgres72', + 'mysql' => 'mysql', + 'oracle' => 'oracle10g', + 'sqlserver' => 'mssql', + 'h2' => 'h2', + } + } + + if $jira::dburl { + $dburl_real = $jira::dburl + } + else { + $dburl_real = $jira::db ? { + 'postgresql' => "jdbc:${jira::db}://${jira::dbserver}:${dbport_real}/${jira::dbname}", + 'mysql' => "jdbc:${jira::db}://${jira::dbserver}:${dbport_real}/${jira::dbname}?useUnicode=true&characterEncoding=UTF8&sessionVariables=default_storage_engine=InnoDB", + 'oracle' => "jdbc:${jira::db}:thin:@${jira::dbserver}:${dbport_real}:${jira::dbname}", + 'sqlserver' => "jdbc:jtds:${jira::db}://${jira::dbserver}:${dbport_real}/${jira::dbname}", + 'h2' => "jdbc:h2:file:/${jira::homedir}/database/${jira::dbname}", + } + } + + if $jira::tomcat_protocol_ssl { + $tomcat_protocol_ssl_real = $jira::tomcat_protocol_ssl + } else { + if versioncmp($jira::version, '7.3.0') >= 0 { + $tomcat_protocol_ssl_real = 'org.apache.coyote.http11.Http11NioProtocol' + } else { + $tomcat_protocol_ssl_real = 'org.apache.coyote.http11.Http11Protocol' + } + } + + $merged_jira_config_properties = merge({ 'jira.websudo.is.disabled' => !$jira::enable_secure_admin_sessions }, $jira::jira_config_properties) + + # Configuration logic ends, resources begin: + file { "${jira::webappdir}/bin/user.sh": content => template('jira/user.sh.erb'), mode => '0755', diff --git a/manifests/init.pp b/manifests/init.pp index 83c19998..6f3340fa 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -174,21 +174,6 @@ deprecation('jira::enable_connection_pooling', 'jira::enable_connection_pooling has been removed and does nothing. Please simply configure the connection pooling parameters') } - if $java_opts { - deprecation('jira::java_opts', 'jira::java_opts is deprecated. Please use jira::jvm_extra_args') - $jvm_extra_args_real = "${java_opts} ${jvm_extra_args}" - } else { - $jvm_extra_args_real = $jvm_extra_args - } - - # Allow some backwards compatibility; - if $poolsize { - deprecation('jira::poolsize', 'jira::poolsize is deprecated and simply sets max-pool-size. Please use jira::pool_max_size instead and remove this configuration') - $pool_max_size_real = pick($pool_max_size, $poolsize) - } else { - $pool_max_size_real = $pool_max_size - } - if $tomcat_redirect_https_port { unless ($tomcat_native_ssl) { fail('You need to set native_ssl to true when using tomcat_redirect_https_port') @@ -218,65 +203,6 @@ $webappdir = $extractdir } - if $dbport { - $dbport_real = $dbport - } else { - $dbport_real = $db ? { - 'postgresql' => '5432', - 'mysql' => '3306', - 'oracle' => '1521', - 'sqlserver' => '1433', - 'h2' => '', - } - } - - if $dbdriver { - $dbdriver_real = $dbdriver - } else { - $dbdriver_real = $db ? { - 'postgresql' => 'org.postgresql.Driver', - 'mysql' => 'com.mysql.jdbc.Driver', - 'oracle' => 'oracle.jdbc.OracleDriver', - 'sqlserver' => 'com.microsoft.sqlserver.jdbc.SQLServerDriver', - 'h2' => 'org.h2.Driver', - } - } - - if $dbtype { - $dbtype_real = $dbtype - } else { - $dbtype_real = $db ? { - 'postgresql' => 'postgres72', - 'mysql' => 'mysql', - 'oracle' => 'oracle10g', - 'sqlserver' => 'mssql', - 'h2' => 'h2', - } - } - - if $dburl { - $dburl_real = $dburl - } - else { - $dburl_real = $db ? { - 'postgresql' => "jdbc:${db}://${dbserver}:${dbport_real}/${dbname}", - 'mysql' => "jdbc:${db}://${dbserver}:${dbport_real}/${dbname}?useUnicode=true&characterEncoding=UTF8&sessionVariables=default_storage_engine=InnoDB", - 'oracle' => "jdbc:${db}:thin:@${dbserver}:${dbport_real}:${dbname}", - 'sqlserver' => "jdbc:jtds:${db}://${dbserver}:${dbport_real}/${dbname}", - 'h2' => "jdbc:h2:file:/${jira::homedir}/database/${dbname}", - } - } - - if $tomcat_protocol_ssl { - $tomcat_protocol_ssl_real = $tomcat_protocol_ssl - } else { - if versioncmp($version, '7.3.0') >= 0 { - $tomcat_protocol_ssl_real = 'org.apache.coyote.http11.Http11NioProtocol' - } else { - $tomcat_protocol_ssl_real = 'org.apache.coyote.http11.Http11Protocol' - } - } - if ! empty($ajp) { if ! ('port' in $ajp) { fail('You need to specify a valid port for the AJP connector.') @@ -290,8 +216,6 @@ } } - $merged_jira_config_properties = merge( { 'jira.websudo.is.disabled' => !$enable_secure_admin_sessions }, $jira_config_properties) - if $javahome == undef { fail('You need to specify a value for javahome') } diff --git a/templates/dbconfig.xml.epp b/templates/dbconfig.xml.epp index 1ba57d4c..89b27245 100644 --- a/templates/dbconfig.xml.epp +++ b/templates/dbconfig.xml.epp @@ -4,21 +4,21 @@ defaultDS default - <%= $jira::dbtype_real %> + <%= $jira::config::dbtype_real %> <% if $jira::config::dbschema != undef { -%> <%= $jira::config::dbschema %> <% } -%> - <%= $jira::dburl_real %> - <%= $jira::dbdriver_real %> + <%= $jira::config::dburl_real %> + <%= $jira::config::dbdriver_real %> <%= $jira::dbuser %> <%= $jira::dbpassword %> <%# For most of these, Jira defaults are better... -%> <% if $jira::pool_min_size != undef { -%> <%= $jira::pool_min_size %> <% } -%> -<% if $jira::pool_max_size_real != undef { -%> - <%= $jira::pool_max_size_real %> +<% if $jira::config::pool_max_size_real != undef { -%> + <%= $jira::config::pool_max_size_real %> <% } -%> <% if $jira::pool_max_idle != undef { -%> <%= $jira::pool_max_idle %> From 093f42742edc781e691dc5ff545d52f1bed871e0 Mon Sep 17 00:00:00 2001 From: Jarkko Oranen Date: Wed, 14 Apr 2021 16:15:06 +0300 Subject: [PATCH 03/14] convert setenv.sh to epp --- manifests/config.pp | 2 +- templates/{setenv.sh.erb => setenv.sh.epp} | 78 +++++++++++----------- 2 files changed, 40 insertions(+), 40 deletions(-) rename templates/{setenv.sh.erb => setenv.sh.epp} (77%) diff --git a/manifests/config.pp b/manifests/config.pp index 28d50a5f..3400643e 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -125,7 +125,7 @@ } file { "${jira::webappdir}/bin/setenv.sh": - content => template('jira/setenv.sh.erb'), + content => epp('jira/setenv.sh.epp'), mode => '0755', } diff --git a/templates/setenv.sh.erb b/templates/setenv.sh.epp similarity index 77% rename from templates/setenv.sh.erb rename to templates/setenv.sh.epp index 60f16b4c..a1f0e522 100755 --- a/templates/setenv.sh.erb +++ b/templates/setenv.sh.epp @@ -1,23 +1,23 @@ # # If the limit of files that Jira can open is too low, it will be set to this value. # -MIN_NOFILES_LIMIT=<%= @jvm_nofiles_limit %> +MIN_NOFILES_LIMIT=<%= $jira::jvm_nofiles_limit %> # # One way to set the JIRA HOME path is here via this variable. Simply uncomment it and set a valid path like /jira/home. You can of course set it outside in the command terminal. That will also work. # -JIRA_HOME="<%= @homedir %>" +JIRA_HOME="<%= $jira::homedir %>" # # Occasionally Atlassian Support may recommend that you set some specific JVM arguments. You can use this variable below to do that. # -<%- if @jvm_type == 'openjdk-11' -%> -JVM_SUPPORT_RECOMMENDED_ARGS='-XX:-HeapDumpOnOutOfMemoryError <%= @jvm_optional %>' -<%- elsif @jvm_type == 'oracle-jdk-1.8' -%> -JVM_SUPPORT_RECOMMENDED_ARGS='-XX:-HeapDumpOnOutOfMemoryError <%= @jvm_optional %>' -<%- elsif @jvm_type == 'custom' -%> -JVM_SUPPORT_RECOMMENDED_ARGS='<%= @jvm_optional %>' -<%- end -%> +<%- if $jira::jvm_type == 'openjdk-11' { -%> +JVM_SUPPORT_RECOMMENDED_ARGS='-XX:-HeapDumpOnOutOfMemoryError <%= $jira::jvm_optional %>' +<%- } elsif $jira::jvm_type == 'oracle-jdk-1.8' { -%> +JVM_SUPPORT_RECOMMENDED_ARGS='-XX:-HeapDumpOnOutOfMemoryError <%= $jira::jvm_optional %>' +<%- } elsif $jira::jvm_type == 'custom' { -%> +JVM_SUPPORT_RECOMMENDED_ARGS='<%= $jira::jvm_optional %>' +<%- } -%> # # You can use variable below to modify garbage collector settings. @@ -25,50 +25,50 @@ JVM_SUPPORT_RECOMMENDED_ARGS='<%= @jvm_optional %>' # For Java 11 and relatively small heaps we recommend: -XX:+UseParallelGC # For Java 11 and larger heaps we recommend: -XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent # -<%- if @jvm_type == 'openjdk-11' -%> -JVM_GC_ARGS='-XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent <%= @jvm_gc_args %>' -<%- elsif @jvm_type == 'oracle-jdk-1.8' -%> -JVM_GC_ARGS='<%= @jvm_gc_args %>' -<%- elsif @jvm_type == 'custom' -%> -JVM_GC_ARGS='<%= @jvm_gc_args %>' -<%- end -%> +<%- if $jira::jvm_type == 'openjdk-11' { -%> +JVM_GC_ARGS='-XX:+UseG1GC -XX:+ExplicitGCInvokesConcurrent <%= $jira::jvm_gc_args %>' +<%- } elsif $jira::jvm_type == 'oracle-jdk-1.8' { -%> +JVM_GC_ARGS='<%= $jira::jvm_gc_args %>' +<%- } elsif $jira::jvm_type == 'custom' { -%> +JVM_GC_ARGS='<%= $jira::jvm_gc_args %>' +<%- } -%> # # The following 2 settings control the minimum and maximum given to the JIRA Java virtual machine. In larger JIRA instances, the maximum amount will need to be increased. # -JVM_MINIMUM_MEMORY='<%= @jvm_xms %>' -JVM_MAXIMUM_MEMORY='<%= @jvm_xmx %>' -JVM_PERMGEN_MEMORY='<%= @jvm_permgen %>' +JVM_MINIMUM_MEMORY='<%= $jira::jvm_xms %>' +JVM_MAXIMUM_MEMORY='<%= $jira::jvm_xmx %>' +JVM_PERMGEN_MEMORY='<%= $jira::jvm_permgen %>' # # The following setting configures the size of JVM code cache. A high value of reserved size allows Jira to work with more installed apps. # -<%- if @jvm_type == 'openjdk-11' -%> -JVM_CODE_CACHE_ARGS='-XX:InitialCodeCacheSize=32m -XX:ReservedCodeCacheSize=512m <%= @jvm_codecache_args %>' -<%- elsif @jvm_type == 'oracle-jdk-1.8' -%> -JVM_CODE_CACHE_ARGS='-XX:InitialCodeCacheSize=32m -XX:ReservedCodeCacheSize=512m <%= @jvm_codecache_args %>' -<%- elsif @jvm_type == 'custom' -%> -JVM_CODE_CACHE_ARGS='<%= @jvm_codecache_args %>' -<%- end -%> +<%- if $jira::jvm_type == 'openjdk-11' { -%> +JVM_CODE_CACHE_ARGS='-XX:InitialCodeCacheSize=32m -XX:ReservedCodeCacheSize=512m <%= $jira::jvm_codecache_args %>' +<%- } elsif $jira::jvm_type == 'oracle-jdk-1.8' { -%> +JVM_CODE_CACHE_ARGS='-XX:InitialCodeCacheSize=32m -XX:ReservedCodeCacheSize=512m <%= $jira::jvm_codecache_args %>' +<%- } elsif $jira::jvm_type == 'custom' { -%> +JVM_CODE_CACHE_ARGS='<%= $jira::jvm_codecache_args %>' +<%- } -%> # # The following are the required arguments for Jira. # -<%- if scope.call_function('versioncmp', [@version, '8.11.0']) > 0 -%> +<%- if versioncmp($jira::version, '8.11.0') > 0 { -%> JVM_REQUIRED_ARGS='-Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Dorg.dom4j.factory=com.atlassian.core.xml.InterningDocumentFactory' -<% else -%> +<% } else { -%> JVM_REQUIRED_ARGS='-Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true' -<%- end -%> +<%- } -%> # Uncomment this setting if you want to import data without notifications # -<% if @disable_notifications -%> +<%- if $jira::disable_notifications { -%> DISABLE_NOTIFICATIONS='-Datlassian.mail.senddisabled=true -Datlassian.mail.fetchdisabled=true -Datlassian.mail.popdisabled=true' -<% else %> +<% } else { %> #DISABLE_NOTIFICATIONS='-Datlassian.mail.senddisabled=true -Datlassian.mail.fetchdisabled=true -Datlassian.mail.popdisabled=true' -<% end -%> +<% } -%> #----------------------------------------------------------------------------------- @@ -81,14 +81,14 @@ DISABLE_NOTIFICATIONS='-Datlassian.mail.senddisabled=true -Datlassian.mail.fetch # Prevents the JVM from suppressing stack traces if a given type of exception # occurs frequently, which could make it harder for support to diagnose a problem. #----------------------------------------------------------------------------------- -<%- if @jvm_type == 'openjdk-11' -%> -JVM_EXTRA_ARGS='<%= @jvm_extra_args_real %>' +<%- if $jira::jvm_type == 'openjdk-11' { -%> +JVM_EXTRA_ARGS='<%= $jira::config::jvm_extra_args_real %>' JVM_EXTRA_ARGS+='-XX:+ExplicitGCInvokesConcurrent -XX:-OmitStackTraceInFastThrow -Djava.locale.providers=COMPAT' -<%- elsif @jvm_type == 'oracle-jdk-1.8' -%> -JVM_EXTRA_ARGS='-XX:+PrintGCDateStamps -XX:+ExplicitGCInvokesConcurrent -XX:-OmitStackTraceInFastThrow -Djava.locale.providers=COMPAT <%= @jvm_extra_args_real %>' -<%- elsif @jvm_type == 'custom' -%> -JVM_EXTRA_ARGS='<%= @jvm_extra_args_real %>' -<%- end -%> +<%- } elsif $jira::jvm_type == 'oracle-jdk-1.8' { -%> +JVM_EXTRA_ARGS='-XX:+PrintGCDateStamps -XX:+ExplicitGCInvokesConcurrent -XX:-OmitStackTraceInFastThrow -Djava.locale.providers=COMPAT <%= $jira::config::jvm_extra_args_real %>' +<%- } elsif $jira::jvm_type == 'custom' { -%> +JVM_EXTRA_ARGS='<%= $jira::config::jvm_extra_args_real %>' +<%- } -%> CURRENT_NOFILES_LIMIT=$( ulimit -Hn ) ulimit -Sn "${CURRENT_NOFILES_LIMIT}" From 1841a515b881d183d43acf4a9afac749f385b575 Mon Sep 17 00:00:00 2001 From: Jarkko Oranen Date: Wed, 14 Apr 2021 16:32:33 +0300 Subject: [PATCH 04/14] convert user.sh to epp --- manifests/config.pp | 2 +- templates/{user.sh.erb => user.sh.epp} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename templates/{user.sh.erb => user.sh.epp} (68%) diff --git a/manifests/config.pp b/manifests/config.pp index 3400643e..cfae1b05 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -120,7 +120,7 @@ # Configuration logic ends, resources begin: file { "${jira::webappdir}/bin/user.sh": - content => template('jira/user.sh.erb'), + content => epp('jira/user.sh.epp'), mode => '0755', } diff --git a/templates/user.sh.erb b/templates/user.sh.epp similarity index 68% rename from templates/user.sh.erb rename to templates/user.sh.epp index 400d1c7f..9b180f03 100755 --- a/templates/user.sh.erb +++ b/templates/user.sh.epp @@ -1,5 +1,5 @@ # START INSTALLER MAGIC ! DO NOT EDIT ! -JIRA_USER="<%= @user %>" # user created by puppet +JIRA_USER="<%= $jira::user %>" # user created by puppet SHELL="/bin/bash" # # END INSTALLER MAGIC ! DO NOT EDIT ! From 9e05711b75bde4d6b24025b2d41bdb9aac5e02b1 Mon Sep 17 00:00:00 2001 From: Jarkko Oranen Date: Wed, 14 Apr 2021 17:01:25 +0300 Subject: [PATCH 05/14] convert server.xml to epp --- manifests/config.pp | 2 +- templates/server.xml.epp | 145 ++++++++++++++++++++++++++++++++++++++ templates/server.xml.erb | 147 --------------------------------------- 3 files changed, 146 insertions(+), 148 deletions(-) create mode 100644 templates/server.xml.epp delete mode 100644 templates/server.xml.erb diff --git a/manifests/config.pp b/manifests/config.pp index cfae1b05..7c216954 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -143,7 +143,7 @@ } file { "${jira::webappdir}/conf/server.xml": - content => template('jira/server.xml.erb'), + content => epp('jira/server.xml.epp'), mode => '0600', } diff --git a/templates/server.xml.epp b/templates/server.xml.epp new file mode 100644 index 00000000..a60f1a10 --- /dev/null +++ b/templates/server.xml.epp @@ -0,0 +1,145 @@ + + + + + + + + + +<%- if versioncmp($jira::version, '6.4.14') <= 0 and $jira::product =~ /^jira/ { -%> + +<% } else { -%> + +<%- } -%> + + + + address="<%= $jira::tomcat_address %>" + <%- } -%> + <%- if (versioncmp($jira::version, '7.12.1') > 0 and $jira::product =~ /^jira/ ) or $jira::product =~ /^servicedesk/ { -%> + relaxedPathChars="[]|" + relaxedQueryChars="[]|{}^\`"<>" + <%- } -%> + maxThreads="<%= $jira::tomcat_max_threads %>" + minSpareThreads="<%= $jira::tomcat_min_spare_threads %>" + connectionTimeout="<%= $jira::tomcat_connection_timeout %>" + enableLookups="<%= $jira::tomcat_enable_lookups %>" + maxHttpHeaderSize="<%= $jira::tomcat_max_http_header_size %>" + protocol="<%= $jira::tomcat_protocol %>" + useBodyEncodingForURI="<%= $jira::tomcat_use_body_encoding_for_uri %>" + acceptCount="<%= $jira::tomcat_accept_count %>" +<% if ! $jira::proxy['scheme'] { -%> + scheme="http" +<% } -%> + disableUploadTimeout="<%= $jira::tomcat_disable_upload_timeout %>" + bindOnInit="false" +<% if $jira::tomcat_native_ssl and $jira::tomcat_redirect_https_port { -%> + redirectPort="<%= $jira::tomcat_redirect_https_port %>" +<% } else { -%> + redirectPort="<%= $jira::tomcat_https_port%>" +<% } -%> +<% if $jira::proxy { -%> +<% $jira::proxy.each |$key, $value| { -%> + <%= $key %> = '<%= $value %>' +<% } -%> +<% } -%> + /> + +<% if $jira::tomcat_native_ssl { -%> + + address="<%= $jira::tomcat_address %>" + <%- } -%> + <%- if ( versioncmp($jira::version, '7.12.1') > 0 and $jira::product =~ /^jira/ ) or $jira::product =~ /^servicedesk/ { -%> + relaxedPathChars="[]|" + relaxedQueryChars="[]|{}^\`"<>" + <%- } -%> + maxHttpHeaderSize="<%= $jira::tomcat_max_http_header_size %>" + SSLEnabled="true" + maxThreads="<%= $jira::tomcat_max_threads %>" + minSpareThreads="<%= $jira::tomcat_min_spare_threads %>" + enableLookups="<%= $jira::tomcat_enable_lookups %>" + disableUploadTimeout="<%= $jira::tomcat_disable_upload_timeout %>" + acceptCount="<%= $jira::tomcat_accept_count %>" +<% if $jira::proxy['scheme'] { -%> + scheme="https" +<% } -%> + secure="true" + clientAuth="false" + sslProtocol="TLS" + useBodyEncodingForURI="true" + keyAlias="<%= $jira::tomcat_key_alias %>" + keystoreFile="<%= $jira::tomcat_keystore_file %>" + keystorePass="<%= $jira::tomcat_keystore_pass %>" + keystoreType="<%= $jira::tomcat_keystore_type %>" +<% if $jira::proxy { -%> +<% $jira::proxy.each |$key, $value| { -%> + <%= key %> = '<%= $value %>' +<% } -%> +<% } -%> + /> +<% } -%> + +<% if !empty($jira::ajp) { -%> + + <%= key %> = '<%= $value %>' +<% } -%> + /> +<% } -%> + +<% $jira::tomcat_additional_connectors.each |$port, $attrs| { -%> + + <%= $key -%>="<%= $value -%>" +<% } -%> + /> +<% } -%> + + + + + + + + + + + + + + + requestAttributesEnabled="true" +<% } -%> + pattern="<%= $jira::tomcat_accesslog_format %>"/> + +<% if $jira::tomcat_accesslog_enable_xforwarded_for { %> + +<% } -%> + + + diff --git a/templates/server.xml.erb b/templates/server.xml.erb deleted file mode 100644 index 5a603abe..00000000 --- a/templates/server.xml.erb +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - -<%- if scope.function_versioncmp([@version, '6.4.14']) <= 0 && @product =~ /^jira/ -%> - -<% else -%> - -<%- end -%> - - - - address="<%= @tomcat_address %>" - <%- end -%> - <%- if ( scope.function_versioncmp([@version, '7.12.1']) > 0 && @product =~ /^jira/ ) or @product =~ /^servicedesk/ -%> - relaxedPathChars="[]|" - relaxedQueryChars="[]|{}^\`"<>" - <%- end -%> - maxThreads="<%= @tomcat_max_threads %>" - minSpareThreads="<%= @tomcat_min_spare_threads %>" - connectionTimeout="<%= @tomcat_connection_timeout %>" - enableLookups="<%= @tomcat_enable_lookups %>" - maxHttpHeaderSize="<%= @tomcat_max_http_header_size %>" - protocol="<%= @tomcat_protocol %>" - useBodyEncodingForURI="<%= @tomcat_use_body_encoding_for_uri %>" - acceptCount="<%= @tomcat_accept_count %>" -<% if ! @proxy['scheme'] -%> - scheme="http" -<% end -%> - disableUploadTimeout="<%= @tomcat_disable_upload_timeout %>" - bindOnInit="false" -<% if @tomcat_native_ssl && @tomcat_redirect_https_port -%> - redirectPort="<%= @tomcat_redirect_https_port %>" -<% else -%> - redirectPort="<%= @tomcat_https_port%>" -<% end -%> -<% if @proxy -%> -<% @proxy.sort.each do |key,value| -%> - <%= key %> = <%= "\'#{value}\'" %> -<% end -%> -<% end -%> - /> - -<% if @tomcat_native_ssl -%> - - address="<%= @tomcat_address %>" - <%- end -%> - <%- if ( scope.function_versioncmp([@version, '7.12.1']) > 0 && @product =~ /^jira/ ) or @product =~ /^servicedesk/ -%> - relaxedPathChars="[]|" - relaxedQueryChars="[]|{}^\`"<>" - <%- end -%> - maxHttpHeaderSize="<%= @tomcat_max_http_header_size %>" - SSLEnabled="true" - maxThreads="<%= @tomcat_max_threads %>" - minSpareThreads="<%= @tomcat_min_spare_threads %>" - enableLookups="<%= @tomcat_enable_lookups %>" - disableUploadTimeout="<%= @tomcat_disable_upload_timeout %>" - acceptCount="<%= @tomcat_accept_count %>" -<% if ! @proxy['scheme'] -%> - scheme="https" -<% end -%> - secure="true" - clientAuth="false" - sslProtocol="TLS" - useBodyEncodingForURI="true" - keyAlias="<%= @tomcat_key_alias %>" - keystoreFile="<%= @tomcat_keystore_file %>" - keystorePass="<%= @tomcat_keystore_pass %>" - keystoreType="<%= @tomcat_keystore_type %>" -<% if @proxy -%> -<% @proxy.sort.each do |key,value| -%> - <%= key %>=<%= "\'#{value}\'" %> -<% end -%> -<% end -%> - /> -<% end -%> - -<% if @ajp and ! @ajp.empty? -%> - - <%= key %> = <%= "\"#{value}\"" %> -<% end -%> - /> -<% end -%> - -<% if @tomcat_additional_connectors and ! @tomcat_additional_connectors.empty? -%> -<% @tomcat_additional_connectors.sort.map do |port, attrs| -%> - - <%= key -%>="<%= value -%>" -<% end -%> - /> -<% end -%> -<% end -%> - - - - - - - - - - - - - - - requestAttributesEnabled="true" -<% end -%> - pattern="<%= @tomcat_accesslog_format %>"/> - -<% if @tomcat_accesslog_enable_xforwarded_for %> - -<% end -%> - - - From cbeefd8ff809acc173d36bde8f7f5903c123722a Mon Sep 17 00:00:00 2001 From: Jarkko Oranen Date: Wed, 14 Apr 2021 17:08:15 +0300 Subject: [PATCH 06/14] Inline jira-config.properties --- manifests/config.pp | 7 ++++++- templates/jira-config.properties.erb | 3 --- 2 files changed, 6 insertions(+), 4 deletions(-) delete mode 100644 templates/jira-config.properties.erb diff --git a/manifests/config.pp b/manifests/config.pp index 7c216954..7fdaefb4 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -153,7 +153,12 @@ } file { "${jira::homedir}/jira-config.properties": - content => template('jira/jira-config.properties.erb'), + content => inline_epp(@(EOF) + <% $merged_jira_config_properties.each |$key, $val| { -%> + <%= $key %> = <%= $val %> + <%- } -%> + | EOF + ), mode => '0600', } diff --git a/templates/jira-config.properties.erb b/templates/jira-config.properties.erb deleted file mode 100644 index 77af1dd1..00000000 --- a/templates/jira-config.properties.erb +++ /dev/null @@ -1,3 +0,0 @@ -<% @merged_jira_config_properties.sort.each do |key,value| -%> -<%= key %> = <%= value %> -<% end -%> \ No newline at end of file From 4f3b8e1fe77b6ab10d49a0a47c51e168a64829b3 Mon Sep 17 00:00:00 2001 From: Jarkko Oranen Date: Wed, 14 Apr 2021 17:12:52 +0300 Subject: [PATCH 07/14] convert context.xml to epp --- manifests/config.pp | 2 +- templates/{context.xml.erb => context.xml.epp} | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) rename templates/{context.xml.erb => context.xml.epp} (85%) diff --git a/manifests/config.pp b/manifests/config.pp index 7fdaefb4..553b8d8b 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -148,7 +148,7 @@ } file { "${jira::webappdir}/conf/context.xml": - content => template('jira/context.xml.erb'), + content => epp('jira/context.xml.epp'), mode => '0600', } diff --git a/templates/context.xml.erb b/templates/context.xml.epp similarity index 85% rename from templates/context.xml.erb rename to templates/context.xml.epp index de07e842..79eb11e9 100644 --- a/templates/context.xml.erb +++ b/templates/context.xml.epp @@ -32,14 +32,12 @@ --> -<% if ! scope.lookupvar('jira::resources').empty? -%> -<% scope.lookupvar('jira::resources').each do |name, values| -%> +<% $jira::resources.each |$name, $values| { -%> - <%= key %> = <%= "\"#{value}\"" %> -<% end -%> +<% $values.each |$key, $value| { -%> + <%= $key %> = "<%= $value %>" +<% } -%> /> -<% end -%> -<% end -%> +<% } -%> From bcf4a0d9608b70660014ea45fdcc70e35a8d08f9 Mon Sep 17 00:00:00 2001 From: Jarkko Oranen Date: Wed, 14 Apr 2021 17:15:42 +0300 Subject: [PATCH 08/14] convert facts.rb to epp --- manifests/facts.pp | 2 +- templates/{facts.rb.erb => facts.rb.epp} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename templates/{facts.rb.erb => facts.rb.epp} (76%) diff --git a/manifests/facts.pp b/manifests/facts.pp index 6d591971..40b70765 100644 --- a/manifests/facts.pp +++ b/manifests/facts.pp @@ -44,7 +44,7 @@ file { "${dir}/facts.d/jira_facts.rb": ensure => $ensure, - content => template('jira/facts.rb.erb'), + content => epp('jira/facts.rb.epp'), mode => '0755', } } diff --git a/templates/facts.rb.erb b/templates/facts.rb.epp similarity index 76% rename from templates/facts.rb.erb rename to templates/facts.rb.epp index 7057acee..44c59389 100644 --- a/templates/facts.rb.erb +++ b/templates/facts.rb.epp @@ -1,4 +1,4 @@ -#!<%= @ruby_bin %> +#!<%= $jira::facts::ruby_bin %> # Facts: # - jira_buildNumber # - jira_version @@ -13,7 +13,7 @@ require 'json' require 'uri' begin - url = 'http://<%= @uri %>:<%= @port %><%= @contextpath %>/rest/api/2/serverInfo' + url = 'http://<%= $jira::facts::uri %>:<%= $jira::facts::port %><%= $jira::facts::contextpath %>/rest/api/2/serverInfo' info = URI.open(url).read rescue exit 0 From 5a860ed6d4b520f558232758fca9c05cada5354d Mon Sep 17 00:00:00 2001 From: Jarkko Oranen Date: Wed, 14 Apr 2021 17:18:05 +0300 Subject: [PATCH 09/14] convert crowd.properties to epp --- manifests/sso.pp | 2 +- templates/crowd.properties | 11 ----------- templates/crowd.properties.epp | 11 +++++++++++ 3 files changed, 12 insertions(+), 12 deletions(-) delete mode 100644 templates/crowd.properties create mode 100644 templates/crowd.properties.epp diff --git a/manifests/sso.pp b/manifests/sso.pp index 4b568115..414cecd7 100644 --- a/manifests/sso.pp +++ b/manifests/sso.pp @@ -15,7 +15,7 @@ ) { file { "${jira::webappdir}/atlassian-jira/WEB-INF/classes/crowd.properties": ensure => file, - content => template('jira/crowd.properties'), + content => epp('jira/crowd.properties.epp'), mode => '0660', owner => $jira::user, group => $jira::group, diff --git a/templates/crowd.properties b/templates/crowd.properties deleted file mode 100644 index e29f2bb8..00000000 --- a/templates/crowd.properties +++ /dev/null @@ -1,11 +0,0 @@ -application.name <%= @application_name %> -application.password <%= @application_password %> -application.login.url <%= @application_login_url %> - -crowd.server.url <%= @crowd_server_url %> -crowd.base.url <%= @crowd_base_url %> - -session.isauthenticated <%= @session_isauthenticated %> -session.tokenkey <%= @session_tokenkey %> -session.validationinterval <%= @session_validationinterval %> -session.lastvalidation <%= @session_lastvalidation %> diff --git a/templates/crowd.properties.epp b/templates/crowd.properties.epp new file mode 100644 index 00000000..10b7d3ae --- /dev/null +++ b/templates/crowd.properties.epp @@ -0,0 +1,11 @@ +application.name <%= $jira::sso::application_name %> +application.password <%= $jira::sso::application_password %> +application.login.url <%= $jira::sso::application_login_url %> + +crowd.server.url <%= $jira::sso::crowd_server_url %> +crowd.base.url <%= $jira::sso::crowd_base_url %> + +session.isauthenticated <%= $jira::sso::session_isauthenticated %> +session.tokenkey <%= $jira::sso::session_tokenkey %> +session.validationinterval <%= $jira::sso::session_validationinterval %> +session.lastvalidation <%= $jira::sso::session_lastvalidation %> From c9f770e333cb900f569d200fc3f9f41b54f7dbd2 Mon Sep 17 00:00:00 2001 From: Jarkko Oranen Date: Wed, 14 Apr 2021 17:23:08 +0300 Subject: [PATCH 10/14] convert cluster.properties to epp --- manifests/config.pp | 2 +- templates/cluster.properties.epp | 13 +++++++++++++ templates/cluster.properties.erb | 13 ------------- 3 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 templates/cluster.properties.epp delete mode 100644 templates/cluster.properties.erb diff --git a/manifests/config.pp b/manifests/config.pp index 553b8d8b..ccea7bf0 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -164,7 +164,7 @@ if $jira::datacenter { file { "${jira::homedir}/cluster.properties": - content => template('jira/cluster.properties.erb'), + content => epp('jira/cluster.properties.epp'), mode => '0600', } } diff --git a/templates/cluster.properties.epp b/templates/cluster.properties.epp new file mode 100644 index 00000000..38c50cdc --- /dev/null +++ b/templates/cluster.properties.epp @@ -0,0 +1,13 @@ +# This ID must be unique across the cluster +jira.node.id = <%= $facts['fqdn'] %> +# The location of the shared home directory for all JIRA nodes +jira.shared.home = <%= $jira::shared_homedir %> +<% if $jira::ehcache_listener_host { -%> +ehcache.listener.hostName = <%= $jira::ehcache_listener_host %> +<% } -%> +<% if $jira::ehcache_listener_port { -%> +ehcache.listener.port = <%= $jira::ehcache_listener_port %> +<% } -%> +<% if $jira::ehcache_object_port { -%> +ehcache.object.port = <%= $jira::ehcache_object_port %> +<% } -%> diff --git a/templates/cluster.properties.erb b/templates/cluster.properties.erb deleted file mode 100644 index a354ac55..00000000 --- a/templates/cluster.properties.erb +++ /dev/null @@ -1,13 +0,0 @@ -# This ID must be unique across the cluster -jira.node.id = <%= scope.lookupvar("fqdn") %> -# The location of the shared home directory for all JIRA nodes -jira.shared.home = <%= scope.lookupvar("jira::shared_homedir") %> -<% if @ehcache_listener_host -%> -ehcache.listener.hostName = <%= @ehcache_listener_host %> -<% end -%> -<% if @ehcache_listener_port -%> -ehcache.listener.port = <%= @ehcache_listener_port %> -<% end -%> -<% if @ehcache_object_port -%> -ehcache.object.port = <%= @ehcache_object_port %> -<% end -%> From 83a0db32fba1cd5b2adf8b53236b7271c34241b4 Mon Sep 17 00:00:00 2001 From: Jarkko Oranen Date: Wed, 14 Apr 2021 18:21:09 +0300 Subject: [PATCH 11/14] Add jira::sort_hash function to keep sorted order This is not public API --- functions/sort_hash.pp | 4 ++++ manifests/config.pp | 2 +- templates/context.xml.epp | 6 +++--- templates/server.xml.epp | 10 +++++----- 4 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 functions/sort_hash.pp diff --git a/functions/sort_hash.pp b/functions/sort_hash.pp new file mode 100644 index 00000000..50b2705a --- /dev/null +++ b/functions/sort_hash.pp @@ -0,0 +1,4 @@ +function jira::sort_hash(Hash $input) { + # Puppet hashes are "insertion order", so this works to sort by key + Hash(sort(Array($input))) +} diff --git a/manifests/config.pp b/manifests/config.pp index ccea7bf0..6b06aab9 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -115,7 +115,7 @@ } } - $merged_jira_config_properties = merge({ 'jira.websudo.is.disabled' => !$jira::enable_secure_admin_sessions }, $jira::jira_config_properties) + $merged_jira_config_properties = jira::sort_hash({ 'jira.websudo.is.disabled' => !$jira::enable_secure_admin_sessions } + $jira::jira_config_properties) # Configuration logic ends, resources begin: diff --git a/templates/context.xml.epp b/templates/context.xml.epp index 79eb11e9..59a0342b 100644 --- a/templates/context.xml.epp +++ b/templates/context.xml.epp @@ -32,9 +32,9 @@ --> -<% $jira::resources.each |$name, $values| { -%> - +<% jira::sort_hash($jira::resources).each |$name, $values| { -%> + <%= $key %> = "<%= $value %>" <% } -%> /> diff --git a/templates/server.xml.epp b/templates/server.xml.epp index a60f1a10..d035f2dc 100644 --- a/templates/server.xml.epp +++ b/templates/server.xml.epp @@ -56,7 +56,7 @@ redirectPort="<%= $jira::tomcat_https_port%>" <% } -%> <% if $jira::proxy { -%> -<% $jira::proxy.each |$key, $value| { -%> +<% jira::sort_hash($jira::proxy).each |$key, $value| { -%> <%= $key %> = '<%= $value %>' <% } -%> <% } -%> @@ -92,7 +92,7 @@ keystorePass="<%= $jira::tomcat_keystore_pass %>" keystoreType="<%= $jira::tomcat_keystore_type %>" <% if $jira::proxy { -%> -<% $jira::proxy.each |$key, $value| { -%> +<% jira::sort_hash($jira::proxy).each |$key, $value| { -%> <%= key %> = '<%= $value %>' <% } -%> <% } -%> @@ -101,15 +101,15 @@ <% if !empty($jira::ajp) { -%> +<% jira::sort_hash($jira::ajp).each |$key, $value| { -%> <%= key %> = '<%= $value %>' <% } -%> /> <% } -%> -<% $jira::tomcat_additional_connectors.each |$port, $attrs| { -%> +<% jira::sort_hash($jira::tomcat_additional_connectors).each |$port, $attrs| { -%> +<% jira::sort_hash($attrs).each |$key, $value| { -%> <%= $key -%>="<%= $value -%>" <% } -%> /> From 8f92b9c3b09acfaad3bca9fcea0ebd262758b3f0 Mon Sep 17 00:00:00 2001 From: Jarkko Oranen Date: Wed, 14 Apr 2021 18:51:14 +0300 Subject: [PATCH 12/14] Fix lints and some server.xml breakage --- manifests/config.pp | 16 ++++++++-------- templates/server.xml.epp | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index 6b06aab9..8ab577e9 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -14,8 +14,6 @@ # limitations under the License. # ----------------------------------------------------------------------------- class jira::config inherits jira { - - # This class should be used from init.pp with a dependency on jira::install # and sending a refresh to jira::service # We need to inherit jira because the templates use lots of @var @@ -34,7 +32,6 @@ # can't use pick_default: https://tickets.puppetlabs.com/browse/MODULES-11018 $dbschema = if $jira::dbschema { $jira::dbschema } else { $dbschema_default } - if $jira::java_opts { deprecation('jira::java_opts', 'jira::java_opts is deprecated. Please use jira::jvm_extra_args') $jvm_extra_args_real = "${jira::java_opts} ${jira::jvm_extra_args}" @@ -115,7 +112,10 @@ } } - $merged_jira_config_properties = jira::sort_hash({ 'jira.websudo.is.disabled' => !$jira::enable_secure_admin_sessions } + $jira::jira_config_properties) + $jira_properties = { + 'jira.websudo.is.disabled' => !$jira::enable_secure_admin_sessions, + } + $merged_jira_config_properties = jira::sort_hash($jira_properties + $jira::jira_config_properties) # Configuration logic ends, resources begin: @@ -154,10 +154,10 @@ file { "${jira::homedir}/jira-config.properties": content => inline_epp(@(EOF) - <% $merged_jira_config_properties.each |$key, $val| { -%> - <%= $key %> = <%= $val %> - <%- } -%> - | EOF + <% $merged_jira_config_properties.each |$key, $val| { -%> + <%= $key %> = <%= $val %> + <%- } -%> + | EOF ), mode => '0600', } diff --git a/templates/server.xml.epp b/templates/server.xml.epp index d035f2dc..c5fb329c 100644 --- a/templates/server.xml.epp +++ b/templates/server.xml.epp @@ -65,7 +65,7 @@ <% if $jira::tomcat_native_ssl { -%> address="<%= $jira::tomcat_address %>" <%- } -%> @@ -102,7 +102,7 @@ <% if !empty($jira::ajp) { -%> - <%= key %> = '<%= $value %>' + <%= $key %> = "<%= $value %>" <% } -%> /> <% } -%> From 7349e02857b935f9243ec8310a5b36dd9fde03eb Mon Sep 17 00:00:00 2001 From: Jarkko Oranen Date: Wed, 14 Apr 2021 19:19:07 +0300 Subject: [PATCH 13/14] We should be able to remove inheritance now that EPP conversions are green --- manifests/config.pp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index 8ab577e9..8d26603a 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -13,10 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # ----------------------------------------------------------------------------- -class jira::config inherits jira { +class jira::config { # This class should be used from init.pp with a dependency on jira::install # and sending a refresh to jira::service - # We need to inherit jira because the templates use lots of @var assert_private() File { From 54f6ae547720a2761b2d7916dd1e3dda7edf3fdf Mon Sep 17 00:00:00 2001 From: Jarkko Oranen Date: Thu, 15 Apr 2021 18:09:04 +0300 Subject: [PATCH 14/14] Properly document jira::sorted_hash as private Co-authored-by: Ewoud Kohl van Wijngaarden --- functions/sort_hash.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/functions/sort_hash.pp b/functions/sort_hash.pp index 50b2705a..72745e32 100644 --- a/functions/sort_hash.pp +++ b/functions/sort_hash.pp @@ -1,4 +1,6 @@ -function jira::sort_hash(Hash $input) { +# @summary Return a sorted hash +# @api private +function jira::sort_hash(Hash $input) >> Hash { # Puppet hashes are "insertion order", so this works to sort by key Hash(sort(Array($input))) }