diff --git a/REFERENCE.md b/REFERENCE.md index 5707b02e..9e07a9d2 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -2316,6 +2316,7 @@ Struct[{ Optional['AmbientCapabilities'] => Variant[Pattern[/^CAP_[A-Z_]+$/],Array[Pattern[/^CAP_[A-Z_]+$/],1]], Optional['User'] => String[1], Optional['Group'] => String[1], + Optional['WorkingDirectory'] => String[0], Optional['Type'] => Enum['simple', 'exec', 'forking', 'oneshot', 'dbus', 'notify', 'idle'], Optional['ExitType'] => Enum['main', 'cgroup'], Optional['RemainAfterExit'] => Boolean, diff --git a/spec/type_aliases/systemd_unit_service_spec.rb b/spec/type_aliases/systemd_unit_service_spec.rb index 505a185a..d4f1eecd 100644 --- a/spec/type_aliases/systemd_unit_service_spec.rb +++ b/spec/type_aliases/systemd_unit_service_spec.rb @@ -44,4 +44,9 @@ it { is_expected.to allow_value({ 'Group' => 'root' }) } it { is_expected.to allow_value({ 'StandardOutput' => 'null' }) } it { is_expected.to allow_value({ 'StandardError' => 'null' }) } + + 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' => '' }) } end diff --git a/types/unit/service.pp b/types/unit/service.pp index e92bc854..63bd1e3e 100644 --- a/types/unit/service.pp +++ b/types/unit/service.pp @@ -7,6 +7,7 @@ Optional['AmbientCapabilities'] => Variant[Pattern[/^CAP_[A-Z_]+$/],Array[Pattern[/^CAP_[A-Z_]+$/],1]], Optional['User'] => String[1], Optional['Group'] => String[1], + Optional['WorkingDirectory'] => String[0], Optional['Type'] => Enum['simple', 'exec', 'forking', 'oneshot', 'dbus', 'notify', 'idle'], Optional['ExitType'] => Enum['main', 'cgroup'], Optional['RemainAfterExit'] => Boolean,