55describe 'jira mysql' do
66 it 'installs with defaults' do
77 pp = <<-EOS
8+ # On ubuntu 20.04 and 22.04 the default is to install mariadb
9+ # As the ubuntu 20.04 runner we use in github actions allready has mysql installed
10+ # a apparmor error is triggerd when using mariadb in this test..
11+ # Forcing the use of mysql
12+ if $facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['major'], '20.04') >= 0 {
13+ $mysql_service_name = 'mysql'
14+ $mysql_server_package = 'mysql-server'
15+ $mysql_client_package = 'mysql-client'
16+ } else {
17+ $mysql_service_name = undef
18+ $mysql_server_package = undef
19+ $mysql_client_package = undef
20+ }
21+
822 class { 'mysql::server':
923 root_password => 'strongpassword',
24+ package_name => $mysql_server_package,
25+ service_name => $mysql_service_name,
26+ }
27+ class { 'mysql::client':
28+ package_name => $mysql_client_package,
1029 }
1130
1231 # Default MySQL is too old for utf8mb4 on CentOS 7, or something. Also Ubuntu 20.04
@@ -46,19 +65,23 @@ class { 'java':
4665 require => Exec['tmpkey'],
4766 }
4867
68+ # There is a bug in the check-java.sh that prevents jira from starting on Centos Stream 8
69+ # https://jira.atlassian.com/browse/JRASERVER-77097
70+ # Running with script_check_java_manage => true to solve this
4971 class { 'jira':
50- installdir => '/opt/atlassian-jira',
51- homedir => '/opt/jira-home',
52- javahome => '/usr',
53- jvm_type => 'oracle-jdk-1.8',
54- db => 'mysql',
55- dbport => 3306,
56- dbdriver => 'com.mysql.jdbc.Driver',
57- dbtype => 'mysql',
58- tomcat_port => 8081,
59- tomcat_native_ssl => true,
60- tomcat_keystore_file => '/tmp/jira.ks',
61- require => [Mysql::Db['jira'], Java_ks['jira']],
72+ installdir => '/opt/atlassian-jira',
73+ homedir => '/opt/jira-home',
74+ javahome => '/usr',
75+ jvm_type => 'oracle-jdk-1.8',
76+ db => 'mysql',
77+ dbport => 3306,
78+ dbdriver => 'com.mysql.jdbc.Driver',
79+ dbtype => 'mysql',
80+ tomcat_port => 8081,
81+ tomcat_native_ssl => true,
82+ tomcat_keystore_file => '/tmp/jira.ks',
83+ script_check_java_manage => true,
84+ require => [Mysql::Db['jira'], Java_ks['jira']],
6285 }
6386 EOS
6487
@@ -68,7 +91,7 @@ class { 'jira':
6891 shell wget_cmd , acceptable_exit_codes : [ 0 , 8 ]
6992 sleep SLEEP_SECONDS
7093 shell wget_cmd , acceptable_exit_codes : [ 0 , 8 ]
71- sleep SLEEP_SECONDS
94+
7295 apply_manifest ( pp , catch_changes : true )
7396 end
7497
@@ -85,10 +108,9 @@ class { 'jira':
85108 it { is_expected . to be_running }
86109 end
87110
88- specify do
89- expect ( user ( 'jira' ) ) . to exist .
90- and belong_to_group 'jira' .
91- and have_login_shell '/bin/true'
111+ describe user ( 'jira' ) do
112+ it { is_expected . to belong_to_group 'jira' }
113+ it { is_expected . to have_login_shell '/bin/true' }
92114 end
93115
94116 specify do
0 commit comments