Skip to content

Commit

Permalink
Merge pull request #674 from bastelfreak/ubuntu2404
Browse files Browse the repository at this point in the history
Add Ubuntu 24.04 support
  • Loading branch information
bastelfreak authored Oct 29, 2024
2 parents 4dd1c0d + b8d0117 commit 67d9f5c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 36 deletions.
12 changes: 2 additions & 10 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"10",
"11",
"12"
]
Expand Down Expand Up @@ -74,7 +73,6 @@
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7",
"8",
"9"
]
Expand All @@ -93,13 +91,6 @@
"9"
]
},
{
"operatingsystem": "Scientific",
"operatingsystemrelease": [
"7",
"8"
]
},
{
"operatingsystem": "SLED",
"operatingsystemrelease": [
Expand All @@ -118,7 +109,8 @@
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"20.04",
"22.04"
"22.04",
"24.04"
]
},
{
Expand Down
37 changes: 11 additions & 26 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
require 'spec_helper'

describe 'consul' do
on_supported_os.each do |os, facts|
next unless facts[:kernel] == 'Linux'
on_supported_os.each do |os, os_facts|
next unless os_facts[:kernel] == 'Linux'

puts "on #{os}"
context "on #{os}" do
provider = case facts[:os]['family']
when 'Archlinux'
{ service_provider: 'systemd' }
when 'Debian'
{ service_provider: 'systemd' }
when 'RedHat'
{ service_provider: 'systemd' }
when 'windows'
{ service_provider: 'unmanaged' }
when 'FreeBSD'
{ service_provider: 'freebsd' }
else
{ service_provider: 'systemd' }
end
facts = facts.merge(provider)
let(:facts) do
facts
os_facts
end

it { is_expected.to compile.with_all_deps }
Expand Down Expand Up @@ -82,7 +67,7 @@
}
end

case facts[:os]['family']
case os_facts[:os]['family']
when 'Debian'
it { is_expected.not_to contain_apt__source('HashiCorp') }
when 'RedHat'
Expand All @@ -98,7 +83,7 @@
}
end

case facts[:os]['family']
case os_facts[:os]['family']
when 'Debian'
it { is_expected.not_to contain_apt__source('HashiCorp') }
when 'RedHat'
Expand All @@ -107,15 +92,15 @@
end

# hashicorp repo is not supported on Arch Linux/SLES
context 'When asked to manage the repo and to install as package', unless: %w[Archlinux SLES Suse].include?(facts[:os]['family']) do
context 'When asked to manage the repo and to install as package', unless: %w[Archlinux SLES Suse].include?(os_facts[:os]['family']) do
let(:params) do
{
install_method: 'package',
manage_repo: true
}
end

case facts[:os]['family']
case os_facts[:os]['family']
when 'Debian'
it { is_expected.to contain_apt__source('HashiCorp') }
when 'RedHat'
Expand Down Expand Up @@ -181,9 +166,9 @@

context 'When installing by archive via URL and current version is already installed' do
let(:facts) do
facts.merge({
consul_version: '1.16.3'
})
os_facts.merge({
consul_version: '1.16.3'
})
end

it { is_expected.to contain_archive('/opt/consul/archives/consul-1.16.3.zip').with(source: 'https://releases.hashicorp.com/consul/1.16.3/consul_1.16.3_linux_amd64.zip') }
Expand Down Expand Up @@ -606,7 +591,7 @@
it { is_expected.not_to contain_file('/etc/systemd/system/consul.service') }
end

case facts[:os]['family']
case os_facts[:os]['family']
when 'RedHat', 'Archlinux', 'Debian'
context 'On a modern OS' do
it { is_expected.to contain_class('consul').with_init_style('systemd') }
Expand Down

0 comments on commit 67d9f5c

Please sign in to comment.