|
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 |
| 8 | + # On Debian 11 and Ubuntu 20.04 and 22.04 the default is to install mariadb |
9 | 9 | # As the ubuntu 20.04 runner we use in github actions allready has mysql installed |
10 | 10 | # a apparmor error is triggerd when using mariadb in this test.. |
11 | 11 | # Forcing the use of mysql |
12 | | - if $facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['major'], '20.04') >= 0 { |
| 12 | + if ( $facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['major'], '20.04') >= 0 ) |
| 13 | + or ( $facts['os']['name'] == 'Debian' and versioncmp($facts['os']['release']['major'], '11') >= 0 ) { |
13 | 14 | $mysql_service_name = 'mysql' |
14 | 15 | $mysql_server_package = 'mysql-server' |
15 | 16 | $mysql_client_package = 'mysql-client' |
|
19 | 20 | $mysql_client_package = undef |
20 | 21 | } |
21 | 22 |
|
| 23 | + # Debian docker image doesn't include any repo with mysql |
| 24 | + if $facts['os']['name'] == 'Debian' { |
| 25 | + file { '/tmp/mysql-apt-config.deb': |
| 26 | + source => 'http://repo.mysql.com/mysql-apt-config.deb', |
| 27 | + } |
| 28 | + ~> exec { 'mysql apt repository': |
| 29 | + command => '/usr/bin/dpkg -i /tmp/mysql-apt-config.deb', |
| 30 | + refreshonly => true, |
| 31 | + } |
| 32 | + ~> exec { 'apt-update': |
| 33 | + command => '/usr/bin/apt-get update', |
| 34 | + refreshonly => true, |
| 35 | + } |
| 36 | + } |
| 37 | +
|
| 38 | + # The puppetlabs-mysql module does not manage the config file correctly on Debian |
| 39 | + # Fails idempotency test because the module manages the config file before installing |
| 40 | + # package mysql_server and package mysql_server overwrites this. |
| 41 | + if $facts['os']['name'] == 'Debian' { |
| 42 | + $manage_config_file = false |
| 43 | + } else { |
| 44 | + $manage_config_file = undef |
| 45 | + } |
| 46 | +
|
22 | 47 | class { 'mysql::server': |
23 | 48 | root_password => 'strongpassword', |
24 | 49 | package_name => $mysql_server_package, |
25 | 50 | service_name => $mysql_service_name, |
| 51 | + manage_config_file => $manage_config_file, |
26 | 52 | } |
27 | 53 | class { 'mysql::client': |
28 | 54 | package_name => $mysql_client_package, |
|
0 commit comments