Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update aap credential injectors #55

Open
wants to merge 3 commits into
base: devel
Choose a base branch
from

Conversation

sean-m-sullivan
Copy link
Contributor

@sean-m-sullivan sean-m-sullivan commented Nov 10, 2024

Update the injectors for the AAP credential type to work across collections

Related PR's:

@willtome
Copy link

I ran into the issue as well. Very frustrating and needs to be fixed

'aap_token': '{{oauth_token}}',
'aap_request_timeout': '{{request_timeout}}',
'aap_validate_certs': '{{verify_ssl}}',
'ah_path_prefix': '{{ah_path_prefix}}',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra_vars never did anything. That's why they were never put in the injectors before. These appears to correspond to the module arguments, but that implies a syntax like aap_hostname: "{{ aah_hostname }}" used in your playbook. This is far from obvious, and I'm not convinced it's useful. It would be very undocumented. Very hard to document.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were writing a blog post on it, but if we just document they are avail, or make them avail, people can use them in places to connect, or use for the lokup plugin or other uses. We shouldn't limite HOW they are used just make them available for the base credential type. I and probably everyone using the validated for a while have also been using custom, just trying to take the standard custom and bring it into the fold.

'default': 'galaxy',
'help_text': gettext_noop(
'API path used to access the Hub api. Either galaxy, '
'or custom. By default it should be galaxy',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either galaxy or custom

I've never seen this. I can't find it anywhere in AWX. I would ask Hub engineers what the intent is... but this is the "controller" credential type. It doesn't add up to me.

Copy link
Contributor Author

@sean-m-sullivan sean-m-sullivan Dec 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's https://10.242.42.153/api/galaxy/

I just checked, in 2.4 it was customizable in the installer through an obscure variable, with 2.5 it looks like it was hardcoded.

I've removed this entry.

'AAP_PASSWORD': '{{password}}',
'AAP_VALIDATE_CERTS': '{{verify_ssl}}',
'AAP_TOKEN': '{{oauth_token}}',
'AAP_REQUEST_TIMEOUT': '{{request_timeout}}',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These seem fine up to this point.

Copy link

@willtome willtome Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will TOWER_HOST, CONTROLLER_HOST, and AAP_HOSTNAME ever need to be different?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is the point. Using CONTROLLER_HOST by itself is using direct API access to the controller host, meaning, you are not going through the proxy. That way of accessing controller is deprecated (exactly the meaning of that word, I'm not the one to ask), so we want to be moving away from that.

However, this change is allowing to use the address of the proxy host. I think @chrismeyersfsu might have expressed a sentiment that this should be a separate type, and there is some validity to that. Ultimately, if we want existing credentials to "just work", we may need some code-level solution to this so that it inspects the response headers or something to determine which it was given, because this is expected to affect the API path that has to be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@willtome You can point controller_host at the gateway and things work, I tested this all against a gateway 2.5 address like a customer should be doing, The variable itself doesn't care about proxy, endpoint, etc etc. From what I've tested awx.awx against a 2.5 AAP will not work as it does not do the api translation correctly, however ansible.controller collection does. Technically with upstream it could just be Device FQDN, but we have to call it something, and the user relies on the collection to know the difference and know better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants