You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use the infra.ah_configuration.ah_api plugin to retrieve the number of collections in a certain collection repository. So the code for this is:
- name: Print the number of rh-certified collections
ansible.builtin.debug:
msg: "{{ query('infra.ah_configuration.ah_api', 'collections', 'repository=rh_certified', 'host=https://' + ah_hostname, 'username=' + ah_username, 'password=' + ah_password) }}"
However running this playbook always results in an error:
TASK [handle_collections : Print the number of rh-certified collections] ***
Sunday 15 October 2023 19:02:03 +0000 (0:00:03.204) 0:00:07.659 ********
fatal: [hub]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'infra.ah_configuration.ah_api'. Error was a <class 'AttributeError'>, original message: 'AHAPIModule' object has no attribute '_debug'. 'AHAPIModule' object has no attribute '_debug'"}
I changed the parameters to match the exact examples, but always get this AHAPImodule error. Is there a prerequisite that I'm not aware of, or is the code really broken?
It was my bad - I can close this issue. I should not have put the "'host=https://' + ah_hostname, 'username=' + ah_username, 'password=' + ah_password" between quotes.
So correct syntax here was:
__rh_certified: {{ lookup('infra.ah_configuration.ah_api', 'collections', 'rh-certified', host=ah_hostname, username=ah_username, password=ah_password, return_all=true) }}
Summary
I am trying to use the infra.ah_configuration.ah_api plugin to retrieve the number of collections in a certain collection repository. So the code for this is:
However running this playbook always results in an error:
I changed the parameters to match the exact examples, but always get this AHAPImodule error. Is there a prerequisite that I'm not aware of, or is the code really broken?
Issue Type
Ansible, Collection, Private Automation Hub details
OS / ENVIRONMENT
Target OS: Red Hat Enterprise Linux 8 (part of Ansible Automation Platform 2.4 installation)
Desired Behavior
I would like to retrieve information from my Automation Hub for further use\
Actual Behavior
I always get the error
Error was a <class 'AttributeError'>, original message: 'AHAPIModule' object has no attribute '_debug'.
Please give some details of what is actually happening.
Include a [minimum complete verifiable example] with:
STEPS TO REPRODUCE
The text was updated successfully, but these errors were encountered: