From 6acb1c28f541d81992d390eeeb9bfa2630f0df8c Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 6 Jun 2011 21:31:48 -0300 Subject: Allow disabling of vserver memory limit --- manifests/vserver.pp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/manifests/vserver.pp b/manifests/vserver.pp index 26f4414..ec9885a 100644 --- a/manifests/vserver.pp +++ b/manifests/vserver.pp @@ -157,18 +157,36 @@ define vs_create($in_domain, $context, $legacy = false, $distro = 'etch', } case $memory_limit { - false: { } + false: { + file { "/etc/vservers/${vs_name}/rlimits/rss.hard": + mode => 0644, owner => root, group => root, + ensure => absent, + } + + file { "/etc/vservers/${vs_name}/rlimits/rss.soft": + mode => 0644, owner => root, group => root, + ensure => absent, + } + + vs_cflags { "${vs_name}-virt_mem": + vserver => $vs_name, + flag => "virt_mem", + ensure => absent, + } + } default: { file { "/etc/vservers/${vs_name}/rlimits": ensure => directory, mode => 0755, owner => root, group => root, require => Exec["vs_create_${vs_name}"], } + file { "/etc/vservers/${vs_name}/rlimits/rss.hard": mode => 0644, owner => root, group => root, content => template("virtual/rss.hard.erb"), require => File["/etc/vservers/${vs_name}/rlimits"], } + file { "/etc/vservers/${vs_name}/rlimits/rss.soft": mode => 0644, owner => root, group => root, content => template("virtual/rss.soft.erb"), -- cgit v1.2.3