Skip to content

Commit f4f893f

Browse files
root-experth-haaks
authored andcommitted
Add Debian support
1 parent 8603b5a commit f4f893f

2 files changed

Lines changed: 34 additions & 2 deletions

File tree

metadata.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@
5959
"7"
6060
]
6161
},
62+
{
63+
"operatingsystem": "Debian",
64+
"operatingsystemrelease": [
65+
"11"
66+
]
67+
},
6268
{
6369
"operatingsystem": "Ubuntu",
6470
"operatingsystemrelease": [

spec/acceptance/mysql_spec.rb

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
describe '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
8+
# On Debian 11 and Ubuntu 20.04 and 22.04 the default is to install mariadb
99
# As the ubuntu 20.04 runner we use in github actions allready has mysql installed
1010
# a apparmor error is triggerd when using mariadb in this test..
1111
# 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 ) {
1314
$mysql_service_name = 'mysql'
1415
$mysql_server_package = 'mysql-server'
1516
$mysql_client_package = 'mysql-client'
@@ -19,10 +20,35 @@
1920
$mysql_client_package = undef
2021
}
2122
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+
2247
class { 'mysql::server':
2348
root_password => 'strongpassword',
2449
package_name => $mysql_server_package,
2550
service_name => $mysql_service_name,
51+
manage_config_file => $manage_config_file,
2652
}
2753
class { 'mysql::client':
2854
package_name => $mysql_client_package,

0 commit comments

Comments
 (0)