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

suggestion: use a common prefix for every variable in the role #238

Open
pescobar opened this issue Mar 21, 2024 · 4 comments
Open

suggestion: use a common prefix for every variable in the role #238

pescobar opened this issue Mar 21, 2024 · 4 comments

Comments

@pescobar
Copy link
Contributor

Hi,

it's a recommended practice in ansible that every variable in a role uses a common prefix so it's easier to map a variable to the role defining it

You can find some docs here
https://ansible.readthedocs.io/projects/lint/rules/var-naming/

And and example here where where mysql role uses prefix mysql_ for every variable
https://github.com/geerlingguy/ansible-role-mysql/blob/master/defaults/main.yml

I think it would make sense that every variable in this role would use preix ood_ (or something similar). I can work on this refactor in case there is interest to get it merged upstream.

I understand this would be a breaking change and maybe you prefer to keep things as they are and that's totally fine and understandable. Just let me know your opinion.

@johrstrom
Copy link
Collaborator

I understand this would be a breaking change and maybe you prefer to keep things as they are and that's totally fine and understandable. Just let me know your opinion.

I think I agree, but the change would likely be very disruptive. The next release is going to be 4.0 with some breaking changes in OOD, so maybe that's a good time to introduce breaking changes here...

@pescobar
Copy link
Contributor Author

What you suggest makes total sense.

Please feel free to contact me in case you want contributions for this task in the future. I have some experience with ansible and I would be happy to help

Feel free to close this issue.

@johrstrom johrstrom pinned this issue Mar 21, 2024
@johrstrom
Copy link
Collaborator

Please feel free to contact me in case you want contributions for this task in the future. I have some experience with ansible and I would be happy to help

Thanks! I figure it'll be a slog where it's not all done in one go, but in many smaller PRs.

Feel free to close this issue.

I'll keep it open and actually pin it in case others want to chime in.

@sjpb
Copy link
Contributor

sjpb commented May 14, 2024

+1 on this, it really needs it especially for variables which are really likely to clash like servername. Maybe some of those could be tackled first to reduce the scale of the issue?

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

3 participants