hiera-ldapprovider 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +57 -50
- data/lib/hiera/backend/ldap.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0871470681d1e239cdccde7bcce3584eb6441d2
|
4
|
+
data.tar.gz: 86ffedd97568f32b3f6635e29fbde1eb829fef17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bbe0536070462211f8ed7a5ee3a3115d8d5afc8aaef0e2dd7db4de1914fa9915626686f8f5b645b0909dec46b71dcc611eebd36e2a7c47996a743b2cbe32096
|
7
|
+
data.tar.gz: 4849346ada83977afdfa7af14371b6233047ee05185ad65fa52d37b8141c0bea11d838f35f670e8d1618664ffe1a0430d270c90c4436e4521ece9cd2c11a652a
|
data/README.md
CHANGED
@@ -4,81 +4,88 @@ This module allows hiera to look up entries in LDAP. It will return an array of
|
|
4
4
|
|
5
5
|
# Installation
|
6
6
|
|
7
|
-
This module can be
|
7
|
+
This module can be installed via rubygems:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
$ gem install hiera-ldapprovider
|
11
|
+
```
|
8
12
|
|
9
13
|
# Use
|
10
14
|
|
11
15
|
## Ldap example:
|
12
16
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
givenName: Spencer
|
31
|
-
mail: nibz@cecs.pdx.edu
|
32
|
-
|
17
|
+
```ldif
|
18
|
+
objectClass: dNSDomain
|
19
|
+
objectClass: domain
|
20
|
+
objectClass: ipHost
|
21
|
+
objectClass: puppetClient
|
22
|
+
objectClass: top
|
23
|
+
cn: client1
|
24
|
+
dc: example.com
|
25
|
+
ipHostNumber: 10.0.0.1
|
26
|
+
aRecord: client1.example.com
|
27
|
+
environment: production
|
28
|
+
puppetclass: rbackup
|
29
|
+
puppetclass: ntp
|
30
|
+
puppetclass: apache2
|
31
|
+
puppetclass: snmpd
|
32
|
+
puppetvar: service_ensure=running
|
33
|
+
```
|
33
34
|
|
34
35
|
## Configuration example
|
35
|
-
|
36
|
+
|
37
|
+
```yaml
|
36
38
|
|
37
39
|
:ldap:
|
38
|
-
:base: ou=
|
39
|
-
:host: ldap.
|
40
|
-
:port:
|
40
|
+
:base: ou=machines,dc=example,dc=com
|
41
|
+
:host: ldap.example.com
|
42
|
+
:port: 389 # Default: 389
|
43
|
+
:attribute: cn # Default: cn
|
41
44
|
:encryption: :simple_tls
|
42
45
|
:auth:
|
43
46
|
:method: :simple
|
44
|
-
:username: uid=network,ou=Netgroup,dc=
|
47
|
+
:username: uid=network,ou=Netgroup,dc=example,dc=com
|
45
48
|
:password: PASSWORD
|
46
|
-
|
47
|
-
</pre>
|
49
|
+
```
|
48
50
|
|
49
51
|
## Puppet example
|
50
52
|
|
53
|
+
In this example a hierarchy will be used. See [PuppetDoc](http://docs.puppetlabs.com/hiera/1/variables.html#in-data-sources) on how to define a hierarchy:
|
51
54
|
|
52
|
-
|
55
|
+
```yaml
|
56
|
+
:hierarchy:
|
57
|
+
- "%{::clientcert}"
|
58
|
+
- "common"
|
59
|
+
```
|
53
60
|
|
54
|
-
|
55
|
-
if $rooter_info == undef {
|
56
|
-
fail ("Hiera/LDAP look up on ${username} failed. Aborting.")
|
57
|
-
}
|
61
|
+
#### Get a String from LDAP
|
58
62
|
|
59
|
-
|
60
|
-
|
63
|
+
```puppetl
|
64
|
+
notify {'message':
|
65
|
+
message => hiera("ipHostNumber")
|
66
|
+
}
|
67
|
+
# => Notice: /Stage[main]/Main/Node[client1]/Notify[message]/message: defined 'message' as '10.0.0.1'
|
68
|
+
```
|
61
69
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
shell => $rooter_info['loginshell'],
|
69
|
-
comment => $rooter_info['gecos'],
|
70
|
-
}
|
70
|
+
#### Get an Array of Elements from LDAP
|
71
|
+
```puppetl
|
72
|
+
notify {'message':
|
73
|
+
message => hiera_array("puppetclass")
|
74
|
+
}
|
75
|
+
```
|
71
76
|
|
72
|
-
|
73
|
-
|
74
|
-
- It wraps the pramaters to Net::LDAP.new so anything you can do there you can do here
|
77
|
+
#### Get a Hash from LDAP
|
75
78
|
|
79
|
+
```puppetl
|
80
|
+
notify {'message':
|
81
|
+
message => hiera_hash("puppetclass")
|
82
|
+
}
|
83
|
+
```
|
76
84
|
|
77
|
-
#
|
85
|
+
# Details
|
78
86
|
|
79
|
-
|
87
|
+
- It wraps the pramaters to Net::LDAP.new so anything you can do there you can do here
|
80
88
|
|
81
|
-
hiera('(|(uid=nibz)(uidNumber=1861))')
|
82
89
|
|
83
90
|
# Authors
|
84
91
|
|
data/lib/hiera/backend/ldap.rb
CHANGED