Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Debian 12 #357

Merged
merged 2 commits into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ class { 'systemd':
}
```

when `manage_systemd` is true any required sub package, e.g. `systemd-resolved` on CentOS 9, will be installed. However configuration of
when `manage_systemd` is true any required sub package, e.g. `systemd-resolved` on CentOS 9 or Debian 12, will be installed. However configuration of
systemd-resolved will only occur on second puppet run after that installation.

This requires [puppetlabs-inifile](https://forge.puppet.com/puppetlabs/inifile), which is only a soft dependency in this module (you need to explicitly install it). Both parameters accept a string or an array.
Expand Down
8 changes: 6 additions & 2 deletions spec/acceptance/resolved_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
require 'spec_helper_acceptance'

describe 'systemd with manage_resolved true' do
has_package = (fact('os.family') == 'RedHat' && fact('os.release.major') != '8') || (fact('os.name') == 'Debian' && fact('os.release.major').to_i >= 12)

context 'configure systemd resolved' do
it 'works idempotently with no errors' do
pp = <<-PUPPET
Expand All @@ -12,15 +14,17 @@
}
PUPPET
apply_manifest(pp, catch_failures: true)
# RedHat 7, 9 and newer installs package first run before fact $facts['internal_services'] is set
apply_manifest(pp, catch_failures: true) if fact('os.release.major') != '8' && (fact('os.family') == 'RedHat')
# RedHat 7, 9, Debian 12 and newer installs package first run before fact $facts['internal_services'] is set
apply_manifest(pp, catch_failures: true) if has_package
apply_manifest(pp, catch_changes: true)
end

describe service('systemd-resolved') do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end

it { expect(package('systemd-resolved')).to be_installed } if has_package
end

context 'configure systemd stopped' do
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
end

case [facts[:os]['family'], facts[:os]['release']['major']]
when %w[RedHat 7], %w[RedHat 9]
when %w[RedHat 7], %w[RedHat 9], %w[Debian 12]
it { is_expected.to contain_package('systemd-resolved') }
else
it { is_expected.not_to contain_package('systemd-resolved') }
Expand Down