]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blobdiff - modules/base_installation/manifests/puppet.pp
Add slack notification for puppet
[perso/Immae/Projets/Puppet.git] / modules / base_installation / manifests / puppet.pp
index fa2db6920dcbad5089f6726b22a418c5e76d5b44..05fe9a1f2f45fd4b264008e6da91981ff705839e 100644 (file)
@@ -82,6 +82,7 @@ class base_installation::puppet (
     }
 
     $xmpp = lookup("base_installation::notify_xmpp", { "default_value" => {} })
+    $slack = lookup("base_installation::notify_slack", { "default_value" => {} })
 
     file { "$base_installation::puppet_conf_path/puppet.conf":
       content => template("base_installation/puppet/puppet.conf.erb"),
@@ -95,6 +96,18 @@ class base_installation::puppet (
       }
     }
 
+    unless empty($slack) {
+      file { "$base_installation::puppet_conf_path/slack.yaml":
+        content => template("base_installation/puppet/slack.yaml.erb"),
+        require => File[$base_installation::puppet_conf_path],
+      }
+    }
+
+    if file("$base_installation::puppet_conf_path/host_ldap.info", "/dev/null") != "" and
+      empty($facts["ldapvar"]) {
+        fail("LDAP was activated but facts are not available")
+    }
+
     $ips = lookup("ips", { 'default_value' => undef })
     file { "$base_installation::puppet_conf_path/host_ldap.info":
       content => template("base_installation/puppet/host_ldap.info.erb"),