aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--environments/global/common.yaml1
-rw-r--r--modules/base_installation/manifests/puppet.pp18
-rw-r--r--modules/base_installation/templates/puppet/puppet.conf.erb5
-rw-r--r--modules/base_installation/templates/puppet/xmpp.yaml.erb11
m---------modules/xmpp0
6 files changed, 37 insertions, 1 deletions
diff --git a/.gitmodules b/.gitmodules
index 735ca8c..7a56af5 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -49,6 +49,9 @@
49[submodule "modules/ssh_keygen"] 49[submodule "modules/ssh_keygen"]
50 path = modules/ssh_keygen 50 path = modules/ssh_keygen
51 url = git://git.immae.eu/github/voxpupuli/puppet-ssh_keygen 51 url = git://git.immae.eu/github/voxpupuli/puppet-ssh_keygen
52[submodule "modules/xmpp"]
53 path = modules/xmpp
54 url = git://git.immae.eu/github/jamtur01/puppet-xmpp
52[submodule "modules/ssl"] 55[submodule "modules/ssl"]
53 path = modules/ssl 56 path = modules/ssl
54 url = git://git.immae.eu/github/fnerdwq/puppet-ssl 57 url = git://git.immae.eu/github/fnerdwq/puppet-ssl
diff --git a/environments/global/common.yaml b/environments/global/common.yaml
index 094e0ff..2dfe0aa 100644
--- a/environments/global/common.yaml
+++ b/environments/global/common.yaml
@@ -29,6 +29,7 @@ base_installation::puppet_ssl_path: "/etc/puppetlabs/ssl"
29base_installation::system_locales: ["fr_FR.UTF-8", "en_US.UTF-8"] 29base_installation::system_locales: ["fr_FR.UTF-8", "en_US.UTF-8"]
30base_installation::system_timezone: "Europe/Paris" 30base_installation::system_timezone: "Europe/Paris"
31base_installation::system_users: [] # Fetched via ldap 31base_installation::system_users: [] # Fetched via ldap
32base_installation::notify_xmpp: {}
32profile::fstab::mounts: 33profile::fstab::mounts:
33 - "%{facts.ldapvar.self.vars.mounts.0}" 34 - "%{facts.ldapvar.self.vars.mounts.0}"
34 - "%{facts.ldapvar.self.vars.mounts.1}" 35 - "%{facts.ldapvar.self.vars.mounts.1}"
diff --git a/modules/base_installation/manifests/puppet.pp b/modules/base_installation/manifests/puppet.pp
index 0cb43bc..c64ddfd 100644
--- a/modules/base_installation/manifests/puppet.pp
+++ b/modules/base_installation/manifests/puppet.pp
@@ -56,23 +56,39 @@ class base_installation::puppet (
56 install_options => "--no-user-install" 56 install_options => "--no-user-install"
57 } 57 }
58 58
59 package { 'gem:xmpp4r':
60 name => "xmpp4r",
61 ensure => present,
62 provider => "gem",
63 install_options => "--no-user-install"
64 }
65
59 file { $password_seed: 66 file { $password_seed:
60 mode => "0600", 67 mode => "0600",
61 } 68 }
62 69
63 file { $base_installation::puppet_conf_path: 70 file { $base_installation::puppet_conf_path:
64 ensure => directory, 71 ensure => directory,
65 require => [Package["puppet"], Package["gem:ruby-ldap"]], 72 require => [Package["puppet"], Package["gem:xmpp4r"], Package["gem:ruby-ldap"]],
66 recurse => true, 73 recurse => true,
67 purge => true, 74 purge => true,
68 force => true, 75 force => true,
69 } 76 }
70 77
78 $xmpp = lookup("base_installation::notify_xmpp", { "default_value" => {} })
79
71 file { "$base_installation::puppet_conf_path/puppet.conf": 80 file { "$base_installation::puppet_conf_path/puppet.conf":
72 content => template("base_installation/puppet/puppet.conf.erb"), 81 content => template("base_installation/puppet/puppet.conf.erb"),
73 require => File[$base_installation::puppet_conf_path], 82 require => File[$base_installation::puppet_conf_path],
74 } 83 }
75 84
85 unless empty($xmpp) {
86 file { "$base_installation::puppet_conf_path/xmpp.yaml":
87 content => template("base_installation/puppet/xmpp.yaml.erb"),
88 require => File[$base_installation::puppet_conf_path],
89 }
90 }
91
76 $ips = lookup("ips", { 'default_value' => undef }) 92 $ips = lookup("ips", { 'default_value' => undef })
77 file { "$base_installation::puppet_conf_path/host_ldap.info": 93 file { "$base_installation::puppet_conf_path/host_ldap.info":
78 content => template("base_installation/puppet/host_ldap.info.erb"), 94 content => template("base_installation/puppet/host_ldap.info.erb"),
diff --git a/modules/base_installation/templates/puppet/puppet.conf.erb b/modules/base_installation/templates/puppet/puppet.conf.erb
index 24e67c8..37eba8e 100644
--- a/modules/base_installation/templates/puppet/puppet.conf.erb
+++ b/modules/base_installation/templates/puppet/puppet.conf.erb
@@ -1,4 +1,9 @@
1[main] 1[main]
2<% if @xmpp.count > 0 %>
3reports = store,xmpp
4<% else %>
5reports = store
6<% end %>
2ssldir = <%= @puppet_ssl_path %> 7ssldir = <%= @puppet_ssl_path %>
3 8
4environment = <%= @environment %> 9environment = <%= @environment %>
diff --git a/modules/base_installation/templates/puppet/xmpp.yaml.erb b/modules/base_installation/templates/puppet/xmpp.yaml.erb
new file mode 100644
index 0000000..572f472
--- /dev/null
+++ b/modules/base_installation/templates/puppet/xmpp.yaml.erb
@@ -0,0 +1,11 @@
1:xmpp_password: "<%= @xmpp["password"] %>"
2:xmpp_jid: "<%= @xmpp["jid"] %>/<%= @real_hostname %>"
3:xmpp_target: "<%= @xmpp["target"] %>"
4<% if @xmpp["statuses"].is_a?(String) %>
5:xmpp_statuses: "<%= @xmpp["statuses"] %>"
6<% else %>
7:xmpp_statuses:
8<% @xmpp["statuses"].each do |status| %>
9 - <%= status %>
10<% end %>
11<% end %>
diff --git a/modules/xmpp b/modules/xmpp
new file mode 160000
Subproject d18dd07ffdf6c33942bd0c277cb24aafa513cbd