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

Cannot import roles from GitHub Organzation with different user than the one in the organization namespace. #3363

Closed
varnishsoftware opened this issue Jun 17, 2024 · 6 comments

Comments

@varnishsoftware
Copy link

Bug Report

SUMMARY

We have logged in in Ansible Galaxy using the user @varnishsoftware, which has access to our GitHub organization https://github.com/varnish.

We have requested a varnish namespace, which has been created for us to be managed by @varnishsoftware GitHub user in this issue #3362

We want to use the @varnishsoftware user to import roles into varnish namespace from our GitHub Org repositories.
Ansible Galaxy forms the clone url using the user varnishsoftware(https://github.com/varnishsoftware/) and the clone fails of course, because the organization namespace is varnish, and not varnishsoftware.

CLI for importing has no options to change the clone url.
How can we achieve this? I suppose we are not the first ones requesting this, but we couldn't find any info in Ansible Galaxy docs.

Local ansible and ansible-galaxy version details:

ansible [core 2.17.0]
ansible-galaxy [core 2.17.0]
  config file = None
  python version = 3.12.4 (main, Jun  6 2024, 18:26:44) [Clang 15.0.0 (clang-1500.3.9.4)] 
  jinja version = 3.1.4
  libyaml = True
STEPS TO REPRODUCE
ansible-galaxy role import --api-key <REDACTED> varnish ansible-role-varnish-cache --role-name varnish-cache
ansible-galaxy role import --api-key <REDACTED> varnishsoftware ansible-role-varnish-cache --role-name varnish-cache
EXPECTED RESULTS

We would expect that it would be possible to import roles with a different user than the organization namespace one.

ACTUAL RESULTS

Import fails

#### Import using varnish (org namespace)will fail as the username is the org namespace and does not exist:
##################################################################################


ansible-galaxy role import --api-key <REDACTED> varnish ansible-role-varnish-cache --role-name varnish-cache
Successfully submitted import request 2077679198302395257752346447180680240
Starting import: task_id=2077679198302395257752346447180680240, pulp_id=0190257e-4a44-7571-b953-01a6367f4c30

==== PARAMETERS ====
importer username: varnishsoftware
matched user: varnishsoftware id:24725
github_user: varnish
github_repo: ansible-role-varnish-cache
github_reference: None
alternate_clone_url: None
alternate_namespace_name: None
alternate_role_name: varnish-cache

==== CHECK FOR MATCHING ROLE(S) ====
user:varnish repo:ansible-role-varnish-cache did not match any existing roles

===== CLONING REPO =====
cloning https://github.com/varnish/ansible-role-varnish-cache ...
cloning failed: Cloning into '/tmp/tmpwbqvjo59/ansible-role-varnish-cache'...
fatal: could not read Username for 'https://github.com': terminal prompts disabled


#### Import using varnishsoftware will fail as the username is used to create the clone url:
###################################################################


ansible-galaxy role import --api-key <REDACTED> varnishsoftware ansible-role-varnish-cache --role-name varnish-cache
Successfully submitted import request 2077679273391212899680576883024351274
Starting import: task_id=2077679273391212899680576883024351274, pulp_id=0190257f-3ce4-7912-8fad-ce28faae502a

==== PARAMETERS ====
importer username: varnishsoftware
matched user: varnishsoftware id:24725
github_user: varnishsoftware
github_repo: ansible-role-varnish-cache
github_reference: None
alternate_clone_url: None
alternate_namespace_name: None
alternate_role_name: varnish-cache

==== CHECK FOR MATCHING ROLE(S) ====
user:varnishsoftware repo:ansible-role-varnish-cache did not match any existing roles

===== CLONING REPO =====
cloning https://github.com/varnishsoftware/ansible-role-varnish-cache ...
cloning failed: Cloning into '/tmp/tmp6odfmzgs/ansible-role-varnish-cache'...
fatal: could not read Username for 'https://github.com': terminal prompts disabled
@francomile
Copy link

Can you please provide any feedback on this ticket please?

@gquintard
Copy link

bump?

@epacific1
Copy link

We are reviewing this issue and will get back to you with some further details.
Appreciate the patience :-)

@epacific1
Copy link

Hi,
For the best help with this issue, it would be advisable to post here: https://forum.ansible.com/
This specific repo open issues is used for namespace creations.
Over at the Ansible Forum, you will be able to get the help you need.
Apologies for the delayed response.

@francomile
Copy link

I don't understand why this issue is closed without a proper answer for this rather common request.
How are gitHub orgs uploading their roles to Galaxy without an user with same namespace. This should be well explained in the Galaxy documentation instead of redirecting users to Ansible Forums where people should be asking the same questions over and over, no?

@epacific1
Copy link

The Ansible Galaxy forum is the most appropriate place to ask questions related to Galaxy, as galaxy/issues is no longer actively monitored since the move to galaxy_ng in October 2023. The developers for Ansible Galaxy monitor the forum more actively, as do the documentation team, so they are better positioned to provide you with the right information and discuss your suggestions.

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

No branches or pull requests

4 participants