From 85abd2fdbad83430df4824843764719064afb9b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sat, 3 Mar 2018 22:24:19 +0100 Subject: Fetch node informations from LDAP environment, hostname --- modules/base_installation/templates/puppet/host_ldap.info.erb | 4 +++- modules/base_installation/templates/puppet/puppet.conf.erb | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'modules/base_installation/templates') diff --git a/modules/base_installation/templates/puppet/host_ldap.info.erb b/modules/base_installation/templates/puppet/host_ldap.info.erb index 525739b..a71c6f3 100644 --- a/modules/base_installation/templates/puppet/host_ldap.info.erb +++ b/modules/base_installation/templates/puppet/host_ldap.info.erb @@ -2,7 +2,6 @@ ldapadd -D "cn=root,<%= @ldap_base %>" -W << 'EOF' dn: <%= @ldap_dn %> cn: <%= @ldap_cn %> -cn: <%= @system_hostname %> objectclass: device objectclass: top objectclass: simpleSecurityObject @@ -12,6 +11,7 @@ objectclass: ipHost <% unless @ips["v4"].nil? -%>ipHostNumber: <%= @ips["v4"]["ipAddress"] %><%- end %> <% unless @ips["v6"].nil? -%>ipHostNumber: <%= @ips["v6"]["ipAddress"] %>/<%= @ips["v6"]["mask"] %><%- end %> <%- end -%> +environment: <%= @environment %> userpassword: {SSHA}<%= Base64.encode64(Digest::SHA1.digest(@ldap_password+@ssha_ldap_seed)+@ssha_ldap_seed).chomp! %> EOF #### Or modify an existing entry: @@ -20,6 +20,8 @@ dn: <%= @ldap_dn %> changetype: modify replace: userPassword userpassword: {SSHA}<%= Base64.encode64(Digest::SHA1.digest(@ldap_password+@ssha_ldap_seed)+@ssha_ldap_seed).chomp! %> +replace: environment +environment: <%= @environment %> <%- unless @ips.empty? -%> - delete: ipHostNumber diff --git a/modules/base_installation/templates/puppet/puppet.conf.erb b/modules/base_installation/templates/puppet/puppet.conf.erb index 3748039..24e67c8 100644 --- a/modules/base_installation/templates/puppet/puppet.conf.erb +++ b/modules/base_installation/templates/puppet/puppet.conf.erb @@ -1,8 +1,10 @@ [main] ssldir = <%= @puppet_ssl_path %> +environment = <%= @environment %> + node_terminus = ldap -certname = <%= @system_hostname %> +certname = <%= @real_hostname %> ldapserver = <%= @ldap_server %> ldaptls = true ldapbase = <%= @ldap_base %> -- cgit v1.2.3