Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Data type: `String`

The JIRA version to install or upgrade to. Changing this will trigger a restart

Default value: `'8.13.5'`
Default value: `'9.12.0'`

##### <a name="-jira--product"></a>`product`

Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
class jira (

# Jira Settings
String $version = '8.13.5',
String $version = '9.12.0',
String[1] $product = 'jira',
Stdlib::Absolutepath $installdir = '/opt/jira',
Stdlib::Absolutepath $homedir = '/home/jira',
Expand Down
23 changes: 9 additions & 14 deletions spec/acceptance/default_parameters_jira_10_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,28 +55,23 @@ class { 'postgresql::server':
password => postgresql::postgresql_password('jiraadm', 'mypassword'),
}

# There is a bug in the check-java.sh that prevents jira from starting on Centos Stream 8
# https://jira.atlassian.com/browse/JRASERVER-77097
# Running with script_check_java_manage => true to solve this
class { 'jira':
version => '10.3.2',
java_package => $java_package,
javahome => $java_home,
script_check_java_manage => false,
connection_settings => 'tcpKeepAlive=true',
require => Postgresql::Server::Db['jira'],
version => '10.3.2',
java_package => $java_package,
javahome => $java_home,
connection_settings => 'tcpKeepAlive=true',
require => Postgresql::Server::Db['jira'],
}
EOS

pp = pre + pp

pp_upgrade = <<-EOS
class { 'jira':
version => '10.3.3',
java_package => $java_package,
javahome => $java_home,
connection_settings => 'tcpKeepAlive=true',
script_check_java_manage => false,
version => '10.3.3',
java_package => $java_package,
javahome => $java_home,
connection_settings => 'tcpKeepAlive=true',
}
EOS

Expand Down
38 changes: 5 additions & 33 deletions spec/acceptance/default_parameters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,28 @@
describe 'jira postgresql' do
it 'installs with defaults' do
pp = <<-EOS
$java_package = $facts['os']['family'] ? {
'RedHat' => 'java-11-openjdk-headless',
'Debian' => 'openjdk-11-jre-headless',
}

$java_home = $facts['os']['family'] ? {
'RedHat' => '/usr/lib/jvm/jre-11-openjdk',
'Debian' => '/usr/lib/jvm/java-1.11.0-openjdk-amd64',
}

# The output of `systemctl status postgresql` is non ascii which
# breaks the Exec in Postgresql::Server::Instance::Reload
# on rhel based docker containers
# We don't need the output.
class { 'postgresql::server':
service_status => 'systemctl status postgresql > /dev/null',
needs_initdb => true
needs_initdb => true,
}

postgresql::server::db { 'jira':
user => 'jiraadm',
password => postgresql::postgresql_password('jiraadm', 'mypassword'),
}

# There is a bug in the check-java.sh that prevents jira from starting on Centos Stream 8
# https://jira.atlassian.com/browse/JRASERVER-77097
# Running with script_check_java_manage => true to solve this
class { 'jira':
java_package => $java_package,
javahome => $java_home,
script_check_java_manage => true,
require => Postgresql::Server::Db['jira'],
require => Postgresql::Server::Db['jira'],
}
EOS
pp_upgrade = <<-EOS
$java_package = $facts['os']['family'] ? {
'RedHat' => 'java-11-openjdk-headless',
'Debian' => 'openjdk-11-jre-headless',
}

$java_home = $facts['os']['family'] ? {
'RedHat' => '/usr/lib/jvm/jre-11-openjdk',
'Debian' => '/usr/lib/jvm/java-1.11.0-openjdk-amd64',
}

pp_upgrade = <<-EOS
class { 'jira':
version => '8.16.0',
java_package => $java_package,
javahome => $java_home,
script_check_java_manage => true
version => '9.12.29',
}
EOS

Expand Down Expand Up @@ -100,7 +72,7 @@ class { 'jira':
end

describe command('wget -q --tries=54 --retry-connrefused --read-timeout=10 -O- localhost:8080') do
its(:stdout) { is_expected.to include('8.16.0') }
its(:stdout) { is_expected.to include('9.12.29') }
end

describe 'shutdown' do
Expand Down
3 changes: 3 additions & 0 deletions spec/acceptance/hieradata/family/Debian.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
jira::java_package: openjdk-17-jre
jira::javahome: /usr/lib/jvm/java-17-openjdk-amd64
3 changes: 3 additions & 0 deletions spec/acceptance/hieradata/family/RedHat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
jira::java_package: java-17-openjdk
jira::javahome: /usr/lib/jvm/jre-17-openjdk
53 changes: 7 additions & 46 deletions spec/acceptance/mysql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,47 +21,14 @@ class { 'mysql::server':
grant => ['ALL'],
}

class { 'java':
distribution => 'jre',
}

exec { 'tmpkey':
command => "openssl req -x509 -nodes -days 1 -subj '/C=CA/ST=QC/L=Montreal/O=FOO/CN=${facts['networking']['fqdn']}' -newkey rsa:1024 -keyout /tmp/key.pem -out /tmp/cert.pem",
path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ],
creates => '/tmp/cert.pem',
}

java_ks { 'jira':
ensure => present,
name => 'jira',
certificate => '/tmp/cert.pem',
private_key => '/tmp/key.pem',
target => '/tmp/jira.ks',
password => 'changeit',
require => Exec['tmpkey'],
}

# There is a bug in the check-java.sh that prevents jira from starting on Centos Stream 8
# https://jira.atlassian.com/browse/JRASERVER-77097
# Running with script_check_java_manage => true to solve this
class { 'jira':
installdir => '/opt/atlassian-jira',
homedir => '/opt/jira-home',
javahome => '/usr',
jvm_type => 'oracle-jdk-1.8',
db => 'mysql',
dbport => 3306,
dbdriver => 'com.mysql.jdbc.Driver',
dbtype => 'mysql',
tomcat_port => 8081,
tomcat_native_ssl => true,
tomcat_keystore_file => '/tmp/jira.ks',
script_check_java_manage => true,
require => [Mysql::Db['jira'], Java_ks['jira']],
db => 'mysql',
require => Mysql::Db['jira'],
}
EOS

wget_cmd = 'wget -q --tries=24 --retry-connrefused --read-timeout=10 --no-check-certificate localhost:8081'
# jira just takes *ages* to start up :-(
wget_cmd = 'wget -q --tries=24 --retry-connrefused --read-timeout=10 localhost:8080'
apply_manifest(pp, catch_failures: true)
sleep SLEEP_SECONDS
shell wget_cmd, acceptable_exit_codes: [0, 8]
Expand All @@ -75,7 +42,7 @@ class { 'jira':
it { is_expected.to be_running }
end

describe port(8081) do
describe port(8080) do
it { is_expected.to be_listening }
end

Expand All @@ -89,14 +56,8 @@ class { 'jira':
it { is_expected.to have_login_shell '/bin/true' }
end

specify do
expect(command('wget -q --tries=24 --retry-connrefused --no-check-certificate --read-timeout=10 -O- localhost:8081')).
to have_attributes(stdout: %r{8.13.5})
end

specify do
expect(command('wget -q --tries=24 --retry-connrefused --no-check-certificate --read-timeout=10 -O- https://localhost:8443')).
to have_attributes(stdout: %r{8.13.5})
describe command('wget -q --tries=54 --retry-connrefused --read-timeout=10 -O- localhost:8080') do
its(:stdout) { is_expected.to include('9.12.0') }
end

describe 'shutdown' do
Expand Down