Showing with 59 additions and 4 deletions.
  1. +4 −0 .github/workflows/ci.yml
  2. +18 −0 CHANGELOG.md
  3. +1 −1 README.md
  4. +2 −0 REFERENCE.md
  5. +1 −1 manifests/init.pp
  6. +2 −1 manifests/unit_file.pp
  7. +1 −1 metadata.json
  8. +21 −0 spec/defines/timer_spec.rb
  9. +9 −0 spec/defines/unit_file_spec.rb
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ name: CI

on: pull_request

concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true

jobs:
setup_matrix:
name: 'Setup Test Matrix'
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file.
Each new release typically also includes the latest modulesync defaults.
These should not affect the functionality of the module.

## [v3.5.1](https://github.com/voxpupuli/puppet-systemd/tree/v3.5.1) (2021-10-20)

[Full Changelog](https://github.com/voxpupuli/puppet-systemd/compare/v3.5.0...v3.5.1)

**Fixed bugs:**

- Declare a default for $accounting [\#229](https://github.com/voxpupuli/puppet-systemd/pull/229) ([ekohl](https://github.com/ekohl))
- Do a daemon reload for static units [\#199](https://github.com/voxpupuli/puppet-systemd/pull/199) ([simondeziel](https://github.com/simondeziel))

**Closed issues:**

- provide sensible default for systemd::accounting [\#231](https://github.com/voxpupuli/puppet-systemd/issues/231)
- daemon reload problem with 3.0.0 [\#190](https://github.com/voxpupuli/puppet-systemd/issues/190)

**Merged pull requests:**

- Correct use\_stub\_resolver example in README [\#230](https://github.com/voxpupuli/puppet-systemd/pull/230) ([traylenator](https://github.com/traylenator))

## [v3.5.0](https://github.com/voxpupuli/puppet-systemd/tree/v3.5.0) (2021-09-13)

[Full Changelog](https://github.com/voxpupuli/puppet-systemd/compare/v3.4.0...v3.5.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ $manage_networkd is required if you want to reload it for new
`systemd::network` resources. Setting $manage_resolved will also manage your
`/etc/resolv.conf`.

When configuring `systemd::resolved` you could set `dns_stub_resolver` to false (default) to use a *standard* `/etc/resolved.conf`, or you could set it to `true` to use the local resolver provided by `systemd-resolved`.
When configuring `systemd::resolved` you could set `use_stub_resolver` to false (default) to use a *standard* `/etc/resolved.conf`, or you could set it to `true` to use the local resolver provided by `systemd-resolved`.

Systemd has introduced `DNS Over TLS` in the release 239. Currently three states are supported `yes` (since systemd 243), `opportunistic` (true) and `no` (false, default). When enabled with `yes` or `opportunistic` `systemd-resolved` will start a TCP-session to a DNS server with `DNS Over TLS` support. When enabled with `yes` (strict mode), queries will fail if the configured DNS servers do not support `DNS Over TLS`. Note that there will be no host checking for `DNS Over TLS` due to missing implementation in `systemd-resolved`.

Expand Down
2 changes: 2 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,8 @@ Data type: `Hash[String,String]`

Hash of the different accounting options. This highly depends on the used systemd version. The module provides sane defaults per operating system using Hiera.

Default value: `{}`

##### <a name="purge_dropin_dirs"></a>`purge_dropin_dirs`

Data type: `Boolean`
Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
# When enabled, unused directories for dropin files will be purged
#
class systemd (
Hash[String,String] $accounting,
Hash[String,String] $accounting = {},
Hash[String[1],Hash[String[1], Any]] $service_limits = {},
Hash[String[1],Hash[String[1], Any]] $networks = {},
Hash[String[1],Hash[String[1], Any]] $timers = {},
Expand Down
3 changes: 2 additions & 1 deletion manifests/unit_file.pp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@
} else {
File["${path}/${name}"] ~> Service[$name]
}
} elsif $ensure == 'absent' {
} else {
# Work around https://tickets.puppetlabs.com/browse/PUP-9473
# and react to changes on static unit files (ie: .service triggered by .timer)
exec { "${name}-systemctl-daemon-reload":
command => 'systemctl daemon-reload',
refreshonly => true,
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppet-systemd",
"version": "3.5.0",
"version": "3.5.1",
"author": "Vox Pupuli",
"summary": "Puppet Systemd module",
"license": "Apache-2.0",
Expand Down
21 changes: 21 additions & 0 deletions spec/defines/timer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,27 @@
it { is_expected.to contain_systemd__unit_file('gamma.service').with_content("[Service]\nExecStart=/bin/touch /tmp/foobar") }
end

context 'with timer activated service' do
let(:params) do
{
active: true,
enable: true,
timer_content: "[Timer]\nOnCalendar=hourly",
service_content: "[Service]\nExecStart=/bin/echo timer-fired",
}
end

it { is_expected.to contain_systemd__unit_file('foobar.timer').with_content("[Timer]\nOnCalendar=hourly") }
it { is_expected.to contain_systemd__unit_file('foobar.service').with_content("[Service]\nExecStart=/bin/echo timer-fired") }

it {
is_expected.to create_exec('foobar.service-systemctl-daemon-reload').with(
command: 'systemctl daemon-reload',
refreshonly: true
)
}
end

context 'with a bad timer name' do
let(:title) { 'foobar' }

Expand Down
9 changes: 9 additions & 0 deletions spec/defines/unit_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@
end
end
end

context 'when using default values for enable and active' do
it {
is_expected.to create_exec("#{title}-systemctl-daemon-reload").with(
command: 'systemctl daemon-reload',
refreshonly: true
)
}
end
end
end
end
Expand Down