Showing with 86 additions and 6 deletions.
  1. +17 −1 CHANGELOG.md
  2. +20 −0 REFERENCE.md
  3. +9 −0 manifests/manage_dropin.pp
  4. +1 −0 manifests/manage_unit.pp
  5. +2 −5 metadata.json
  6. +30 −0 spec/type_aliases/systemd_unit_service_spec.rb
  7. +7 −0 types/unit/service.pp
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ 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.

## [v5.2.0](https://github.com/voxpupuli/puppet-systemd/tree/v5.2.0) (2023-07-13)

[Full Changelog](https://github.com/voxpupuli/puppet-systemd/compare/v5.1.0...v5.2.0)

**Implemented enhancements:**

- Missing WorkingDirectory parameter on Systemd::Unit::Service [\#320](https://github.com/voxpupuli/puppet-systemd/issues/320)
- Nice, IOSchedulingPriority and IOSchedulingClass [\#363](https://github.com/voxpupuli/puppet-systemd/pull/363) ([traylenator](https://github.com/traylenator))
- allow to set StandardInput on service unit [\#362](https://github.com/voxpupuli/puppet-systemd/pull/362) ([oOHenry](https://github.com/oOHenry))
- Allow SupplementaryGroups and DynamicUser [\#358](https://github.com/voxpupuli/puppet-systemd/pull/358) ([traylenator](https://github.com/traylenator))
- Allow LogLevelMax to be set in \[Service\] [\#356](https://github.com/voxpupuli/puppet-systemd/pull/356) ([traylenator](https://github.com/traylenator))

**Fixed bugs:**

- Correct syntax in manage\_unit socket example [\#354](https://github.com/voxpupuli/puppet-systemd/pull/354) ([ekohl](https://github.com/ekohl))

## [v5.1.0](https://github.com/voxpupuli/puppet-systemd/tree/v5.1.0) (2023-06-15)

[Full Changelog](https://github.com/voxpupuli/puppet-systemd/compare/v5.0.0...v5.1.0)
Expand All @@ -13,7 +29,7 @@ These should not affect the functionality of the module.
- Support StandardOutput, StandardError and RequiresMountsFor. [\#353](https://github.com/voxpupuli/puppet-systemd/pull/353) ([traylenator](https://github.com/traylenator))
- Allow WorkingDirectory to be specified in \[Service\] [\#352](https://github.com/voxpupuli/puppet-systemd/pull/352) ([traylenator](https://github.com/traylenator))
- Socket support for manage unit and dropin [\#350](https://github.com/voxpupuli/puppet-systemd/pull/350) ([traylenator](https://github.com/traylenator))
- Relax stdlib dependency version requirements [\#349](https://github.com/voxpupuli/puppet-systemd/pull/349) ([smortex](https://github.com/smortex))
- Allow puppetlabs-stdlib 9.x [\#349](https://github.com/voxpupuli/puppet-systemd/pull/349) ([smortex](https://github.com/smortex))
- No insistence on unit\_entry ever or service\_entry with absent manage\_unit [\#345](https://github.com/voxpupuli/puppet-systemd/pull/345) ([traylenator](https://github.com/traylenator))
- Add comment in manage\_unit deployed files [\#333](https://github.com/voxpupuli/puppet-systemd/pull/333) ([traylenator](https://github.com/traylenator))

Expand Down
20 changes: 20 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,18 @@ systemd::manage_dropin { 'corelimit.conf':
}
```

##### make a noisy unit less noisy

```puppet
systemd::manage_dropin { 'maxloglevel.conf':
ensure => present,
unit => 'chatty.service',
service_entry => {
'LogLevelMax' => 'warning',
}
}
```

#### Parameters

The following parameters are available in the `systemd::manage_dropin` defined type:
Expand Down Expand Up @@ -1019,6 +1031,7 @@ systemd::manage_unit {'arcd.socket':
'ListenStream' => 4241,
'Accept' => true,
'BindIPv6Only' => 'both',
},
install_entry => {
'WantedBy' => 'sockets.target',
}
Expand Down Expand Up @@ -2316,6 +2329,8 @@ Struct[{
Optional['AmbientCapabilities'] => Variant[Pattern[/^CAP_[A-Z_]+$/],Array[Pattern[/^CAP_[A-Z_]+$/],1]],
Optional['User'] => String[1],
Optional['Group'] => String[1],
Optional['DynamicUser'] => Boolean,
Optional['SupplementaryGroups'] => Variant[String[0],Array[String[0],1]],
Optional['WorkingDirectory'] => String[0],
Optional['Type'] => Enum['simple', 'exec', 'forking', 'oneshot', 'dbus', 'notify', 'idle'],
Optional['ExitType'] => Enum['main', 'cgroup'],
Expand All @@ -2332,7 +2347,11 @@ Struct[{
Optional['ExecStopPost'] => Variant[Systemd::Unit::Service::Exec,Array[Systemd::Unit::Service::Exec,1]],
Optional['KillSignal'] => Pattern[/^SIG[A-Z]+$/],
Optional['KillMode'] => Enum['control-group', 'mixed', 'process', 'none'],
Optional['Nice'] => Variant[String[0,0],Integer[-20,19]],
Optional['IOSchedulingClass'] => Enum['','realtime','best-effort','idle'],
Optional['IOSchedulingPriority'] => Variant[String[0,0],Integer[0,7]],
Optional['SyslogIdentifier'] => String,
Optional['LogLevelMax'] => Enum['emerg','alert','crit','err','warning','notice','info','debug'],
Optional['LimitCORE'] => Pattern['^(infinity|((\d+(K|M|G|T|P|E)?(:\d+(K|M|G|T|P|E)?)?)))$'],
Optional['RestartSec'] => String,
Optional['TimeoutStartSec'] => String,
Expand Down Expand Up @@ -2361,6 +2380,7 @@ Struct[{
],
Optional['StandardOutput'] => Variant[Enum['inherit','null','tty','journal','kmsg','journal+console','kmsg+console','socket'],Pattern[/\A(file:|append:|truncate:).+$\z/]],
Optional['StandardError'] => Variant[Enum['inherit','null','tty','journal','kmsg','journal+console','kmsg+console','socket'],Pattern[/\A(file:|append:|truncate:).+$\z/]],
Optional['StandardInput'] => Variant[Enum['null','tty','tty-force','tty-fail','data','socket'], Pattern[/\A(file:|fd:).+$\z/]],
}]
```

Expand Down
9 changes: 9 additions & 0 deletions manifests/manage_dropin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@
# },
# }
#
# @example make a noisy unit less noisy
# systemd::manage_dropin { 'maxloglevel.conf':
# ensure => present,
# unit => 'chatty.service',
# service_entry => {
# 'LogLevelMax' => 'warning',
# }
# }
#
# @param unit The unit to create a dropfile for
# @param filename The target unit file to create. The filename of the drop in. The full path is determined using the path, unit and this filename.
# @param ensure The state of this dropin file
Expand Down
1 change: 1 addition & 0 deletions manifests/manage_unit.pp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
# 'ListenStream' => 4241,
# 'Accept' => true,
# 'BindIPv6Only' => 'both',
# },
# install_entry => {
# 'WantedBy' => 'sockets.target',
# }
Expand Down
7 changes: 2 additions & 5 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppet-systemd",
"version": "5.1.0",
"version": "5.2.0",
"author": "Vox Pupuli",
"summary": "Puppet Systemd module",
"license": "Apache-2.0",
Expand Down Expand Up @@ -102,8 +102,5 @@
"name": "puppet",
"version_requirement": ">= 7.0.0 < 8.0.0"
}
],
"pdk-version": "1.18.0",
"template-url": "pdk-default#1.18.0",
"template-ref": "tags/1.18.0-0-g095317c"
]
}
30 changes: 30 additions & 0 deletions spec/type_aliases/systemd_unit_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,38 @@
it { is_expected.to allow_value({ 'StandardOutput' => 'null' }) }
it { is_expected.to allow_value({ 'StandardError' => 'null' }) }

it { is_expected.to allow_value({ 'StandardInput' => 'socket' }) }
it { is_expected.to allow_value({ 'StandardInput' => 'file:/tmp/inputfile' }) }
it { is_expected.not_to allow_value({ 'StandardInput' => '/tmp/inputfile' }) }

it { is_expected.to allow_value({ 'DynamicUser' => false }) }
it { is_expected.to allow_value({ 'DynamicUser' => true }) }
it { is_expected.not_to allow_value({ 'DynamicUser' => 'maybe' }) }

it { is_expected.to allow_value({ 'SupplementaryGroups' => 'one' }) }
it { is_expected.to allow_value({ 'SupplementaryGroups' => %w[one two] }) }
it { is_expected.to allow_value({ 'SupplementaryGroups' => '' }) }
it { is_expected.to allow_value({ 'SupplementaryGroups' => [''] }) }
it { is_expected.to allow_value({ 'SupplementaryGroups' => ['', 'reset'] }) }
it { is_expected.not_to allow_value({ 'SupplementaryGroups' => [] }) }

it { is_expected.to allow_value({ 'WorkingDirectory' => '/var/lib/here' }) }
it { is_expected.to allow_value({ 'WorkingDirectory' => '-/var/lib/here' }) }
it { is_expected.to allow_value({ 'WorkingDirectory' => '~' }) }
it { is_expected.to allow_value({ 'WorkingDirectory' => '' }) }

it { is_expected.to allow_value({ 'LogLevelMax' => 'alert' }) }
it { is_expected.not_to allow_value({ 'LogLevelMax' => 'top' }) }

it { is_expected.to allow_value({ 'Nice' => -20 }) }
it { is_expected.to allow_value({ 'Nice' => 19 }) }
it { is_expected.not_to allow_value({ 'Nice' => '0' }) }

it { is_expected.to allow_value({ 'IOSchedulingClass' => 'best-effort' }) }
it { is_expected.to allow_value({ 'IOSchedulingClass' => '' }) }
it { is_expected.not_to allow_value({ 'IOSchedulingClass' => 'random' }) }

it { is_expected.to allow_value({ 'IOSchedulingPriority' => 7 }) }
it { is_expected.to allow_value({ 'IOSchedulingPriority' => '' }) }
it { is_expected.not_to allow_value({ 'IOSchedulingPriority' => '0' }) }
end
7 changes: 7 additions & 0 deletions types/unit/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
Optional['AmbientCapabilities'] => Variant[Pattern[/^CAP_[A-Z_]+$/],Array[Pattern[/^CAP_[A-Z_]+$/],1]],
Optional['User'] => String[1],
Optional['Group'] => String[1],
Optional['DynamicUser'] => Boolean,
Optional['SupplementaryGroups'] => Variant[String[0],Array[String[0],1]],
Optional['WorkingDirectory'] => String[0],
Optional['Type'] => Enum['simple', 'exec', 'forking', 'oneshot', 'dbus', 'notify', 'idle'],
Optional['ExitType'] => Enum['main', 'cgroup'],
Expand All @@ -23,7 +25,11 @@
Optional['ExecStopPost'] => Variant[Systemd::Unit::Service::Exec,Array[Systemd::Unit::Service::Exec,1]],
Optional['KillSignal'] => Pattern[/^SIG[A-Z]+$/],
Optional['KillMode'] => Enum['control-group', 'mixed', 'process', 'none'],
Optional['Nice'] => Variant[String[0,0],Integer[-20,19]],
Optional['IOSchedulingClass'] => Enum['','realtime','best-effort','idle'],
Optional['IOSchedulingPriority'] => Variant[String[0,0],Integer[0,7]],
Optional['SyslogIdentifier'] => String,
Optional['LogLevelMax'] => Enum['emerg','alert','crit','err','warning','notice','info','debug'],
Optional['LimitCORE'] => Pattern['^(infinity|((\d+(K|M|G|T|P|E)?(:\d+(K|M|G|T|P|E)?)?)))$'],
Optional['RestartSec'] => String,
Optional['TimeoutStartSec'] => String,
Expand Down Expand Up @@ -52,5 +58,6 @@
],
Optional['StandardOutput'] => Variant[Enum['inherit','null','tty','journal','kmsg','journal+console','kmsg+console','socket'],Pattern[/\A(file:|append:|truncate:).+$\z/]],
Optional['StandardError'] => Variant[Enum['inherit','null','tty','journal','kmsg','journal+console','kmsg+console','socket'],Pattern[/\A(file:|append:|truncate:).+$\z/]],
Optional['StandardInput'] => Variant[Enum['null','tty','tty-force','tty-fail','data','socket'], Pattern[/\A(file:|fd:).+$\z/]],
}
]