Galaxy: How to change the role name?

Created on 4 Jul 2018  路  4Comments  路  Source: ansible/galaxy

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.


typquestion

Most helpful comment

@drew-kun

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

All 4 comments

@drew-kun

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

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.

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.

Thanks, it works!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

robertdebock picture robertdebock  路  5Comments

chouseknecht picture chouseknecht  路  5Comments

donvipre picture donvipre  路  7Comments

cfawcett82 picture cfawcett82  路  4Comments

wildone picture wildone  路  6Comments