{"action":"opened","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/11815","labels_url":"https://api.github.com/repos/ansible/ansible/issues/11815/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/11815/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/11815/events","html_url":"https://github.com/ansible/ansible/issues/11815","id":98360622,"number":11815,"title":"lookup_plugins appearing alongside playbook not found","user":{"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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-31T10:20:08Z","updated_at":"2015-07-31T10:20:08Z","closed_at":null,"body":"According to the documentation, \" plugins can be shipped in a subdirectory relative to a top-level playbook\", and this used to work in v1.\r\n\r\nWith v2 however, this does not work (at least for lookup_plugins) unless the \"lookup_plugins\" subdirectory is explicitly mentioned in ansible.cfg.\r\n\r\n```\r\n$ mkdir lookup_plugins\r\n$ cp $ANSIBLE_ROOT/lib/ansible/plugins/lookup/items.py lookup_plugins/myitems\r\n$ cat test_lookup_pl.yml \r\n---\r\n- hosts: localhost\r\n  tasks:\r\n    - name: Print items from custom lookup plugin\r\n      debug: msg=\"Item= {{ item }} \"\r\n      with_myitems:\r\n        - foo\r\n        - bar\r\n$ ansible-playbook test_lookup_pl.yml\r\nPLAY ****************************************************************************\r\n\r\nTASK [setup] ********************************************************************\r\nok: [localhost]\r\n\r\nTASK [Print items from custom lookup plugin] ************************************\r\nfatal: [localhost]: FAILED! => {\"failed\": true, \"msg\": \"ERROR! the field 'args' has an invalid value, which appears to include a variable that is undefined. The error was: 'item' is undefined\"}\r\n\r\nPLAY RECAP **********************************************************************\r\nlocalhost                  : ok=1    changed=0    unreachable=0    failed=1   \r\n\r\n\r\nNow if I create an ansible.cfg file:\r\n$ cat ansible.cfg\r\n[defaults]\r\nlookup_plugins=./lookup_plugins\r\n\r\n$ ansible-playbook test_lookup_pl.yml\r\nPLAY ****************************************************************************\r\n\r\nTASK [setup] ********************************************************************\r\n\r\nok: [localhost]\r\n\r\nTASK [Print items from custom lookup plugin] ************************************\r\nok: [localhost] => (item=foo) => {\r\n    \"item\": \"foo\", \r\n    \"msg\": \"Item= foo \"\r\n}\r\nok: [localhost] => (item=bar) => {\r\n    \"item\": \"bar\", \r\n    \"msg\": \"Item= bar \"\r\n}\r\nok: [localhost]\r\n\r\nPLAY RECAP **********************************************************************\r\nlocalhost                  : ok=2    changed=0    unreachable=0    failed=0   \r\n```"}}