Ansible collection and ansible-galaxy

Error trying to download a collection through ansible-galaxy linked to foreman repository.
It miss “https://” in the url used by api.
Used the same command on a direct internet access without problem
I modified the “” file to add https:// at the beginning of url, and it works.
Don’t know if the problem is on my foreman configuration, a bug or another problem

Expected outcome:
Download and installation of collection

Foreman and Proxy versions:
Foreman 3.3.0

Foreman and Proxy plugin versions:

Distribution and version:
Foreman 3.3.0
Katello 4.5.0
RockyLinux 8.6

Other relevant data:
`[root@MyServer tmp]# ansible-galaxy collection install -r requirements.yml -vvv
ansible-galaxy 2.9.27
config file = /etc/ansible/ansible.cfg
configured module search path = [’/root/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible-galaxy
python version = 3.6.8 (default, Apr 12 2022, 06:55:39) [GCC 8.5.0 20210514 (Red Hat 8.5.0-10)]
Using /etc/ansible/ansible.cfg as config file
Reading requirement file at ‘/tmp/requirements.yml’
Process install dependency map
Processing requirement collection ‘ovirt.ovirt’
Collection ‘ovirt.ovirt’ obtained from server explicit_requirement_ovirt.ovirt
Starting collection install process
Installing ‘ovirt.ovirt:2.2.3’ to ‘/root/.ansible/collections/ansible_collections/ovirt/ovirt’
Downloading to /root/.ansible/tmp/ansible-local-491082kz6spy92/tmpo4uu0e5p
ERROR! Unexpected Exception, this is probably a bug: unknown url type: ‘
the full traceback was:

Traceback (most recent call last):
File “/usr/bin/ansible-galaxy”, line 123, in
exit_code =
File “/usr/lib/python3.6/site-packages/ansible/cli/”, line 374, in run
File “/usr/lib/python3.6/site-packages/ansible/cli/”, line 850, in execute_install
no_deps, force, force_deps)
File “/usr/lib/python3.6/site-packages/ansible/galaxy/”, line 470, in install_collections
collection.install(output_path, b_temp_path)
File “/usr/lib/python3.6/site-packages/ansible/galaxy/”, line 166, in install
File “/usr/lib/python3.6/site-packages/ansible/galaxy/”, line 923, in _download_file
unredirected_headers=[‘Authorization’], http_agent=user_agent())
File “/usr/lib/python3.6/site-packages/ansible/module_utils/”, line 1390, in open_url
File “/usr/lib/python3.6/site-packages/ansible/module_utils/”, line 1264, in open
request = RequestWithMethod(url, method, data)
File “/usr/lib/python3.6/site-packages/ansible/module_utils/”, line 643, in init
urllib_request.Request.init(self, url, data, headers, origin_req_host, unverifiable)
File “/usr/lib64/python3.6/urllib/”, line 329, in init
self.full_url = url
File “/usr/lib64/python3.6/urllib/”, line 355, in full_url
File “/usr/lib64/python3.6/urllib/”, line 384, in _parse
raise ValueError(“unknown url type: %r” % self.full_url)
ValueError: unknown url type: ‘
[root@MyServer tmp]#`

Thanks for the report!

I can reproduce it here on my system.

$ curl -k --silent '' | python -m json.tool  | grep download_url
    "download_url": "",

I see!

The problem is that /etc/pulp/ is missing https:// in front of ANSIBLE_API_HOSTNAME. Once I changed that (in my case it now reads: ANSIBLE_API_HOSTNAME = "") and restarted the pulpcore-api service, things started to work as expected.

I’ve opened Bug #35390: pulp_ansible API is wrongly configured, leading to uninstallable content - Installer - Foreman and to fix it properly in the installer.


Thanks @evgeni

I applied your modification and restarted the service.
Work perfectly now.
So wait for the correction in the future release.
Have a good day and weekend.