diff --git a/REFERENCE.md b/REFERENCE.md index 21c7feb9..14988442 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -2888,7 +2888,7 @@ Struct[{ Optional['MemoryHigh'] => Systemd::Unit::AmountOrPercent, Optional['MemoryMax'] => Systemd::Unit::AmountOrPercent, Optional['MemoryLimit'] => Systemd::Unit::Amount, - Optional['MemorySwapMax'] => Systemd::Unit::Amount, + Optional['MemorySwapMax'] => Systemd::Unit::AmountOrPercent, Optional['TasksAccounting'] => Boolean, Optional['TasksMax'] => Systemd::Unit::AmountOrPercent, Optional['IOAccounting'] => Boolean, diff --git a/spec/type_aliases/systemd_unit_service_spec.rb b/spec/type_aliases/systemd_unit_service_spec.rb index fa31128e..971ed3cc 100644 --- a/spec/type_aliases/systemd_unit_service_spec.rb +++ b/spec/type_aliases/systemd_unit_service_spec.rb @@ -103,6 +103,8 @@ ) } + it { is_expected.to allow_value({ 'MemorySwapMax' => '80%' }) } + it { is_expected.not_to allow_value({ 'CPUQuota' => 50 }) } it { is_expected.not_to allow_value({ 'CPUQuota' => '0%' }) } it { is_expected.not_to allow_value({ 'MemoryHigh' => '1Y' }) } diff --git a/types/unit/service.pp b/types/unit/service.pp index 9a24f198..b6bb83c1 100644 --- a/types/unit/service.pp +++ b/types/unit/service.pp @@ -57,7 +57,7 @@ Optional['MemoryHigh'] => Systemd::Unit::AmountOrPercent, Optional['MemoryMax'] => Systemd::Unit::AmountOrPercent, Optional['MemoryLimit'] => Systemd::Unit::Amount, - Optional['MemorySwapMax'] => Systemd::Unit::Amount, + Optional['MemorySwapMax'] => Systemd::Unit::AmountOrPercent, Optional['TasksAccounting'] => Boolean, Optional['TasksMax'] => Systemd::Unit::AmountOrPercent, Optional['IOAccounting'] => Boolean,