I was converting one of my playbooks into a collection to utilize galaxy instead of manual source control for swift deployment when realized that var prefix is not enforced anymore. Since this is now a collection, it makes sense to allow correct usage outside of my playbooks. But I am not sure if I should add prefixes to all role vars (params) or keep current layout Am I getting this right that now variables supplied as parameters to a role would resolve possible collisions since role params would have higher priority?
Back in the days I would append prefix as I did with dotfiles role (in another collection) and linter would agree but things seems to be different now and I can’t find any relative documentation with active links.
I thought the linter would help to clear things out but I can not make it to complain on the topic no matter what I do - like it does not care anymore about var prefixes.
I’ve whined about this but from the other side. That is, I want Fully Qualified Variable Names (FQVN), not just prefixed with the role name. The fact that I have three distinct roles with the same name - one stand-alone and two in collections - makes a role-only prefix not particularly helpful. (It wasn’t my idea! I just implemented 'em, honest!)
ansible-lint will complain if you pass un-prefixed variables in a vars section of an include_role task. But it can’t really complain about a role using variables that aren’t prefixed; it has no way of knowing if those variables are unique to the role or if they come from elsewhere (I’m guessing).