Skip to content

Commit

Permalink
Add Debian support
Browse files Browse the repository at this point in the history
  • Loading branch information
root-expert authored and h-haaks committed Feb 19, 2024
1 parent 8603b5a commit e795312
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
6 changes: 6 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@
"7"
]
},
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"11"
]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
Expand Down
30 changes: 28 additions & 2 deletions spec/acceptance/mysql_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
describe 'jira mysql' do
it 'installs with defaults' do

Check failure on line 6 in spec/acceptance/mysql_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 8 - Debian 11

jira mysql installs with defaults Failure/Error: apply_manifest(pp, catch_failures: true) Beaker::Host::CommandFailure: Host 'debian11-64-puppet8.example.com' exited with 6 running: puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest_142606038.pp.C8jlay Last 10 lines of output were: Warning: /Stage[main]/Jira::Config/File[/opt/jira-home/dbconfig.xml]: Skipping because of failed dependencies Warning: /Stage[main]/Jira::Config/File[/opt/atlassian-jira/atlassian-jira-software-8.13.5-standalone/bin/check-java.sh]: Skipping because of failed dependencies Warning: /Stage[main]/Jira::Config/File[/opt/atlassian-jira/atlassian-jira-software-8.13.5-standalone/conf/server.xml]: Skipping because of failed dependencies Warning: /Stage[main]/Jira::Config/File[/opt/atlassian-jira/atlassian-jira-software-8.13.5-standalone/conf/context.xml]: Skipping because of failed dependencies Warning: /Stage[main]/Jira::Config/File[/opt/jira-home/jira-config.properties]: Skipping because of failed dependencies Warning: /Stage[main]/Jira::Service/Systemd::Unit_file[jira.service]/File[/etc/systemd/system/jira.service]: Skipping because of failed dependencies Warning: /Stage[main]/Jira::Service/Systemd::Unit_file[jira.service]/Systemd::Daemon_reload[jira.service]/Exec[systemd-jira.service-systemctl-daemon-reload]: Skipping because of failed dependencies Warning: /Stage[main]/Jira::Service/Service[jira]: Skipping because of failed dependencies Info: Stage[main]: Unscheduling all events on Stage[main] �[mNotice: Applied catalog in 9.45 seconds

Check failure on line 6 in spec/acceptance/mysql_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / Puppet 7 - Debian 11

jira mysql installs with defaults Failure/Error: apply_manifest(pp, catch_failures: true) Beaker::Host::CommandFailure: Host 'debian11-64-puppet7.example.com' exited with 6 running: puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest_145858692.pp.nmNvCZ Last 10 lines of output were: Warning: /Stage[main]/Jira::Config/File[/opt/jira-home/dbconfig.xml]: Skipping because of failed dependencies Warning: /Stage[main]/Jira::Config/File[/opt/atlassian-jira/atlassian-jira-software-8.13.5-standalone/bin/check-java.sh]: Skipping because of failed dependencies Warning: /Stage[main]/Jira::Config/File[/opt/atlassian-jira/atlassian-jira-software-8.13.5-standalone/conf/server.xml]: Skipping because of failed dependencies Warning: /Stage[main]/Jira::Config/File[/opt/atlassian-jira/atlassian-jira-software-8.13.5-standalone/conf/context.xml]: Skipping because of failed dependencies Warning: /Stage[main]/Jira::Config/File[/opt/jira-home/jira-config.properties]: Skipping because of failed dependencies Warning: /Stage[main]/Jira::Service/Systemd::Unit_file[jira.service]/File[/etc/systemd/system/jira.service]: Skipping because of failed dependencies Warning: /Stage[main]/Jira::Service/Systemd::Unit_file[jira.service]/Systemd::Daemon_reload[jira.service]/Exec[systemd-jira.service-systemctl-daemon-reload]: Skipping because of failed dependencies Warning: /Stage[main]/Jira::Service/Service[jira]: Skipping because of failed dependencies Info: Stage[main]: Unscheduling all events on Stage[main] �[mNotice: Applied catalog in 9.73 seconds
pp = <<-EOS
# On ubuntu 20.04 and 22.04 the default is to install mariadb
# On Debian 11 and Ubuntu 20.04 and 22.04 the default is to install mariadb
# As the ubuntu 20.04 runner we use in github actions allready has mysql installed
# a apparmor error is triggerd when using mariadb in this test..
# Forcing the use of mysql
if $facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['major'], '20.04') >= 0 {
if ( $facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['major'], '20.04') >= 0 )
or ( $facts['os']['name'] == 'Debian' and versioncmp($facts['os']['release']['major'], '11') >= 0 ) {
$mysql_service_name = 'mysql'
$mysql_server_package = 'mysql-server'
$mysql_client_package = 'mysql-client'
Expand All @@ -19,10 +20,35 @@
$mysql_client_package = undef
}
# Debian docker image doesn't include any repo with mysql
if $facts['os']['name'] == 'Debian' {
file { '/tmp/mysql-apt-config.deb':
source => 'http://repo.mysql.com/mysql-apt-config.deb',
}
~> exec { 'mysql apt repository':
command => '/usr/bin/dpkg -i /tmp/mysql-apt-config.deb',
refreshonly => true,
}
~> exec { 'apt-update':
command => '/usr/bin/apt-get update',
refreshonly => true,
}
}
# The puppetlabs-mysql module does not manage the config file correctly on Debian
# Fails idempotency test because the module manages the config file before installing
# package mysql_server and package mysql_server overwrites this.
if $facts['os']['name'] == 'Debian' {
$manage_config_file = false
} else {
$manage_config_file = undef
}
class { 'mysql::server':
root_password => 'strongpassword',
package_name => $mysql_server_package,
service_name => $mysql_service_name,
manage_config_file => $manage_config_file,
}
class { 'mysql::client':
package_name => $mysql_client_package,
Expand Down

0 comments on commit e795312

Please sign in to comment.