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

role_name is not used when installing from Git #939

Closed
pdesgarets opened this issue Jul 20, 2018 · 2 comments
Closed

role_name is not used when installing from Git #939

pdesgarets opened this issue Jul 20, 2018 · 2 comments

Comments

@pdesgarets
Copy link
Contributor

Bug Report

SUMMARY

I want to use a custom role name, that is not the name of the repo. So I use role_name as explained here

STEPS TO REPRODUCE
  • ansible-galaxy init my-role
  • add role_name: custom-name in galaxy_info in meta/main.yml
  • push the role to a Git server
  • install with ansible-galaxy install git+https://...
EXPECTED RESULTS

role is available as custom-name in the playbooks

ACTUAL RESULTS

role is available as my-role wich is the repo's name

You can try with ansible-galaxy install git+https://github.com/pdesgarets/my-role.git.

Thanks.

@chouseknecht
Copy link
Contributor

If you install directly from a git URL, then yes, the role name ends up being the repo name. Don't think we're going to fix this in the existing ansible-galaxy client. It may get enabled in Mazer.

@maresb
Copy link

maresb commented Aug 23, 2021

I'm not sure if it's in the docs, but after scouring the source code, I learned that you can specify the role name at the end of the URL with a comma.

ansible-galaxy install git+https://github.com/pdesgarets/my-role.git,commit-id,custom-name

It has to come after a commit ID, which can also be a branch name such as master/main.

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

No branches or pull requests

3 participants