cookbook 'eldap', '= 0.1.1'
eldap (3) Versions 0.1.1 Follow1
Cookbook which provides resources to perfom searches on LDAP
cookbook 'eldap', '= 0.1.1', :supermarket
knife supermarket install eldap
knife supermarket download eldap
eldap
eldap cookbook helps you querying information from LDAP to work with your cookbook.
TODO: Create a better testing scripts
Usage
Your need to create at least 3 "resources": eldap_connection, eldap (action :search) and eldap_execute. Note that the name of the resource will be used on eldap's conn_name attribute.
eldap_connection resource
First of all, set your connection:
eldap_connection "ldap-example" do
host ldap.mycompany.com
port 389
auth_method 'simple'
auth_username 'cn=manager,dc=mycompany,dc=com'
auth_password 'Password1'
end
Or set the attributes:
{"eldap" :
"host" : "ldap.mycompany.com",
"port" : 389,
"auth": {
"method" : "simple",
"username" : "cn=manager,dc=mycompany,dc=com",
"password" : "Password1"
}
}
And use just set the connction name to use the default settings:
eldap_connection "ldap-example"
eldap resource
action :search
Set the eldap (action :search) with a property name (this name will be used by other
resources like eldap_execute and eldap_dump_results_from):
- The 'conn_name' is the same name of the eldap_connection's resource name you set.
- The 'search' is the filter which you're looking for.
- The 'fields' are the properties you want to retrieve
eldap "search_username" do
conn_name "ldap-example"
basedn 'ou=users,dc=mycompany,dc=com'
search [['cn', :eq, 'user*']]
fields ['cn', 'homedirectory']
action :search
end
For the future...
Include more actions like :create, :delete, :update
eldap_execute resource
This is the way you iterate through the results of the LDAP search.
- NOTE: Use the same eldap resource name in order to get the results from that search.
eldap_execute "search_username" do |result|
execute "#{result.inspect.to_s.gsub(/\s/,'_')}" do
command "echo '#{result.inspect}'"
end
end
eldap_template resource
This is a template-like resource, but it contains the LDAP search results pre-populated.
the resource name must be the name of the eldap (action :search) resource. All the
results will be stored in @ldap variable. To print the details, use <%=@ldap.inspect %>
- NOTE: Use the same eldap resource name in order to get the results from that search.
eldap_template "search_username" do
source "eldap.erb"
path "/tmp/eldap"
mode '0777'
owner 'root'
variables ({ extra_info: :simple_value })
end
eldap_dump_results_from resource
As the name says, it prints the results of a search in Chef's output (Log.warn).
- NOTE: Use the same eldap resource name in order to get the results from that search.
eldap_dump_results_from "search-user"
Dependent cookbooks
openldap ~> 3.0.3 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
0.1.1 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
License Metric
0.1.1 passed this metric
Testing File Metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.1 failed this metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
License Metric
0.1.1 passed this metric
Testing File Metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.1 passed this metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.1.1 failed this metric