Skip to content

Commit 6d911fc

Browse files
traylenatorekohl
authored andcommitted
Support Debian 12
In particular with Debian 11->12 systemd-resolved is now a sub package that must be installed.
1 parent 5f64bc1 commit 6d911fc

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

README.md

+1-1
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

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@
1212
}
1313
PUPPET
1414
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')
15+
# RedHat 7, 9, Debian 12 and newer installs package first run before fact $facts['internal_services'] is set
16+
if (fact('os.release.major') != '8' && (fact('os.family') == 'RedHat')) ||
17+
((fact('os.name') == 'Debian' && fact('os.release.major').to_i >= 12))
18+
apply_manifest(pp, catch_failures: true)
19+
end
1720
apply_manifest(pp, catch_changes: true)
1821
end
1922

spec/classes/init_spec.rb

+1-1
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)