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
This issue has been found in a published version of this role/collection and confirmed against the devel branch.
Summary
The infra.aap_configuration.hub_namespace role, when used via infra.aap_configuration.dispatch, ignores the ah_token variable and relies entirely on aap_token instead.
This may affect infra.aap_configuration.hub_namespace when used directly as well -- I have not tested this yet.
All Hub roles should prefer ah_token to aap_token. More generally, they should prefer ah_* to aap_* variables.
Actual Behavior
I have a playbook that defines multiple objects to create on AAP such as Gateway organizations, Gateway teams, Controller projects, Controller inventories, and also Hub namespaces. Only the Hub objects fail to be created and this is because of the role using aap_token for authentication against Hub, rather than using ah_token.
The playbook is pasted below:
This is because the token to be used here is an Automation Hub token, not a Gateway token.
However, the hub_namespace role ignores the ah_token variable and attempts to use aap_token instead, which naturally fails because aap_token is a Gateway token, not a Hub token.
If I pass the correct Hub token in the aap_token, then all tasks fail but the Hub task succeeds.
If I modify the hub_namespaces role source code (I can submit a PR with my changes) then I can get it to prefer ah_token if it exists, and then all roles in my playbook succeed.
The changes that allow the hub_namespace to prefer ah_token to aap_token can be viewed at devel...phess:infra.aap_configuration:devel but they are minimal and target the ah_token variable only, but I believe a more proper solution is to have all ah_* variables take precedence against aap_* variables.
Please let me know if a PR where the same logic is applied to all ah_* variables would be desirable.
The text was updated successfully, but these errors were encountered:
phess
added
bug
Something isn't working
new
New issue, this should be removed once reviewed
labels
Feb 17, 2025
This issue has been found in a published version of this role/collection and confirmed against the devel branch.
Summary
The infra.aap_configuration.hub_namespace role, when used via infra.aap_configuration.dispatch, ignores the
ah_token
variable and relies entirely onaap_token
instead.This may affect infra.aap_configuration.hub_namespace when used directly as well -- I have not tested this yet.
Issue Type
Ansible, Collection, Controller details
OS / ENVIRONMENT
Controller: Fedora Workstation 41 x86_64
Target: RHEL 9.4 running AAP Gateway 2.5.20250115 and RHEL 9.4 running Hub 4.10.1.
Desired Behavior
All Hub roles should prefer
ah_token
toaap_token
. More generally, they should preferah_*
toaap_*
variables.Actual Behavior
I have a playbook that defines multiple objects to create on AAP such as Gateway organizations, Gateway teams, Controller projects, Controller inventories, and also Hub namespaces. Only the Hub objects fail to be created and this is because of the role using
aap_token
for authentication against Hub, rather than usingah_token
.The playbook is pasted below:
I run this playbook with:
The hub task fails with a credentials issue, namely
Invalid Automation Hub authentication credentials for api/galaxy/v3/namespaces/ (HTTP 401)
:This is because the token to be used here is an Automation Hub token, not a Gateway token.
However, the hub_namespace role ignores the
ah_token
variable and attempts to useaap_token
instead, which naturally fails becauseaap_token
is a Gateway token, not a Hub token.If I pass the correct Hub token in the
aap_token
, then all tasks fail but the Hub task succeeds.If I modify the
hub_namespaces
role source code (I can submit a PR with my changes) then I can get it to preferah_token
if it exists, and then all roles in my playbook succeed.STEPS TO REPRODUCE
This minimal playbook works as a reproducer:
The changes that allow the hub_namespace to prefer
ah_token
toaap_token
can be viewed at devel...phess:infra.aap_configuration:devel but they are minimal and target theah_token
variable only, but I believe a more proper solution is to have allah_*
variables take precedence againstaap_*
variables.Please let me know if a PR where the same logic is applied to all
ah_*
variables would be desirable.The text was updated successfully, but these errors were encountered: