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 names should be able to begin with a underscore. #2035

Open
1 task done
gardar opened this issue Oct 18, 2024 · 2 comments
Open
1 task done

Role names should be able to begin with a underscore. #2035

gardar opened this issue Oct 18, 2024 · 2 comments
Labels
bug Something isn't working needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member.

Comments

@gardar
Copy link

gardar commented Oct 18, 2024

Summary

According to the Collection structure chapter of the docs:

Role names are now limited to contain only lowercase alphanumeric characters, plus _ and start with an alpha character.

However, I've observed that role names can start with an underscore _ character without causing any issues. I have tried this with Ansible versions 2.9, 2.10, 2.11, 2.12, 2.13, 2.14, 2,15, 2.16 and 2.17, and none of them had problems consuming a role with such a name. Ansible Galaxy also imports the role without any issues.

I understand that a role name like this might not be aesthetically pleasing, but there is a good reason for it. We recently added an Ansible role for common shared tasks to the [prometheus ansible collection](https://github.com/prometheus-community/ansible). The role is named _common (fqcn prometheus.prometheus._common) to distinguish it from the other roles in the collection, as it is an internal role that's only supposed to be used by the other roles and not directly by a user.

Related: ansible/ansible-lint#4370

Issue Type

Bug Report

Component Name

core

Ansible Version

N/A

Configuration

N/A

OS / Environment

N/A

Steps to Reproduce

N/A

Expected Results

N/A

Actual Results

N/A

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibot ansibot added bug Something isn't working needs_triage Needs a first human triage before being processed. labels Oct 18, 2024
@ansibot
Copy link
Contributor

ansibot commented Oct 18, 2024

Files identified in the description:

None

If these files are incorrect, please update the component name section of the description or use the component bot command.

@mattclay mattclay transferred this issue from ansible/ansible Oct 18, 2024
@ansible-documentation-bot ansible-documentation-bot bot added the new_contributor This PR is the first contribution by a new community member. label Oct 18, 2024
@ansible-documentation-bot
Copy link
Contributor

Thanks for your Ansible docs contribution! We talk about Ansible documentation on Matrix at #docs:ansible.im if you ever want to join us and chat about the docs! We meet on Matrix every Tuesday. See the Ansible calendar for meeting details. We welcome additions to our weekly agenda items too. You can add the dawgs-meeting tag to a forum topic to bring it up at the next meeting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member.
Projects
Status: 🆕 Triage
Development

No branches or pull requests

2 participants