Skip to content

Commit 6083dd4

Browse files
authored
Merge pull request #357 from traylenator/debian12
Support Debian 12
2 parents 5f64bc1 + f341931 commit 6083dd4

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ class { 'systemd':
351351
}
352352
```
353353

354-
when `manage_systemd` is true any required sub package, e.g. `systemd-resolved` on CentOS 9, will be installed. However configuration of
354+
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
355355
systemd-resolved will only occur on second puppet run after that installation.
356356

357357
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.

spec/acceptance/resolved_spec.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
require 'spec_helper_acceptance'
44

55
describe 'systemd with manage_resolved true' do
6+
has_package = (fact('os.family') == 'RedHat' && fact('os.release.major') != '8') || (fact('os.name') == 'Debian' && fact('os.release.major').to_i >= 12)
7+
68
context 'configure systemd resolved' do
79
it 'works idempotently with no errors' do
810
pp = <<-PUPPET
@@ -12,15 +14,17 @@
1214
}
1315
PUPPET
1416
apply_manifest(pp, catch_failures: true)
15-
# RedHat 7, 9 and newer installs package first run before fact $facts['internal_services'] is set
16-
apply_manifest(pp, catch_failures: true) if fact('os.release.major') != '8' && (fact('os.family') == 'RedHat')
17+
# RedHat 7, 9, Debian 12 and newer installs package first run before fact $facts['internal_services'] is set
18+
apply_manifest(pp, catch_failures: true) if has_package
1719
apply_manifest(pp, catch_changes: true)
1820
end
1921

2022
describe service('systemd-resolved') do
2123
it { is_expected.to be_running }
2224
it { is_expected.to be_enabled }
2325
end
26+
27+
it { expect(package('systemd-resolved')).to be_installed } if has_package
2428
end
2529

2630
context 'configure systemd stopped' do

spec/classes/init_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
end
4848

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

0 commit comments

Comments
 (0)