TL;DR goto: Problem
As of today it was not really possible to import variables twice with same name.
It was intended to for them to be unique per role, but according to code it never really was possible.
I’d like to make it possible, it brings a challange of override though.
Today’s possible actions on import (I’m leaving out obsolete, not of an importance here):
- Add we can import variable with unique name only once globally
- Update if we import variable with the same name from different role, we call it “Update” and only role assignment got updated, value, overriden value, value type stays the same
My proposed solution:
- Add import of ansible variables uniquelly per role as originally intended
- Update import of variable that changed it’s default value, but default haven’t been overriden by user
- Override for variables that has overriden default by user
Question: Is override usefull?
What is effectivelly going to happen, if the host has more roles, that have equally named variables, assigned? Are we ok, with random choice of variable that is going to win?