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

How to change the role name? #828

Closed
drew1kun opened this issue Jul 4, 2018 · 4 comments
Closed

How to change the role name? #828

drew1kun opened this issue Jul 4, 2018 · 4 comments
Assignees

Comments

@drew1kun
Copy link

drew1kun commented Jul 4, 2018

Feature Request

Use Case

The previous behavior of galaxy was very neat and intuitive.
However, It seems that there is no option to change the ansible role name anymore.
It would be awesome to have an option to modify the role name.

The reason why it may be needed is simple: the github account can contain projects that are not ansible roles, therefore it would be logical to have role projects' names on GitHub as the following example: ansible-myrole instead just myrole.

However, with the new galaxy update, the ansible- portion of the role name is not being stripped anymore and there is no way to modify it except changing the github repo name, which is not really what the one may want.

Proposed Solution

Considering the above, it would be great to have the option to correct name in galaxy, for example to be able to remove the ansible- portion from the newly imported role's name.

Alternatives

Ideal would be to keep the old behavior of automatic stripping the ansible- part from the beginning of the role repo name.

@chouseknecht
Copy link
Contributor

@drew-kun

You can set galaxy_info.role_name in meta/main.yml. For more details, view Role Names in our docs.

@drew1kun
Copy link
Author

drew1kun commented Jul 4, 2018

Thank you for your fast response and the solution.

I have also worked around it as following:
1 - create github repo named myrole
2 - add role to ansible-galaxy
3 - rename the original github repo to ansible-myrole

Ugly, but works... kinda.

@chouseknecht
Copy link
Contributor

Renaming the repo after import is less than ideal. Next time, please give role_name a try.

Closing this issue, as it seems to be solved. Please open a new issue, if you have additional questions.

@drew1kun
Copy link
Author

drew1kun commented Jul 4, 2018

Thanks, it works!

carlba added a commit to carlba/ansible-role-gitconfig that referenced this issue May 16, 2020
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

2 participants