aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrebs <drebs@riseup.net>2010-03-15 16:25:43 -0300
committerdrebs <drebs@riseup.net>2010-03-15 16:25:43 -0300
commitc209466c4d4ae022591b091d766f296f47fda0f2 (patch)
treef36491d6944e93732bb1b8b51dd0693780155dee
parent8951c1cc8d2b9958ca556ae41a67ae775a65e4ee (diff)
downloadpuppet-virtual-c209466c4d4ae022591b091d766f296f47fda0f2.tar.gz
puppet-virtual-c209466c4d4ae022591b091d766f296f47fda0f2.tar.bz2
Adding VIRT_MEM flags to vservers with limited memory.
-rw-r--r--manifests/vserver.pp6
-rw-r--r--templates/flags.erb3
2 files changed, 9 insertions, 0 deletions
diff --git a/manifests/vserver.pp b/manifests/vserver.pp
index 63053a3..7a0db8e 100644
--- a/manifests/vserver.pp
+++ b/manifests/vserver.pp
@@ -148,6 +148,7 @@ define vs_create($in_domain, $context, $legacy = false, $distro = 'etch',
file { "/etc/vservers/${vs_name}/rlimits":
ensure => directory,
mode => 0755, owner => root, group => root,
+ require => File["/etc/vservers/${vs_name}"],
}
file { "/etc/vservers/${vs_name}/rlimits/rss.hard":
mode => 0644, owner => root, group => root,
@@ -159,6 +160,11 @@ define vs_create($in_domain, $context, $legacy = false, $distro = 'etch',
content => template("virtual/rss.soft.erb"),
require => File["/etc/vservers/${vs_name}/rlimits"],
}
+ file { "/etc/vservers/${vs_name}/flags":
+ mode => 0644, owner => root, group => root,
+ content => template("virtual/flags.erb"),
+ require => File["/etc/vservers/${vs_name}"],
+ }
}
}
}
diff --git a/templates/flags.erb b/templates/flags.erb
new file mode 100644
index 0000000..630fba7
--- /dev/null
+++ b/templates/flags.erb
@@ -0,0 +1,3 @@
+<% if memory_limit != false -%>
+VIRT_MEM
+<% end -%>