aboutsummaryrefslogtreecommitdiff
path: root/modules/base_installation/templates/puppet/host_ldap.info.erb
blob: 7afdf2dd3ac2d9a629c31e77c695b6df8012bf7a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#### Please add this node to LDAP:
ldapadd -D "cn=root,<%= @ldap_base %>" -W << 'EOF'
dn: <%= @ldap_dn %>
cn: <%= @ldap_cn %>
objectclass: device
objectclass: top
objectclass: simpleSecurityObject
objectclass: puppetClient
<%- unless @ips.empty? -%>
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 %>
puppetVar: real_hostname=<%= @real_hostname %>
userpassword: {SSHA}<%= Base64.encode64(Digest::SHA1.digest(@ldap_password+@ssha_ldap_seed)+@ssha_ldap_seed).chomp! %>
EOF
#### Or modify an existing entry:
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