Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

eldap (3) Versions 0.1.2

Cookbook which provides resources to perfom searches on LDAP

Policyfile
Berkshelf
Knife
cookbook 'eldap', '~> 0.1.2', :supermarket
cookbook 'eldap', '~> 0.1.2'
knife supermarket install eldap
knife supermarket download eldap
README
Dependencies
Quality 33%

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

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['cn'] 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.2 passed this metric

Contributing File Metric
            

0.1.2 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

Foodcritic Metric
            

0.1.2 failed this metric

FC066: Ensure chef_version is set in metadata: eldap/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: eldap/metadata.rb:1
FC108: Resource should not define a property named 'name': eldap/resources/connection.rb:6
FC108: Resource should not define a property named 'name': eldap/resources/crud.rb:5
FC108: Resource should not define a property named 'name': eldap/resources/dump.rb:7
FC108: Resource should not define a property named 'name': eldap/resources/eldap_template.rb:6
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

No Binaries Metric
            

0.1.2 passed this metric

Testing File Metric
            

0.1.2 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.2 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