Showing with 120 additions and 13 deletions.
  1. +13 −0 CHANGELOG.md
  2. +1 −1 README.md
  3. +21 −2 REFERENCE.md
  4. +1 −1 metadata.json
  5. +3 −2 spec/type_aliases/systemd_coredumpsettings_spec.rb
  6. +60 −5 spec/type_aliases/systemd_unit_unit_spec.rb
  7. +1 −1 types/coredumpsettings.pp
  8. +20 −1 types/unit/unit.pp
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ 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.

## [v6.3.0](https://github.com/voxpupuli/puppet-systemd/tree/v6.3.0) (2023-12-06)

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

**Implemented enhancements:**

- Add some missing `Unit` options [\#396](https://github.com/voxpupuli/puppet-systemd/pull/396) ([gcoxmoz](https://github.com/gcoxmoz))

**Fixed bugs:**

- Invalid option `MaxFree` in `cordedump.conf` [\#398](https://github.com/voxpupuli/puppet-systemd/issues/398)
- Correct coredump parameter from `MaxFree` to `KeepFree` [\#399](https://github.com/voxpupuli/puppet-systemd/pull/399) ([traylenator](https://github.com/traylenator))

## [v6.2.0](https://github.com/voxpupuli/puppet-systemd/tree/v6.2.0) (2023-11-21)

[Full Changelog](https://github.com/voxpupuli/puppet-systemd/compare/v6.1.0...v6.2.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ class{'systemd':
'ExternalSizeMax' => '10G',
'JournalSizeMax' => '20T',
'MaxUse' => '1E',
"MaxFree' => '1P',
'KeepFree' => '1P',
}
}
```
Expand Down
23 changes: 21 additions & 2 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2095,7 +2095,7 @@ Struct[{
Optional['ExternalSizeMax'] => Pattern[/^[0-9]+(K|M|G|T|P|E)?$/],
Optional['JournalSizeMax'] => Pattern[/^[0-9]+(K|M|G|T|P|E)?$/],
Optional['MaxUse'] => Pattern[/^[0-9]+(K|M|G|T|P|E)?$/],
Optional['MaxFree'] => Pattern[/^[0-9]+(K|M|G|T|P|E)?$/],
Optional['KeepFree'] => Pattern[/^[0-9]+(K|M|G|T|P|E)?$/],
}]
```

Expand Down Expand Up @@ -2599,18 +2599,37 @@ Alias of
Struct[{
Optional['Description'] => Variant[String,Array[String,1]],
Optional['Documentation'] => Variant[String,Array[String,1]],
Optional['DefaultDependencies'] => Boolean,
Optional['Wants'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['Requires'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['Requisite'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['BindsTo'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['PartOf'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['Upholds'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['Conflicts'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['Before'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['After'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['OnFailure'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['OnSuccess'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['PropagatesReloadTo'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['ReloadPropagatedFrom'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['PropagatesStopTo'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['StopPropagatedFrom'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['JoinsNamespaceOf'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['RequiresMountsFor'] => Variant[Enum[''],Stdlib::Unixpath,Array[Variant[Enum[''],Stdlib::Unixpath],1]],
Optional['OnSuccessJobMode'] => Enum['fail', 'replace', 'replace-irreversibly', 'isolate', 'flush', 'ignore-dependencies', 'ignore-requirements'],
Optional['OnFailureJobMode'] => Enum['fail', 'replace', 'replace-irreversibly', 'isolate', 'flush', 'ignore-dependencies', 'ignore-requirements'],
Optional['IgnoreOnIsolate'] => Boolean,
Optional['StopWhenUnneeded'] => Boolean,
Optional['RefuseManualStart'] => Boolean,
Optional['RefuseManualStop'] => Boolean,
Optional['AllowIsolate'] => Boolean,
Optional['DefaultDependencies'] => Boolean,
Optional['SurviveFinalKillSignal'] => Boolean,
Optional['CollectMode'] => Enum['inactive', 'inactive-or-failed'],
Optional['FailureAction'] => Enum['none', 'reboot', 'reboot-force', 'reboot-immediate', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'exit', 'exit-force', 'soft-reboot', 'soft-reboot-force', 'kexec', 'kexec-force', 'halt', 'halt-force', 'halt-immediate'],
Optional['SuccessAction'] => Enum['none', 'reboot', 'reboot-force', 'reboot-immediate', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'exit', 'exit-force', 'soft-reboot', 'soft-reboot-force', 'kexec', 'kexec-force', 'halt', 'halt-force', 'halt-immediate'],
Optional['FailureActionExitStatus'] => Variant[Enum[''],Integer[0, 255]],
Optional['SuccessActionExitStatus'] => Variant[Enum[''],Integer[0, 255]],
# Conditions and Asserts
Optional['ConditionPathExists'] => Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/],Array[Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/]],1]],
Optional['ConditionPathIsDirectory'] => Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/],Array[Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/]],1]],
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": "6.2.0",
"version": "6.3.0",
"author": "Vox Pupuli",
"summary": "Puppet Systemd module",
"license": "Apache-2.0",
Expand Down
5 changes: 3 additions & 2 deletions spec/type_aliases/systemd_coredumpsettings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
'ExternalSizeMax' => '456G',
'JournalSizeMax' => '45T',
'MaxUse' => '1P',
'MaxFree' => '1E',
'KeepFree' => '1E',
}
)
}
Expand All @@ -28,7 +28,7 @@
'ExternalSizeMax' => '456',
'JournalSizeMax' => '45',
'MaxUse' => '1',
'MaxFree' => '5',
'KeepFree' => '5',
}
)
}
Expand All @@ -37,6 +37,7 @@
it { is_expected.not_to allow_value({ 'Compress' => 'maybe' }) }
it { is_expected.not_to allow_value({ 'MaxUse' => '-10' }) }
it { is_expected.not_to allow_value({ 'MaxFee' => '10Gig' }) }
it { is_expected.not_to allow_value({ 'MaxFree' => '10' }) }
it { is_expected.not_to allow_value({ 'ProcessSizeMax' => '20g' }) }
it { is_expected.not_to allow_value({ 'JournalSizeMax' => '20Z' }) }
end
65 changes: 60 additions & 5 deletions spec/type_aliases/systemd_unit_unit_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
it { is_expected.to allow_value({ 'Documentation' => %w[my special] }) }
it { is_expected.to allow_value({ 'Documentation' => ['', 'special'] }) }

%w[Wants Requires Requisite Wants PartOf Upholds Conflicts Before After OnFailure OnSuccess].each do |depend|
%w[Wants Requires Requisite BindsTo Wants PartOf Upholds Conflicts Before After OnFailure OnSuccess PropagatesReloadTo ReloadPropagatedFrom PropagatesStopTo StopPropagatedFrom JoinsNamespaceOf].each do |depend|
context "with a key of #{depend} can have values of units" do
it { is_expected.to allow_value({ depend.to_s => 'foobar.service' }) }
it { is_expected.to allow_value({ depend.to_s => ['foobar.service'] }) }
Expand All @@ -26,6 +26,58 @@
end
end

# JobModes
%w[OnSuccessJobMode OnFailureJobMode].each do |assert|
context "with a key of #{assert} can have appropriate values" do
it { is_expected.to allow_value({ assert.to_s => 'fail' }) }
it { is_expected.to allow_value({ assert.to_s => 'replace' }) }
it { is_expected.to allow_value({ assert.to_s => 'replace-irreversibly' }) }
it { is_expected.to allow_value({ assert.to_s => 'isolate' }) }
it { is_expected.to allow_value({ assert.to_s => 'flush' }) }
it { is_expected.to allow_value({ assert.to_s => 'ignore-dependencies' }) }
it { is_expected.to allow_value({ assert.to_s => 'ignore-requirements' }) }
it { is_expected.not_to allow_value({ assert.to_s => '' }) }
it { is_expected.not_to allow_value({ assert.to_s => 'some-other-mode' }) }
end
end

# Actions
%w[FailureAction SuccessAction].each do |assert|
context "with a key of #{assert} can have appropriate values" do
it { is_expected.to allow_value({ assert.to_s => 'none' }) }
it { is_expected.to allow_value({ assert.to_s => 'reboot' }) }
it { is_expected.to allow_value({ assert.to_s => 'reboot-force' }) }
it { is_expected.to allow_value({ assert.to_s => 'reboot-immediate' }) }
it { is_expected.to allow_value({ assert.to_s => 'poweroff' }) }
it { is_expected.to allow_value({ assert.to_s => 'poweroff-force' }) }
it { is_expected.to allow_value({ assert.to_s => 'poweroff-immediate' }) }
it { is_expected.to allow_value({ assert.to_s => 'exit' }) }
it { is_expected.to allow_value({ assert.to_s => 'exit-force' }) }
it { is_expected.to allow_value({ assert.to_s => 'soft-reboot' }) }
it { is_expected.to allow_value({ assert.to_s => 'soft-reboot-force' }) }
it { is_expected.to allow_value({ assert.to_s => 'kexec' }) }
it { is_expected.to allow_value({ assert.to_s => 'kexec-force' }) }
it { is_expected.to allow_value({ assert.to_s => 'halt' }) }
it { is_expected.to allow_value({ assert.to_s => 'halt-force' }) }
it { is_expected.to allow_value({ assert.to_s => 'halt-immediate' }) }
it { is_expected.not_to allow_value({ assert.to_s => '' }) }
it { is_expected.not_to allow_value({ assert.to_s => 'another-action' }) }
end
end

# ExitStatus
%w[FailureActionExitStatus SuccessActionExitStatus].each do |assert|
context "with a key of #{assert} can have appropriate values" do
it { is_expected.to allow_value({ assert.to_s => '' }) }
it { is_expected.to allow_value({ assert.to_s => 0 }) }
it { is_expected.to allow_value({ assert.to_s => 128 }) }
it { is_expected.to allow_value({ assert.to_s => 255 }) }
it { is_expected.not_to allow_value({ assert.to_s => -1 }) }
it { is_expected.not_to allow_value({ assert.to_s => 256 }) }
it { is_expected.not_to allow_value({ assert.to_s => '1' }) }
end
end

%w[ConditionPathExists ConditionPathIsDirectory AssertPathExists AssertPathIsDirectory].each do |assert|
context "with a key of #{assert} can have files or negated files" do
it { is_expected.to allow_value({ assert.to_s => '/my/existing/file' }) }
Expand All @@ -36,15 +88,14 @@
end

# Booleans
%w[DefaultDependencies].each do |assert|
%w[DefaultDependencies IgnoreOnIsolate StopWhenUnneeded RefuseManualStart RefuseManualStop AllowIsolate SurviveFinalKillSignal].each do |assert|
context "with a key of #{assert} can have values set to true" do
it { is_expected.to allow_value(assert.to_s => true) }
it { is_expected.to allow_value({ assert.to_s => true }) }
it { is_expected.to allow_value({ assert.to_s => false }) }
it { is_expected.not_to allow_value({ assert.to_s => 'yes' }) }
end
end

it { is_expected.not_to allow_value({ 'DefaultDependencies' => 'yes' }) }

it { is_expected.not_to allow_value({ 'Description' => 10 }) }
it { is_expected.not_to allow_value({ 'Wants' => '/unitwith.service' }) }

Expand All @@ -53,6 +104,10 @@
it { is_expected.not_to allow_value({ 'ConditionPathExists' => 'not/an/absolute/path' }) }
it { is_expected.not_to allow_value({ 'ConditionPathExists' => ['not/an/absolute/path'] }) }

it { is_expected.to allow_value({ 'CollectMode' => 'inactive' }) }
it { is_expected.to allow_value({ 'CollectMode' => 'inactive-or-failed' }) }
it { is_expected.not_to allow_value({ 'CollectMode' => 'active' }) }

it { is_expected.to allow_value({ 'RequiresMountsFor' => '/an/absolute/path' }) }
it { is_expected.to allow_value({ 'RequiresMountsFor' => '' }) }
it { is_expected.to allow_value({ 'RequiresMountsFor' => ['', '/an/absolute/path'] }) }
Expand Down
2 changes: 1 addition & 1 deletion types/coredumpsettings.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
Optional['ExternalSizeMax'] => Pattern[/^[0-9]+(K|M|G|T|P|E)?$/],
Optional['JournalSizeMax'] => Pattern[/^[0-9]+(K|M|G|T|P|E)?$/],
Optional['MaxUse'] => Pattern[/^[0-9]+(K|M|G|T|P|E)?$/],
Optional['MaxFree'] => Pattern[/^[0-9]+(K|M|G|T|P|E)?$/],
Optional['KeepFree'] => Pattern[/^[0-9]+(K|M|G|T|P|E)?$/],
}
]
21 changes: 20 additions & 1 deletion types/unit/unit.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,37 @@
{
Optional['Description'] => Variant[String,Array[String,1]],
Optional['Documentation'] => Variant[String,Array[String,1]],
Optional['DefaultDependencies'] => Boolean,
Optional['Wants'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['Requires'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['Requisite'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['BindsTo'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['PartOf'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['Upholds'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['Conflicts'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['Before'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['After'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['OnFailure'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['OnSuccess'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['PropagatesReloadTo'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['ReloadPropagatedFrom'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['PropagatesStopTo'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['StopPropagatedFrom'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['JoinsNamespaceOf'] => Variant[Enum[''],Systemd::Unit,Array[Variant[Enum[''],Systemd::Unit],1]],
Optional['RequiresMountsFor'] => Variant[Enum[''],Stdlib::Unixpath,Array[Variant[Enum[''],Stdlib::Unixpath],1]],
Optional['OnSuccessJobMode'] => Enum['fail', 'replace', 'replace-irreversibly', 'isolate', 'flush', 'ignore-dependencies', 'ignore-requirements'],
Optional['OnFailureJobMode'] => Enum['fail', 'replace', 'replace-irreversibly', 'isolate', 'flush', 'ignore-dependencies', 'ignore-requirements'],
Optional['IgnoreOnIsolate'] => Boolean,
Optional['StopWhenUnneeded'] => Boolean,
Optional['RefuseManualStart'] => Boolean,
Optional['RefuseManualStop'] => Boolean,
Optional['AllowIsolate'] => Boolean,
Optional['DefaultDependencies'] => Boolean,
Optional['SurviveFinalKillSignal'] => Boolean,
Optional['CollectMode'] => Enum['inactive', 'inactive-or-failed'],
Optional['FailureAction'] => Enum['none', 'reboot', 'reboot-force', 'reboot-immediate', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'exit', 'exit-force', 'soft-reboot', 'soft-reboot-force', 'kexec', 'kexec-force', 'halt', 'halt-force', 'halt-immediate'],
Optional['SuccessAction'] => Enum['none', 'reboot', 'reboot-force', 'reboot-immediate', 'poweroff', 'poweroff-force', 'poweroff-immediate', 'exit', 'exit-force', 'soft-reboot', 'soft-reboot-force', 'kexec', 'kexec-force', 'halt', 'halt-force', 'halt-immediate'],
Optional['FailureActionExitStatus'] => Variant[Enum[''],Integer[0, 255]],
Optional['SuccessActionExitStatus'] => Variant[Enum[''],Integer[0, 255]],
# Conditions and Asserts
Optional['ConditionPathExists'] => Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/],Array[Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/]],1]],
Optional['ConditionPathIsDirectory'] => Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/],Array[Variant[Enum[''],Stdlib::Unixpath,Pattern[/^!.*$/]],1]],
Expand Down