Replies: 3 comments
-
Kubespray has a pattern where they have a role that does barely anything (I think it used to do nothing at all, task wise) but that contains all their global variables and settings: https://github.com/kubernetes-sigs/kubespray/tree/master/roles/kubespray-defaults. Their other roles then can depend on that one. Maybe that could be a way to resolve your issue? Prefixing with the full collection namespace + name + role name would by the way be even better to avoid conflicts, but then it gets a bit out of hand ( |
Beta Was this translation helpful? Give feedback.
-
We're in a similar situation where we have a |
Beta Was this translation helpful? Give feedback.
-
I would like for the prefix to be configurable in general, because a In general I agree with the point of the rule, however, I'd prefer to configure somewhere in the role metadata something like |
Beta Was this translation helpful? Give feedback.
-
Hi,
We tried to keep the
[role]_
naming rule for variables already before it was part of the linter. But, we have some variables that are global to all roles in the collection. Like one role sets up a PKI/CA and others need to know where certificates are placed. Another example is that every role in the collection can be used on its own. But when you want to use them together, you get extra features like more defaults etc. to make interaction easier.Could you allow
[collection]_
prefixes in addition to[role]_
for variable names? Otherwise we would need lot's of extraset_fact
tasks we would like to avoid.We have several collections but the one I'm talking about is our Elastic Stack collection. I opened issue NETWAYS/ansible-collection-elasticstack#159 for internal discussion. But we soon decided that it would be way better to find a solution upstream.
Beta Was this translation helpful? Give feedback.
All reactions