]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blobdiff - modules/base_installation/manifests/puppet.pp
XMPP notification
[perso/Immae/Projets/Puppet.git] / modules / base_installation / manifests / puppet.pp
index b3ce49207a67007266df1ba5ca1b1883c76015ff..c64ddfdccf141095002805c97498f2cd1dc248b2 100644 (file)
@@ -39,6 +39,12 @@ class base_installation::puppet (
     source => "puppet:///modules/base_installation/scripts/report_print.rb"
   }
 
+  file { '/usr/local/sbin/puppet_apply':
+    mode   => "0755",
+    ensure => present,
+    source => "puppet:///modules/base_installation/scripts/puppet_apply",
+  }
+
   unless empty(find_file($password_seed)) {
     $ldap_password = generate_password(24, $password_seed, "ldap")
     $ssha_ldap_seed = generate_password(5, $password_seed, "ldap_seed")
@@ -50,24 +56,40 @@ class base_installation::puppet (
       install_options => "--no-user-install"
     }
 
+    package { 'gem:xmpp4r':
+      name            => "xmpp4r",
+      ensure          => present,
+      provider        => "gem",
+      install_options => "--no-user-install"
+    }
+
     file { $password_seed:
       mode => "0600",
     }
 
     file { $base_installation::puppet_conf_path:
       ensure  => directory,
-      require => [Package["puppet"], Package["gem:ruby-ldap"]],
+      require => [Package["puppet"], Package["gem:xmpp4r"], Package["gem:ruby-ldap"]],
       recurse => true,
       purge   => true,
       force   => true,
     }
 
+    $xmpp = lookup("base_installation::notify_xmpp", { "default_value" => {} })
+
     file { "$base_installation::puppet_conf_path/puppet.conf":
       content => template("base_installation/puppet/puppet.conf.erb"),
       require => File[$base_installation::puppet_conf_path],
     }
 
-    $ips = lookup("ips") |$key| { {} }
+    unless empty($xmpp) {
+      file { "$base_installation::puppet_conf_path/xmpp.yaml":
+        content => template("base_installation/puppet/xmpp.yaml.erb"),
+        require => File[$base_installation::puppet_conf_path],
+      }
+    }
+
+    $ips = lookup("ips", { 'default_value' => undef })
     file { "$base_installation::puppet_conf_path/host_ldap.info":
       content => template("base_installation/puppet/host_ldap.info.erb"),
       require => File[$base_installation::puppet_conf_path],