]> gitweb.fluxo.info Git - puppet-backupninja.git/commitdiff
Checking for backupninja_server_realize definition / comments
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 5 Jun 2010 20:11:52 +0000 (17:11 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 5 Jun 2010 20:11:52 +0000 (17:11 -0300)
manifests/server.pp

index 40e90048bda371a41e4c6d4ec696e410e5f10525..962c416dac7e252fcaf5f28d72596711db3b022f 100644 (file)
@@ -1,3 +1,4 @@
+# this define realizes all needed resources for a hosted backup
 define backupninja_server_realize($host) {
   User               <<| tag == "backupninja-$host" |>>
   File               <<| tag == "backupninja-$host" |>>
@@ -110,9 +111,12 @@ class backupninja::server {
       nagios2::passive_service { "backups-${name}": nagios2_host_name => $real_host, nagios2_description => $real_nagios2_description, servicegroups => "backups" }
     }
     
-    @@backupninja_server_realize { "${fqdn}-${real_host}":
-      host => $fqdn,
-      tag  => $real_host,
+    if !defined(Backupninja_server_realize["${fqdn}-${real_host}"]) {
+      # this defines just maps that $real_host host backups for $fdqn
+      @@backupninja_server_realize { "${fqdn}-${real_host}":
+        host => $fqdn,
+        tag  => $real_host,
+      }
     }
 
     if !defined(File["$real_dir"]) {