{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/30","labels_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/30/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/30/events","html_url":"https://github.com/ansible/ansible-modules-extras/pull/30","id":44434170,"number":30,"title":"add ldap module","user":{"login":"grossws","id":171284,"avatar_url":"https://avatars.githubusercontent.com/u/171284?v=3","gravatar_id":"","url":"https://api.github.com/users/grossws","html_url":"https://github.com/grossws","followers_url":"https://api.github.com/users/grossws/followers","following_url":"https://api.github.com/users/grossws/following{/other_user}","gists_url":"https://api.github.com/users/grossws/gists{/gist_id}","starred_url":"https://api.github.com/users/grossws/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grossws/subscriptions","organizations_url":"https://api.github.com/users/grossws/orgs","repos_url":"https://api.github.com/users/grossws/repos","events_url":"https://api.github.com/users/grossws/events{/privacy}","received_events_url":"https://api.github.com/users/grossws/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/feature_pull_request","name":"feature_pull_request","color":"009800"},{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/new_module","name":"new_module","color":"bfe5bf"},{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/P4","name":"P4","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-09-30T12:21:58Z","updated_at":"2015-06-16T21:17:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/pulls/30","html_url":"https://github.com/ansible/ansible-modules-extras/pull/30","diff_url":"https://github.com/ansible/ansible-modules-extras/pull/30.diff","patch_url":"https://github.com/ansible/ansible-modules-extras/pull/30.patch"},"body":"When I tried to configure ldap with ansible, I have to do it in three phases: copy `ldif` file to target system, perform `ldapsearch` to check if entry exists and call to `ldapadd` or `ldapmodify` after that (conditionally). It's uncomfortable and error-prone. So I implemented ldap module using python ldap library, present in base repos (CentOS base in my case). \r\n\r\nAnother advantage over calling `ldapmodify` (and other utils from `openldap-clients`) that module supports fully idempotent ldap operation and check mode. \r\n\r\nSupported operation modes are equal to `ldapadd`, `ldapmodify` and `ldapdelete` openldap utils but will not apply any operations if LDAP entry wouldn't change after these operations (like deleting non-existent attribute, replace attribute with values already present in it etc).\r\n\r\nSupported features:\r\n- connect using `ldap`, `ldaps` and `ldapi` protocols;\r\n- *STARTTLS* over `ldap` protocol;\r\n- anonymous and authenticated operation (using `simple` auth);\r\n- SASL *EXTERNAL* auth method on `ldapi` protocol (usually used to configure OpenLDAP 2.4+ on-line configs in `cn=config` subtree);\r\n- adding and deleting entries (via `state=present` and `state=absent`);\r\n- adding, deleting and replacing individual attributes, attribute-value pairs or their combinations;\r\n- `simple_args` and `complex_args` format for entry modification command;\r\n- many examples to explain different args format and operation modes;\r\n- simple DSL for one-line ldap entry modification command (with EBNF-like `simple_args` format definition);\r\n- *UTF-8* for attribute values;\r\n- grouping (by attribute) and collapsing ldap modification operations to get true idempotent behavior;\r\n- parsed and final ldap modifications (as they will be sent to ldap server) are logged to simplify module learing and operations debugging.\r\n\r\nTarget system requirement:\r\n- python-ldap\r\n\r\nIt's rebased (with path and extension fixed) of PR ansible/ansible#7409."},"comment":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/comments/112572122","html_url":"https://github.com/ansible/ansible-modules-extras/pull/30#issuecomment-112572122","issue_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/30","id":112572122,"user":{"login":"gregdek","id":252125,"avatar_url":"https://avatars.githubusercontent.com/u/252125?v=3","gravatar_id":"","url":"https://api.github.com/users/gregdek","html_url":"https://github.com/gregdek","followers_url":"https://api.github.com/users/gregdek/followers","following_url":"https://api.github.com/users/gregdek/following{/other_user}","gists_url":"https://api.github.com/users/gregdek/gists{/gist_id}","starred_url":"https://api.github.com/users/gregdek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gregdek/subscriptions","organizations_url":"https://api.github.com/users/gregdek/orgs","repos_url":"https://api.github.com/users/gregdek/repos","events_url":"https://api.github.com/users/gregdek/events{/privacy}","received_events_url":"https://api.github.com/users/gregdek/received_events","type":"User","site_admin":false},"created_at":"2015-06-16T21:17:19Z","updated_at":"2015-06-16T21:17:19Z","body":"Thanks for submitting your module to Ansible Extras. Our policy is that each new module needs to be reviewed and approved by at least two official module reviewers, the list of whom can be found here: https://github.com/ansible/ansible-modules-extras/blob/devel/REVIEWERS.md \r\n\r\nIf you know someone on that list, please poke them and encourage them to review your module. :)\r\n\r\nTo ensure that your module has the best chance of being approved, please double-check that you adhere to the Ansible module guidelines: http://docs.ansible.com/developing_modules.html#module-checklist"}}