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

object_diff role doesn't support TOWER_x en var for authentication #626

Closed
nodje opened this issue Jun 15, 2023 · 3 comments
Closed

object_diff role doesn't support TOWER_x en var for authentication #626

nodje opened this issue Jun 15, 2023 · 3 comments
Labels
bug Something isn't working filetree/object_diff new New issue, this should be removed once reviewed

Comments

@nodje
Copy link

nodje commented Jun 15, 2023

Tested version: 2.3.1

See #619

Also even if controller_hostname, controller_oauthtoken, controller_validate_certs are provided, in some situation controller_username can also be expected.

TASK [redhat_cop.controller_configuration.object_diff : Get the current controller user to determine if it is super-admin] ***
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'controller_username' is undefined. 'controller_username' is undefined\n\nThe error appears to be in '/runner/requirements_collections/ansible_collections/redhat_cop/controller_configuration/roles/object_diff/tasks/teams.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: \"Get the current controller user to determine if it is super-admin\"\n  ^ here\n"}

It should be possible to get the user corresponding to the provided oauthtoken from the EP api/v2/me

@nodje nodje added bug Something isn't working new New issue, this should be removed once reviewed labels Jun 15, 2023
@adonisgarciac
Copy link
Contributor

Can you try to define the variable?:

    controller_username: "{{ lookup('ansible.builtin.env', 'CONTROLLER_USERNAME') }}"

@nodje
Copy link
Author

nodje commented Jun 21, 2023

Hi Adonis,

I sure can but I haven't defined CONTROLLER_USERNAME as I use an oauth_token for authentification.

I think it's an issue to have to define both.
The default behaviour of ansible.controller is to be able to pick whichever comes, controller_oauthotken OR controller_username+controller_password

adonisgarciac added a commit to automationiberia/infra.aap_configuration that referenced this issue Jun 23, 2023
@github-actions github-actions bot added the inactive No movement has happened in 30 days label Jul 22, 2023
@adonisgarciac
Copy link
Contributor

I think this issue can be closed. @djdanielsson @sean-m-sullivan

@github-actions github-actions bot removed the inactive No movement has happened in 30 days label Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working filetree/object_diff new New issue, this should be removed once reviewed
Projects
None yet
Development

No branches or pull requests

3 participants