5
5
describe 'jira mysql' do
6
6
it 'installs with defaults' do
7
7
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
+
8
22
class { 'mysql::server':
9
23
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,
10
29
}
11
30
12
31
# Default MySQL is too old for utf8mb4 on CentOS 7, or something. Also Ubuntu 20.04
@@ -46,19 +65,23 @@ class { 'java':
46
65
require => Exec['tmpkey'],
47
66
}
48
67
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
49
71
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']],
62
85
}
63
86
EOS
64
87
@@ -68,7 +91,7 @@ class { 'jira':
68
91
shell wget_cmd , acceptable_exit_codes : [ 0 , 8 ]
69
92
sleep SLEEP_SECONDS
70
93
shell wget_cmd , acceptable_exit_codes : [ 0 , 8 ]
71
- sleep SLEEP_SECONDS
94
+
72
95
apply_manifest ( pp , catch_changes : true )
73
96
end
74
97
@@ -85,10 +108,9 @@ class { 'jira':
85
108
it { is_expected . to be_running }
86
109
end
87
110
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' }
92
114
end
93
115
94
116
specify do
0 commit comments