From 664fd47445e4a51763d3745c92579a1ce7f30ed0 Mon Sep 17 00:00:00 2001 From: Michael Kluge Date: Tue, 15 Jun 2021 17:31:56 +0200 Subject: [PATCH 1/3] Extend the version check to the tailored jira servicedesk version --- manifests/init.pp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 090b7e31..6bc3d497 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -274,7 +274,7 @@ # Jira Settings String $version = '8.13.5', - String $product = 'jira', + Enum['jira', 'servicedesk', 'jira-core'] $product = 'jira', Stdlib::Absolutepath $installdir = '/opt/jira', Stdlib::Absolutepath $homedir = '/home/jira', Boolean $manage_user = true, @@ -354,7 +354,7 @@ # Command to stop jira in preparation to upgrade. This is configurable # incase the jira service is managed outside of puppet. eg: using the # puppetlabs-corosync module: 'crm resource stop jira && sleep 15' - # Note: the command should return either 0 or 5 + # Note: the command should return either 0 or 5 # when the service doesn't exist String $stop_jira = 'systemctl stop jira.service && sleep 15', # Whether to manage the 'check-java.sh' script, and where to retrieve @@ -412,9 +412,12 @@ Optional[Integer[0]] $poolsize = undef, Optional[Boolean] $enable_connection_pooling = undef, ) { - if versioncmp($jira::version, '8.0.0') < 0 { + if $product == 'jira' and versioncmp($jira::version, '8.0.0') < 0 { fail('JIRA versions older than 8.0.0 are no longer supported. Please use an older version of this module to upgrade first.') } + if $product == 'servicedesk' and versioncmp($jira::version, '4.10.0') < 0 { + fail('JIRA servicedesk versions older than 4.10.0 are no longer supported. Please use an older version of this module to upgrade first.') + } if $datacenter and !$shared_homedir { fail("\$shared_homedir must be set when \$datacenter is true") From adc39eb36d4b8270c16daf72a14dd7d4752dfaa3 Mon Sep 17 00:00:00 2001 From: Jarkko Oranen Date: Tue, 6 Jul 2021 12:43:20 +0300 Subject: [PATCH 2/3] Avoid introducing breaking changes With these changes, the issue can be fixed without breaking the API. --- manifests/init.pp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 6bc3d497..c3f2be72 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -274,7 +274,7 @@ # Jira Settings String $version = '8.13.5', - Enum['jira', 'servicedesk', 'jira-core'] $product = 'jira', + String[1] $product = 'jira', Stdlib::Absolutepath $installdir = '/opt/jira', Stdlib::Absolutepath $homedir = '/home/jira', Boolean $manage_user = true, @@ -412,7 +412,8 @@ Optional[Integer[0]] $poolsize = undef, Optional[Boolean] $enable_connection_pooling = undef, ) { - if $product == 'jira' and versioncmp($jira::version, '8.0.0') < 0 { + // To maintain compatibility with previous behaviour, we check for not-servicedesk instead of specifying the + if $product != 'servicedesk' and versioncmp($jira::version, '8.0.0') < 0 { fail('JIRA versions older than 8.0.0 are no longer supported. Please use an older version of this module to upgrade first.') } if $product == 'servicedesk' and versioncmp($jira::version, '4.10.0') < 0 { From fdf8350876f8f81e6b1007da527e621a0e01e004 Mon Sep 17 00:00:00 2001 From: Jarkko Oranen Date: Tue, 6 Jul 2021 12:45:12 +0300 Subject: [PATCH 3/3] Use correct comment syntax My brain was in C mode somehow. --- manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index c3f2be72..e43c9c12 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -412,7 +412,7 @@ Optional[Integer[0]] $poolsize = undef, Optional[Boolean] $enable_connection_pooling = undef, ) { - // To maintain compatibility with previous behaviour, we check for not-servicedesk instead of specifying the + # To maintain compatibility with previous behaviour, we check for not-servicedesk instead of specifying the if $product != 'servicedesk' and versioncmp($jira::version, '8.0.0') < 0 { fail('JIRA versions older than 8.0.0 are no longer supported. Please use an older version of this module to upgrade first.') }