From 09b275be32893f403a6e590d9a36da5506065b18 Mon Sep 17 00:00:00 2001 From: drebs Date: Sun, 14 Mar 2010 19:03:16 -0300 Subject: Adding memory limit to vserves. --- manifests/init.pp | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'manifests') diff --git a/manifests/init.pp b/manifests/init.pp index f66edb1..8ae9589 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -234,21 +234,24 @@ class nodo::vserver inherits nodo { default => "$node_hosting_type", } - if $hosting_type == "direct" { - # Apply munin configuration for this node for - # directly hosted nodes. - Munin_node <<| title == $hostname |>> - } - - if $hosting_type == "third-party" { - # Apply munin configuration for this node for third-party - # hosted nodes. - munin_node { "$hostname": } + case $hosting_type { + "direct": { + # Apply munin configuration for this node for + # directly hosted nodes. + Munin_node <<| title == $hostname |>> + } + "third-party": { + # Apply munin configuration for this node for third-party + # hosted nodes. + munin_node { "$hostname": } + } } # Define a vserver instance - define instance($context, $ensure = 'running', $proxy = false, $puppetmaster = false, $gitd = false, - $icecast = false, $sound = false, $ticket = false) { + define instance($context, $ensure = 'running', $proxy = false, + $puppetmaster = false, $gitd = false, + $icecast = false, $sound = false, $ticket = false, + $memory_limit = false) { # set instance id if $context < 9 { @@ -258,12 +261,13 @@ class nodo::vserver inherits nodo { } vserver { $name: - ensure => $ensure, - context => "$context", - mark => 'default', - distro => 'lenny', - interface => "eth0:192.168.0.$context/24", - hostname => "$name.$domain", + ensure => $ensure, + context => "$context", + mark => 'default', + distro => 'lenny', + interface => "eth0:192.168.0.$context/24", + hostname => "$name.$domain", + memory_limit => $memory_limit, } # Some nodes need a lot of space at /tmp otherwise some admin -- cgit v1.2.3