]> gitweb.fluxo.info Git - puppet-nodo.git/commitdiff
Introducing $main_master
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 15 Feb 2010 22:48:52 +0000 (20:48 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 15 Feb 2010 22:48:52 +0000 (20:48 -0200)
manifests/init.pp

index c6578cd1fcc39849fed30c2a84a0ce02b2423a30..5251251a48e19b7da874c91a8119d2b548b5e81a 100644 (file)
@@ -405,13 +405,25 @@ class nodo::master {
   include database
   include gitosis
   include websites::admin
-  # TODO:
-  #include munin::host
 
-  host { "puppet":
-    ensure => present,
-    ip     => "127.0.0.1",
-    alias  => ["puppet.$domain"],
+  case $main_master {
+    '': { fail("You need to define if this is the main master! Please set \$main_master in host config") }
+  }
+
+  if $main_master = true {
+    include munin::host
+
+    # The main master has a host entry pointing to itself, other
+    # masters still retrieve catalogs from the main master.
+    host { "puppet":
+      ensure => present,
+      ip     => "127.0.0.1",
+      alias  => ["puppet.$domain"],
+    }
+  } else {
+    host { "puppet":
+      ensure => absent,
+    }
   }
 
   case $puppetmaster_db_password {