diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2012-08-15 17:54:32 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2012-08-15 17:54:32 -0300 |
commit | c0e5d64ad5c8cb80107b4898c2a181f7572de32d (patch) | |
tree | bcc3cb195c6cf5c3955271905139ad46d9a1ce11 | |
parent | 0ba53cd88063dff98b0aaba7b9e75894bda1e010 (diff) | |
download | puppet-virtual-c0e5d64ad5c8cb80107b4898c2a181f7572de32d.tar.gz puppet-virtual-c0e5d64ad5c8cb80107b4898c2a181f7572de32d.tar.bz2 |
Ensure that rlimit file just exist if value is not null
-rw-r--r-- | manifests/vserver.pp | 14 |
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}"], } |