}
$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],
- notify => Notify_refresh["notify-ldap-password"],
+ concat { "$base_installation::puppet_conf_path/host_ldap.info":
+ ensure => "present",
+ mode => "0600",
+ require => File[$base_installation::puppet_conf_path],
+ notify => Notify_refresh["notify-ldap-password"],
+ ensure_newline => true,
+ }
+
+ concat::fragment { "host_ldap add top":
+ target => "$base_installation::puppet_conf_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_conf_path/host_ldap.info",
+ content => "EOF",
+ order => "00-99",
+ }
+
+ concat::fragment { "host_ldap mod top":
+ target => "$base_installation::puppet_conf_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_conf_path/host_ldap.info",
+ content => "EOF",
+ order => "01-99",
}
notify_refresh { "notify-ldap-password":
environment: <%= @environment %>
puppetVar: real_hostname=<%= @real_hostname %>
userpassword: {SSHA}<%= Base64.encode64(Digest::SHA1.digest(@ldap_password+@ssha_ldap_seed)+@ssha_ldap_seed).chomp! %>
-EOF
-\e[0;35m#### Or modify an existing entry:\e[0m
-ldapmodify -D "cn=root,<%= @ldap_base %>" -W << 'EOF'
-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
-<%- unless @ips["v4"].nil? -%>
--
-add: ipHostNumber
-ipHostNumber: <%= @ips["v4"]["ipAddress"] %>
-<%- end -%>
-<%- unless @ips["v6"].nil? -%>
--
-add: ipHostNumber
-ipHostNumber: <%= @ips["v6"]["ipAddress"] %>/<%= @ips["v6"]["mask"] %>
-<%- end -%>
-<%- end -%>
-EOF
--- /dev/null
+\e[0;35m#### Or modify an existing entry:\e[0m
+ldapmodify -D "cn=root,<%= @ldap_base %>" -W << 'EOF'
+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
+<%- unless @ips["v4"].nil? -%>
+-
+add: ipHostNumber
+ipHostNumber: <%= @ips["v4"]["ipAddress"] %>
+<%- end -%>
+<%- unless @ips["v6"].nil? -%>
+-
+add: ipHostNumber
+ipHostNumber: <%= @ips["v6"]["ipAddress"] %>/<%= @ips["v6"]["mask"] %>
+<%- end -%>
+<%- end -%>