From: Ismaƫl Bouya Date: Sat, 28 Apr 2018 13:00:49 +0000 (+0200) Subject: Add a safeguard when ldap is not available after install X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=036a3f5ce06a3203325915b90e25f961e47d8fc0;p=perso%2FImmae%2FProjets%2FPuppet.git Add a safeguard when ldap is not available after install --- diff --git a/modules/base_installation/manifests/puppet.pp b/modules/base_installation/manifests/puppet.pp index fa2db69..3ca226a 100644 --- a/modules/base_installation/manifests/puppet.pp +++ b/modules/base_installation/manifests/puppet.pp @@ -95,6 +95,11 @@ class base_installation::puppet ( } } + 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"),