Dynamic inventory sync from Red Hat Satellite 6 fails with error 403 Client Error: Forbidden for url: on Ansible Automation Platform

Solution Verified - Updated -

Issue

  • Dynamic inventory sync from Red Hat Satellite 6 fails with the below-mentioned error on Ansible Automation Platform 2.x.


    [WARNING]: * Failed to parse /runner/inventory/foreman.yml with auto plugin: 403 Client Error: Forbidden for url: https://aap.example.com//api/v2/hosts?page=1&per_page=250 File "/usr/lib/python3.11/site-packages/ansible/inventory/manager.py", line 293, in parse_source plugin.parse(self._inventory, self._loader, source, cache=cache) File "/usr/lib/python3.11/site-packages/ansible/plugins/inventory/auto.py", line 59, in parse plugin.parse(inventory, loader, path, cache=cache) File "/usr/share/ansible/collections/ansible_collections/redhat/satellite/plugins/inventory/foreman.py", line 671, in parse self._populate() File "/usr/share/ansible/collections/ansible_collections/redhat/satellite/plugins/inventory/foreman.py", line 425, in _populate self._populate_report_api() File "/usr/share/ansible/collections/ansible_collections/redhat/satellite/plugins/inventory/foreman.py", line 460, in _populate_report_api self._populate_host_api() File "/usr/share/ansible/collections/ansible_collections/redhat/satellite/plugins/inventory/foreman.py", line 578, in _populate_host_api for host in self._get_hosts(): ^^^^^^^^^^^^^^^^^ File "/usr/share/ansible/collections/ansible_collections/redhat/satellite/plugins/inventory/foreman.py", line 297, in _get_hosts return self._get_json(url, params=params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/share/ansible/collections/ansible_collections/redhat/satellite/plugins/inventory/foreman.py", line 248, in _get_json ret.raise_for_status() File "/usr/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) [WARNING]: Unable to parse /runner/inventory/foreman.yml as an inventory source ERROR! No inventory was parsed, please check your configuration and options.

Environment

  • Ansible Automation Platform 2.x
  • Red Hat Satellite 6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content