<!--- Verify first that your issue is not already reported on GitHub -->
<!--- Also test if the latest release and devel branch are affected too -->
<!--- Complete *all* sections as described, this form is processed automatically -->

##### SUMMARY
Modules that I create inside collections that exist in the `ansible` namespace do not work.

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME
ansible-galaxy
collections

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```
ansible 2.9.0.dev0
  config file = None
  configured module search path = ['/home/meyers/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/meyers/ansible/virtualenv/ansible-dev3/local/lib/python3.7/site-packages/ansible
  executable location = /home/meyers/ansible/virtualenv/ansible-dev3/bin/ansible
  python version = 3.7.3 (default, Apr  3 2019, 05:39:12) [GCC 8.3.0]
```

##### CONFIGURATION
blank

##### OS / ENVIRONMENT
<!--- Provide all relevant information below, e.g. target OS versions, network device firmware, etc. -->


##### STEPS TO REPRODUCE
<!--- Describe exactly how to reproduce the problem, using a minimal test-case -->
* Create two adjacent collections `a.foo` and `ansible.foo` w/ a single module, `my_test.py`.
* Call the module via `ansible.foo.my_test` and `a.foo.my_test`

<!--- Paste example playbooks or commands between quotes below -->
`collections/ansible_collections/ansible/foo/plugins/modules/my_test.py`

```yaml
# my_test.py
#!/usr/bin/python

# Copyright: (c) 2018, Terry Jones <terry.jones@example.org>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

ANSIBLE_METADATA = {
    'metadata_version': '1.1',
    'status': ['preview'],
    'supported_by': 'community'
}

DOCUMENTATION = '''
---
module: my_test
short_description: This is my test module
version_added: "2.4"
description:
    - "This is my longer description explaining my test module"
options:
    name:
        description:
            - This is the message to send to the test module
        required: true
    new:
        description:
            - Control to demo if the result of this module is changed or not
        required: false

extends_documentation_fragment:
    - azure
author:
    - Your Name (@yourhandle)
'''

EXAMPLES = '''
# Pass in a message
- name: Test with a message
  my_test:
    name: hello world

# pass in a message and have changed true
- name: Test with a message and changed output
  my_test:
    name: hello world
    new: true

# fail the module
- name: Test failure of the module
  my_test:
    name: fail me
'''

RETURN = '''
original_message:
    description: The original name param that was passed in
    type: str
    returned: always
message:
    description: The output message that the test module generates
    type: str
    returned: always
'''

from ansible.module_utils.basic import AnsibleModule

def run_module():
    # define available arguments/parameters a user can pass to the module
    module_args = dict(
        name=dict(type='str', required=True),
        new=dict(type='bool', required=False, default=False)
    )

    # seed the result dict in the object
    # we primarily care about changed and state
    # change is if this module effectively modified the target
    # state will include any data that you want your module to pass back
    # for consumption, for example, in a subsequent task
    result = dict(
        changed=False,
        original_message='',
        message=''
    )

    # the AnsibleModule object will be our abstraction working with Ansible
    # this includes instantiation, a couple of common attr would be the
    # args/params passed to the execution, as well as if the module
    # supports check mode
    module = AnsibleModule(
        argument_spec=module_args,
        supports_check_mode=True
    )

    # if the user is working with this module in only check mode we do not
    # want to make any changes to the environment, just return the current
    # state with no modifications
    if module.check_mode:
        module.exit_json(**result)

    # manipulate or modify the state as needed (this is going to be the
    # part where your module will do what it needs to do)
    result['original_message'] = module.params['name']
    result['message'] = 'goodbye'

    # use whatever logic you need to determine whether or not this module
    # made any modifications to your target
    if module.params['new']:
        result['changed'] = True

    # during the execution of the module, if there is an exception or a
    # conditional state that effectively causes a failure, run
    # AnsibleModule.fail_json() to pass in the message and the result
    if module.params['name'] == 'fail me':
        module.fail_json(msg='You requested this to fail', **result)

    # in the event of a successful module execution, you will want to
    # simple AnsibleModule.exit_json(), passing the key/value results
    module.exit_json(**result)

def main():
    run_module()

if __name__ == '__main__':
    main()

```

```yaml
# main.yml
- hosts: localhost
  gather_facts: false
  tasks:
    - ansible.foo.my_test:
        name: "hello world"
    - a.foo.my_test:
        name: "hello world"
```

Copy the ansible subdir into a.
```
.
├── collections
│   └── ansible_collections
│       ├── a
│       │   └── foo
│       │       └── plugins
│       │           └── modules
│       │               └── my_test.py
│       └── ansible
│           └── foo
│               └── plugins
│                   └── modules
│                       └── my_test.py
└── main.yml
```

<!--- HINT: You can paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
* For both `ansible.foo.my_test` and `a.foo.my_test` to succeed.


##### ACTUAL RESULTS
* `ansible.foo.my_test` fails because the module can not be found (see below)

<!--- Paste verbatim command output between quotes -->
```
ERROR! no action detected in task. This often indicates a misspelled module name, or incorrect module path.

The error appears to be in '/home/meyers/ansible/ansible-examples/collection_ansible_namespace/main.yml': line 4, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

  tasks:
    - ansible.foo.my_test:
```

:return: collection name or None
    """
    n_collection_paths = [to_native(os.path.realpath(to_bytes(p))) for p in AnsibleCollectionLoader().n_collection_paths]
    b_path = os.path.realpath(to_bytes(path))
    n_path = to_native(b_path)
    for coll_path in n_collection_paths:
        common_prefix = to_native(os.path.commonprefix([b_path, to_bytes(coll_path)]))
        if common_prefix == coll_path:
            
            collection_remnant = n_path[len(coll_path):]
            
            if collection_remnant[0] != '/':
                collection_remnant = '/' + collection_remnant
            
            found_collection = _N_COLLECTION_PATH_RE.search(collection_remnant)
            if not found_collection:
                continue
            n_collection_name = '{0}.{1}'.format(*found_collection.groups())
            loaded_collection_path = AnsibleCollectionLoader().get_collection_path(n_collection_name)
            if not loaded_collection_path:
                return None
            
            b_loaded_collection_path = os.path.dirname(os.path.realpath(to_bytes(loaded_collection_path)))
            
            if os.path.commonprefix([b_path, b_loaded_collection_path]) == b_loaded_collection_path:
                return n_collection_name
            return None  
def set_collection_playbook_paths(b_playbook_paths):
    AnsibleCollectionLoader().set_playbook_paths(b_playbook_paths)