hiera-ldapprovider 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +57 -50
  3. data/lib/hiera/backend/ldap.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9dcce63a21cecc44d7d78fccb8e63834fe6228e
4
- data.tar.gz: 7ca58c58013a8f9bd01465460a74fd5cbfcee36d
3
+ metadata.gz: f0871470681d1e239cdccde7bcce3584eb6441d2
4
+ data.tar.gz: 86ffedd97568f32b3f6635e29fbde1eb829fef17
5
5
  SHA512:
6
- metadata.gz: c667b30b72e476d9f47c97fc77660ad0c81fa1aa06114205c420ed1dbddcddf649377aa77a32b7f8b86e26d6ba377fe0afad1a2576963463e3b4c5feae2b4434
7
- data.tar.gz: b1d945b0817353de2c1e6182a42bfaa96503897a054cbf56dd752d8d2456574854375b9f3e34154cdf06acfae2610f40ed1fa72cf1baf7ccfd3cd62c552f808a
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 placed in your puppet module path and will be pluginsync'd to the master.
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
- dn: uid=nibz,ou=People,dc=catnip
14
- loginShell: /usr/bin/zsh
15
- objectClass: top
16
- objectClass: account
17
- objectClass: posixAccount
18
- objectClass: shadowAccount
19
- objectClass: person
20
- objectClass: organizationalPerson
21
- objectClass: inetOrgPerson
22
- objectClass: podPerson
23
- uid: nibz
24
- uidNumber: 1861
25
- gidNumber: 300
26
- homeDirectory: /u/nibz
27
- gecos: Spencer O Krum
28
- cn: Spencer O Krum
29
- sn: Krum
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
- <pre>
36
+
37
+ ```yaml
36
38
 
37
39
  :ldap:
38
- :base: ou=People,dc=cat,dc=pdx,dc=edu
39
- :host: ldap.cat.pdx.edu
40
- :port: 636
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=cat,dc=pdx,dc=edu
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
- # get info from ldap and put into a hash
55
+ ```yaml
56
+ :hierarchy:
57
+ - "%{::clientcert}"
58
+ - "common"
59
+ ```
53
60
 
54
- $rooter_info = hiera("uid=${username}")
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
- # use the hashdata to fill out user paramaters
60
- # as of now, the ldap/hiera backend downcases ldap attributes
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
- user { $username:
63
- ensure => present,
64
- gid => 'root',
65
- uid => $rooter_info['uidnumber'],
66
- home => $rooter_info['homedirectory'],
67
- managehome => true,
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
- # Details
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
- # Advanced
85
+ # Details
78
86
 
79
- The key being looked up is actually processsed just like rfc4515 so you can use advanced ldap searches:
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
 
@@ -1,7 +1,7 @@
1
1
  class Hiera
2
2
  module Backend
3
3
  module LDAP
4
- VERSION="1.0.2"
4
+ VERSION="1.0.3"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiera-ldapprovider
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Kasper