From 98a071604ea9f7569aa0fa0688bc9d35081770c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Tue, 2 Oct 2018 22:53:29 +0200 Subject: Add Flony workstation --- modules/base_installation/manifests/puppet.pp | 110 ++++++++++++++------------ 1 file changed, 58 insertions(+), 52 deletions(-) (limited to 'modules/base_installation/manifests/puppet.pp') diff --git a/modules/base_installation/manifests/puppet.pp b/modules/base_installation/manifests/puppet.pp index 603a961..8040017 100644 --- a/modules/base_installation/manifests/puppet.pp +++ b/modules/base_installation/manifests/puppet.pp @@ -52,21 +52,25 @@ class base_installation::puppet ( } unless empty(find_file($password_seed)) { - $ldap_password = generate_password(24, $password_seed, "ldap") - $ssha_ldap_seed = generate_password(5, $password_seed, "ldap_seed") - - package { 'gem:ruby-ldap': - name => "ruby-ldap", - ensure => present, - provider => "gem", - install_options => "--no-user-install" - } + if ($base_installation::ldap_enabled) { + $ldap_password = generate_password(24, $password_seed, "ldap") + $ssha_ldap_seed = generate_password(5, $password_seed, "ldap_seed") + + package { 'gem:ruby-ldap': + name => "ruby-ldap", + ensure => present, + provider => "gem", + install_options => "--no-user-install", + before => File["$base_installation::puppet_conf_path"] + } - package { 'gem:xmpp4r': - name => "xmpp4r", - ensure => present, - provider => "gem", - install_options => "--no-user-install" + package { 'gem:xmpp4r': + name => "xmpp4r", + ensure => present, + provider => "gem", + install_options => "--no-user-install", + before => File["$base_installation::puppet_conf_path"] + } } file { $password_seed: @@ -75,7 +79,7 @@ class base_installation::puppet ( file { $base_installation::puppet_conf_path: ensure => directory, - require => [Package["puppet"], Package["gem:xmpp4r"], Package["gem:ruby-ldap"]], + require => [Package["puppet"]], recurse => true, purge => true, force => true, @@ -103,47 +107,49 @@ class base_installation::puppet ( } } - if file("$base_installation::puppet_notifies_path/host_ldap.info", "/dev/null") != "" and - empty($facts["ldapvar"]) { - fail("LDAP was activated but facts are not available") - } + if ($base_installation::ldap_enabled) { + if file("$base_installation::puppet_notifies_path/host_ldap.info", "/dev/null") != "" and + empty($facts["ldapvar"]) { + fail("LDAP was activated but facts are not available") + } - file { $base_installation::puppet_notifies_path: - ensure => directory, - require => [Package["puppet"], Package["gem:xmpp4r"], Package["gem:ruby-ldap"]], - recurse => true, - purge => true, - force => true, - } + file { $base_installation::puppet_notifies_path: + ensure => directory, + require => [Package["puppet"], Package["gem:xmpp4r"], Package["gem:ruby-ldap"]], + recurse => true, + purge => true, + force => true, + } - $ips = lookup("ips", { 'default_value' => undef }) - concat { "$base_installation::puppet_notifies_path/host_ldap.info": - ensure => "present", - mode => "0600", - require => File[$base_installation::puppet_notifies_path], - ensure_newline => true, - } + $ips = lookup("ips", { 'default_value' => undef }) + concat { "$base_installation::puppet_notifies_path/host_ldap.info": + ensure => "present", + mode => "0600", + require => File[$base_installation::puppet_notifies_path], + ensure_newline => true, + } - concat::fragment { "host_ldap add top": - target => "$base_installation::puppet_notifies_path/host_ldap.info", - content => template("base_installation/puppet/host_ldap_add_top.info.erb"), - order => "00-01", - } - concat::fragment { "host_ldap add bottom": - target => "$base_installation::puppet_notifies_path/host_ldap.info", - content => "EOF", - order => "00-99", - } + concat::fragment { "host_ldap add top": + target => "$base_installation::puppet_notifies_path/host_ldap.info", + content => template("base_installation/puppet/host_ldap_add_top.info.erb"), + order => "00-01", + } + concat::fragment { "host_ldap add bottom": + target => "$base_installation::puppet_notifies_path/host_ldap.info", + content => "EOF", + order => "00-99", + } - concat::fragment { "host_ldap mod top": - target => "$base_installation::puppet_notifies_path/host_ldap.info", - content => template("base_installation/puppet/host_ldap_mod_top.info.erb"), - order => "01-01", - } - concat::fragment { "host_ldap mod bottom": - target => "$base_installation::puppet_notifies_path/host_ldap.info", - content => "EOF", - order => "01-99", + concat::fragment { "host_ldap mod top": + target => "$base_installation::puppet_notifies_path/host_ldap.info", + content => template("base_installation/puppet/host_ldap_mod_top.info.erb"), + order => "01-01", + } + concat::fragment { "host_ldap mod bottom": + target => "$base_installation::puppet_notifies_path/host_ldap.info", + content => "EOF", + order => "01-99", + } } } } -- cgit v1.2.3