diff --git a/README.md b/README.md index a08c304a..d375e10e 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/data/Debian-12.yaml b/data/Debian-12.yaml new file mode 100644 index 00000000..ae774831 --- /dev/null +++ b/data/Debian-12.yaml @@ -0,0 +1,11 @@ +--- +systemd::accounting: + DefaultCPUAccounting: 'yes' + DefaultIOAccounting: 'yes' + DefaultIPAccounting: 'yes' + DefaultBlockIOAccounting: 'yes' + DefaultMemoryAccounting: 'yes' + DefaultTasksAccounting: 'yes' + +systemd::timesyncd_package: 'systemd-timesyncd' +systemd::resolved_package: 'systemd-resolved' diff --git a/metadata.json b/metadata.json index 4a78a8cb..5a773888 100644 --- a/metadata.json +++ b/metadata.json @@ -22,7 +22,8 @@ "operatingsystem": "Debian", "operatingsystemrelease": [ "10", - "11" + "11", + "12" ] }, { diff --git a/spec/acceptance/resolved_spec.rb b/spec/acceptance/resolved_spec.rb index 146b42b3..a786492f 100644 --- a/spec/acceptance/resolved_spec.rb +++ b/spec/acceptance/resolved_spec.rb @@ -12,8 +12,11 @@ } 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 + if (fact('os.release.major') != '8' && (fact('os.family') == 'RedHat')) || + ((fact('os.name') == 'Debian' && fact('os.release.major').to_i >= 12)) + apply_manifest(pp, catch_failures: true) + end apply_manifest(pp, catch_changes: true) end diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb index 75afea3f..ab2e9340 100644 --- a/spec/classes/init_spec.rb +++ b/spec/classes/init_spec.rb @@ -40,7 +40,7 @@ it { is_expected.not_to contain_file('/etc/systemd/network') } 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') }