]> gitweb.fluxo.info Git - puppet-nodo.git/commitdiff
Adding memory limit to vserves.
authordrebs <drebs@riseup.net>
Sun, 14 Mar 2010 22:03:16 +0000 (19:03 -0300)
committerdrebs <drebs@riseup.net>
Sun, 14 Mar 2010 22:03:16 +0000 (19:03 -0300)
manifests/init.pp

index f66edb1614f79b9f859260a7357e75dcf97d8922..8ae9589efa2462ed17a6e05983a9c6d7cbe26bd3 100644 (file)
@@ -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