aboutsummaryrefslogtreecommitdiff
path: root/manifests/vserver.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/vserver.pp')
-rw-r--r--manifests/vserver.pp14
1 files changed, 12 insertions, 2 deletions
diff --git a/manifests/vserver.pp b/manifests/vserver.pp
index 5217206..52adace 100644
--- a/manifests/vserver.pp
+++ b/manifests/vserver.pp
@@ -641,7 +641,10 @@ define vs_rlimit($vserver, $limit, $soft = '', $hard = '', $min = '', $ensure =
file { "/etc/vservers/${vserver}/rlimits/$limit.soft":
mode => 0644, owner => root, group => root,
content => "$soft\n",
- ensure => $ensure,
+ ensure => $soft ? {
+ '' => absent,
+ default => $ensure,
+ },
require => File["/etc/vservers/${vserver}/rlimits"],
notify => Exec["vs_restart_${vserver}"],
}
@@ -650,6 +653,10 @@ define vs_rlimit($vserver, $limit, $soft = '', $hard = '', $min = '', $ensure =
mode => 0644, owner => root, group => root,
content => "$hard\n",
ensure => $ensure,
+ ensure => $hard ? {
+ '' => absent,
+ default => $ensure,
+ },
require => File["/etc/vservers/${vserver}/rlimits"],
notify => Exec["vs_restart_${vserver}"],
}
@@ -657,7 +664,10 @@ define vs_rlimit($vserver, $limit, $soft = '', $hard = '', $min = '', $ensure =
file { "/etc/vservers/${vserver}/rlimits/$limit.min":
mode => 0644, owner => root, group => root,
content => "$min\n",
- ensure => $ensure,
+ ensure => $min? {
+ '' => absent,
+ default => $ensure,
+ },
require => File["/etc/vservers/${vserver}/rlimits"],
notify => Exec["vs_restart_${vserver}"],
}