##### SUMMARY

Ansible galaxy collection installation in command line fails when parameter is an URL.

```Shell
ansible-galaxy collection install http://repo.company.com/ansible-collection/my_namespace-my_collection-0.1.tar.gz
Process install dependency map
ERROR! Invalid collection name 'http', name must be in the format <namespace>.<collection>.
```

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME

**ansible-galaxy**

*collection_name* as url parameter should be supported according the documentation:

```Shell
ansible-galaxy collection install -h

positional arguments:
  collection_name       The collection(s) name or path/url to a tar.gz
                        collection artifact. This is mutually exclusive with
                        --requirements-file.
```

##### ANSIBLE VERSION

```
ansible 2.9.1
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/ubuntu/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /tmp/venv-project/local/lib/python2.7/site-packages/ansible
  executable location = /tmp/venv-project/bin/ansible
  python version = 2.7.15+ (default, Oct  7 2019, 17:39:04) [GCC 7.4.0]
```

##### CONFIGURATION

```
DEFAULT_VAULT_PASSWORD_FILE(env: ANSIBLE_VAULT_PASSWORD_FILE) = /home/ubuntu/.ansible/.vault-dev.txt
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False
```

##### OS / ENVIRONMENT

OS : Ubuntu. Ansible usage via native *apt* package or *pip*.

##### STEPS TO REPRODUCE

Create some ansible collection and publish/upload it on some http endpoint: `http://repo.company.com/ansible-collection/my_namespace-my_collection-0.1.tar.gz`

Installation via local file is working fine (=> collection package is correct):
```Shell
rm -rf ~/.ansible/collections/
wget http://repo.company.com/ansible-collection/my_namespace-my_collection-0.1.tar.gz
ansible-galaxy collection install my_namespace-my_collection-0.1.tar.gz

Process install dependency map
Starting collection install process
Installing 'my_namespace-my_collection:0.1-SNAPSHOT' to '/home/ubuntu/.ansible/collections/ansible_collections/my_namespace/my_collection'
```

Installation via [requirement file](https://docs.ansible.com/ansible/latest/galaxy/user_guide.html#install-multiple-collections-with-a-requirements-file) (like #61680) is working fine too:

With `requirements.yml`:

```YAML
---
collections:
- name: http://repo.company.com/ansible-collection/my_namespace-my_collection-0.1.tar.gz
```

```Shell
rm -rf ~/.ansible/collections/
ansible-galaxy collection install -r requirements.yml

Process install dependency map
Starting collection install process
Installing 'my_namespace-my_collection:0.1-SNAPSHOT' to '/home/ubuntu/.ansible/collections/ansible_collections/my_namespace/my_collection'
```

But using command line installation fails:

```Shell
rm -rf ~/.ansible/collections/
ansible-galaxy collection install http://repo.company.com/ansible-collection/my_namespace-my_collection-0.1.tar.gz
Process install dependency map
ERROR! Invalid collection name 'http', name must be in the format <namespace>.<collection>.
```

##### EXPECTED RESULTS

```Shell
Installing 'my_namespace-my_collection:0.1-SNAPSHOT' to '/home/ubuntu/.ansible/collections/ansible_collections/my_namespace/my_collection'
```

##### ACTUAL RESULTS

```Shell
ERROR! Invalid collection name 'http', name must be in the format <namespace>.<collection>.
```

mock_install = MagicMock()
    monkeypatch.setattr(ansible.cli.galaxy, 'install_collections', mock_install)
    mock_warning = MagicMock()
    monkeypatch.setattr(ansible.utils.display.Display, 'warning', mock_warning)
    output_dir = to_text((tmp_path_factory.mktemp('test-ÅÑŚÌβŁÈ Output')))
    yield mock_install, mock_warning, output_dir
def test_collection_install_with_names(collection_install):
    mock_install, mock_warning, output_dir = collection_install
    galaxy_args = ['ansible-galaxy', 'collection', 'install', 'namespace.collection', 'namespace2.collection:1.0.1',
                   '--collections-path', output_dir]
    GalaxyCLI(args=galaxy_args).run()
    collection_path = os.path.join(output_dir, 'ansible_collections')
    assert os.path.isdir(collection_path)
    assert mock_warning.call_count == 1
    assert "The specified collections path '%s' is not part of the configured Ansible collections path" % output_dir \
        in mock_warning.call_args[0][0]
    assert mock_install.call_count == 1
    assert mock_install.call_args[0][0] == [('namespace.collection', '*', None),
                                            ('namespace2.collection', '1.0.1', None)]
    assert mock_install.call_args[0][1] == collection_path
    assert len(mock_install.call_args[0][2]) == 1
    assert mock_install.call_args[0][2][0].api_server == 'https://galaxy.ansible.com'
    assert mock_install.call_args[0][2][0].validate_certs is True
    assert mock_install.call_args[0][3] is True
    assert mock_install.call_args[0][4] is False
    assert mock_install.call_args[0][5] is False
    assert mock_install.call_args[0][6] is False
    assert mock_install.call_args[0][7] is False
def test_collection_install_with_requirements_file(collection_install):