Skip to content

Commit

Permalink
Drop JIRA pre 8.0.0 support; it's EOL
Browse files Browse the repository at this point in the history
  • Loading branch information
oranenj committed Apr 15, 2021
1 parent d744e32 commit 7594502
Show file tree
Hide file tree
Showing 10 changed files with 161 additions and 243 deletions.
21 changes: 4 additions & 17 deletions jira.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
# 2.) Modify the database settings below according to your setup
#
# Atlassian jira Git Enterprise Source Control Server
jira::jira_name: jira
jira::version: 5.1.7
jira::format: tar.gz
jira::version: 8.13.5

# Directory where the webapp will run from
jira::installdir: /opt/jira
Expand All @@ -40,14 +38,6 @@ jira::db: postgresql
#jira::db: oracle
#jira::db: sqlserver

jira::dbtype: postgres72
#jira::dbtype: mysql
#jira::dbtype: mssql

jira::dbdriver: org.postgresql.Driver
#jira::dbdriver: com.mysql.jdbc.Driver
#jira::dbdriver: com.microsoft.sqlserver.jdbc.SQLServerDriver

# Change these values to your jira database credentials
jira::dbuser: jiraadm
jira::dbpassword: jiraadm
Expand All @@ -62,8 +52,6 @@ jira::dbport: 5432
# Schema
# Default for postgres
jira::dbschema: 'public'
# Default for mssql
#jira::dbschema: 'dbo'

# The connection pool parameters
jira::pool_min_size: 20
Expand All @@ -83,11 +71,10 @@ jira::pool_test_on_borrow: true
jira::dbserver: localhost

# Tomcat configuration
# TODO because I'm never a fan of the stock tomcat settings
jira::javahome: /opt/java/jdk1.6.0_33
jira::javahome: /opt/java/openjdk-11-jre
jira::jvm_xmx: 1024m
jira::jvm_optional: -XX:-HeapDumpOnOutOfMemoryError
#jira::jvm_optional: -XX:NewSize=256m -XX:MaxNewSize=256m -XX:SurvivorRatio=16
jira::java_opts: -XX:-HeapDumpOnOutOfMemoryError
#jira::java_opts: -XX:NewSize=256m -XX:MaxNewSize=256m -XX:SurvivorRatio=16
# the New and SR figures are purely optional
# for heap dumps add -XX:-HeapDumpOnOutOfMemoryError
# by default jira has 256m permgen which is a good setting to go with
Expand Down
10 changes: 1 addition & 9 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,7 @@
}
}

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'
}
}
$tomcat_protocol_ssl_real = pick($jira::tomcat_protocol_ssl, 'org.apache.coyote.http11.Http11NioProtocol')

$jira_properties = {
'jira.websudo.is.disabled' => !$jira::enable_secure_admin_sessions,
Expand Down
29 changes: 11 additions & 18 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@
class jira (

# Jira Settings
String $version = '8.13.4',
String $version = '8.13.5',
String $product = 'jira',
String $format = 'tar.gz',
Stdlib::Absolutepath $installdir = '/opt/jira',
Stdlib::Absolutepath $homedir = '/home/jira',
Boolean $manage_user = true,
Expand Down Expand Up @@ -165,6 +164,10 @@
Optional[String] $java_opts = undef,
Optional[Boolean] $enable_connection_pooling = undef,
) inherits jira::params {
if 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 $datacenter and !$shared_homedir {
fail("\$shared_homedir must be set when \$datacenter is true")
}
Expand All @@ -179,13 +182,16 @@
}
}

# The default Jira product starting with version 7 is 'jira-software'
if ((versioncmp($version, '7.0.0') >= 0) and ($product == 'jira')) {
# The default Jira product starting with version 7 is 'jira-software',
# but some old configuration may explicitly specify 'jira'
if $product == 'jira' {
$product_name = 'jira-software'
} else {
$product_name = $product
}

$webappdir = "${installdir}/atlassian-${product_name}-${version}-standalone"

if defined('$::jira_version') {
# If the running version of JIRA is less than the expected version of JIRA
# Shut it down in preparation for upgrade.
Expand All @@ -195,13 +201,6 @@
}
}

$extractdir = "${installdir}/atlassian-${product_name}-${version}-standalone"
if $format == zip {
$webappdir = "${extractdir}/atlassian-${product_name}-${version}-standalone"
} else {
$webappdir = $extractdir
}

if ! empty($ajp) {
if ! ('port' in $ajp) {
fail('You need to specify a valid port for the AJP connector.')
Expand All @@ -219,17 +218,11 @@
fail('You need to specify a value for javahome')
}

# Archive module checksum_verify = true; this verifies checksum if provided, doesn't if not.
if $checksum == undef {
$checksum_verify = false
} else {
$checksum_verify = true
}

contain jira::install
contain jira::config
contain jira::service


Class['jira::install']
-> Class['jira::config']
~> Class['jira::service']
Expand Down
46 changes: 12 additions & 34 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
}
}

file { $jira::homedir:
ensure => 'directory',
owner => $jira::user,
group => $jira::group,
}

if ! defined(File[$jira::installdir]) {
file { $jira::installdir:
ensure => 'directory',
Expand All @@ -42,30 +48,9 @@
}
}

# Examples of product tarballs from Atlassian
# Core - atlassian-jira-core-7.0.3.tar.gz
# Software (pre-7) - atlassian-jira-6.4.12.tar.gz
# Software (7 to 7.1.8 ) - atlassian-jira-software-7.0.4-jira-7.0.4.tar.gz
# Software (7.1.9 and up) - atlassian-jira-software-7.1.9.tar.gz

if (versioncmp($jira::version, '7.1.9') < 0) {
if ((versioncmp($jira::version, '7.0.0') < 0) or ($jira::product_name == 'jira-core')) {
$file = "atlassian-${jira::product_name}-${jira::version}.${jira::format}"
} else {
$file = "atlassian-${jira::product_name}-${jira::version}-jira-${jira::version}.${jira::format}"
}
} else {
$file = "atlassian-${jira::product_name}-${jira::version}.${jira::format}"
}

if ! defined(File[$jira::extractdir]) {
file { $jira::extractdir:
ensure => 'directory',
owner => $jira::user,
group => $jira::group,
}
}
$file = "atlassian-${jira::product_name}-${jira::version}.tar.gz"

# webappdir is defined in init.pp because other things depend on it.
if ! defined(File[$jira::webappdir]) {
file { $jira::webappdir:
ensure => 'directory',
Expand All @@ -82,29 +67,22 @@
source => "${jira::download_url}/${file}",
creates => "${jira::webappdir}/conf",
cleanup => true,
checksum_verify => $jira::checksum_verify,
checksum_verify => ($jira::checksum != undef),
checksum_type => 'md5',
checksum => $jira::checksum,
user => $jira::user,
group => $jira::group,
proxy_server => $jira::proxy_server,
proxy_type => $jira::proxy_type,
before => File[$jira::homedir],
require => [
File[$jira::installdir],
File[$jira::webappdir],
User[$jira::user],
File[$jira::webappdir],
],
}

file { $jira::homedir:
ensure => 'directory',
owner => $jira::user,
group => $jira::group,
}

-> exec { "chown_${jira::extractdir}":
command => "/bin/chown -R ${jira::user}:${jira::group} ${jira::extractdir}",
-> exec { "chown_${jira::webappdir}":
command => "/bin/chown -R ${jira::user}:${jira::group} ${jira::webappdir}",
refreshonly => true,
subscribe => User[$jira::user],
}
Expand Down
Loading

0 comments on commit 7594502

Please sign in to comment.