{"action":"created","issue":{"url":"https://api.github.com/repos/quinot/ansible-plugin-lookup_ldap/issues/3","labels_url":"https://api.github.com/repos/quinot/ansible-plugin-lookup_ldap/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/quinot/ansible-plugin-lookup_ldap/issues/3/comments","events_url":"https://api.github.com/repos/quinot/ansible-plugin-lookup_ldap/issues/3/events","html_url":"https://github.com/quinot/ansible-plugin-lookup_ldap/issues/3","id":59759837,"number":3,"title":"reconsider context naming convention","user":{"login":"PhilEv","id":3406687,"avatar_url":"https://avatars.githubusercontent.com/u/3406687?v=3","gravatar_id":"","url":"https://api.github.com/users/PhilEv","html_url":"https://github.com/PhilEv","followers_url":"https://api.github.com/users/PhilEv/followers","following_url":"https://api.github.com/users/PhilEv/following{/other_user}","gists_url":"https://api.github.com/users/PhilEv/gists{/gist_id}","starred_url":"https://api.github.com/users/PhilEv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhilEv/subscriptions","organizations_url":"https://api.github.com/users/PhilEv/orgs","repos_url":"https://api.github.com/users/PhilEv/repos","events_url":"https://api.github.com/users/PhilEv/events{/privacy}","received_events_url":"https://api.github.com/users/PhilEv/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/quinot/ansible-plugin-lookup_ldap/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":{"login":"quinot","id":1678806,"avatar_url":"https://avatars.githubusercontent.com/u/1678806?v=3","gravatar_id":"","url":"https://api.github.com/users/quinot","html_url":"https://github.com/quinot","followers_url":"https://api.github.com/users/quinot/followers","following_url":"https://api.github.com/users/quinot/following{/other_user}","gists_url":"https://api.github.com/users/quinot/gists{/gist_id}","starred_url":"https://api.github.com/users/quinot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quinot/subscriptions","organizations_url":"https://api.github.com/users/quinot/orgs","repos_url":"https://api.github.com/users/quinot/repos","events_url":"https://api.github.com/users/quinot/events{/privacy}","received_events_url":"https://api.github.com/users/quinot/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-03-04T07:22:54Z","updated_at":"2015-03-17T15:16:05Z","closed_at":"2015-03-11T00:11:14Z","body":"there are 2 points here:\r\n\r\n1. having the '/' character as part of the context name is not so 'beautiful'\r\n\r\nFor examples as in  ldap_lookup_config/hosts or ldap_lookup_config/group_members_cn\r\nthis is because the '/' is used for file path on Linux or is very uncommon in variable names\r\n\r\n2. do not assume the existence or the need to declared 'ldap_lookup_config' variable\r\n    and have a simpler way to pass the needed information to the plugin\r\n   the required info could be any yaml dictionary:\r\nthe ldap url  and a context specifying the base  the value to get, filter etc...\r\n\r\nthis requires more thoughts but something along:\r\n\r\n  vars:\r\n    # Default context\r\n    ldap_url: 'ldap://ldap.example.com'\r\n\r\n    # A context    # List all users, skip jpegPhoto\r\n    user_nophoto:\r\n      base: ou=People,dc=example,dc=com\r\n      value:\r\n        - jpegPhoto: skip=True\r\n      filter: (uid={{ term }})\r\n\r\n\r\n  tasks:\r\n    - name: Display one user, no photo\r\n      debug: msg=\"User {{ item }}\"\r\n      with_ldap:\r\n        - url: ldap_url\r\n        - context: user_nophoto \r\n        - johndoe\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/quinot/ansible-plugin-lookup_ldap/issues/comments/82403801","html_url":"https://github.com/quinot/ansible-plugin-lookup_ldap/issues/3#issuecomment-82403801","issue_url":"https://api.github.com/repos/quinot/ansible-plugin-lookup_ldap/issues/3","id":82403801,"user":{"login":"PhilEv","id":3406687,"avatar_url":"https://avatars.githubusercontent.com/u/3406687?v=3","gravatar_id":"","url":"https://api.github.com/users/PhilEv","html_url":"https://github.com/PhilEv","followers_url":"https://api.github.com/users/PhilEv/followers","following_url":"https://api.github.com/users/PhilEv/following{/other_user}","gists_url":"https://api.github.com/users/PhilEv/gists{/gist_id}","starred_url":"https://api.github.com/users/PhilEv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PhilEv/subscriptions","organizations_url":"https://api.github.com/users/PhilEv/orgs","repos_url":"https://api.github.com/users/PhilEv/repos","events_url":"https://api.github.com/users/PhilEv/events{/privacy}","received_events_url":"https://api.github.com/users/PhilEv/received_events","type":"User","site_admin":false},"created_at":"2015-03-17T15:16:04Z","updated_at":"2015-03-17T15:16:04Z","body":"I was expecting  to have a task failed instead of a FATAL (so that can be\ntrapped or ignored) and not abor the whole playbook\nBut you are probably right.\n\n\n\n2015-03-17 13:01 GMT+01:00 Thomas Quinot <notifications@github.com>:\n\n> Not sure what else you'd expect. If the user requests an LDAP lookup\n> within a non-existent context, there's not much we can do besides reporting\n> the error, which is easy enough to fix.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/quinot/ansible-plugin-lookup_ldap/issues/3#issuecomment-82306654>\n> .\n>\n"}}