Hello,
In 1.8, the ability to reference a fact indirectly (as opposed to having to statically type it out) was broken. This used to give you the fact myFact:
{{ vars[‘myFact’] }}
This capability is very important to me, and I will not be able to continue to progress with Ansible unless this issue is resolved: it’s a very common pattern we see in microservices world to have things like OUR_SQL_SERVER_HOST, OUR_SQL_SERVER_PORT, and my scripts make extensive use of looking up facts with names like this via indirect references (so, depending on my vars, I might ask for OUR_SQL_SERVER_HOST or JANES_SQL_SERVER_HOST). I’m not seeing any traction or sympathy in getting this capability back based on the issue that was filed, #10859 [1], and the basic debugging that I’ve done shows that things in this realm of the codebase got refactored at some point to a really weird place.
I’d really appreciate some TLC being put in on this major regression in functionality.
There’s some argument that this was never intended to be a feature, to which I’d ask: 1) why not, clearly they were present, and it brings parity to what we can do with looking up vars, and 2) I’d say that mdehann should have said it wasn’t a feature when I said I was using it[2]- imo, it was an inject
, thus exposed, so clearly it was a feature. This is an important capability, and I believe my use-case does an adequate job of stating where I’m coming from. Please restore vars to working order, such that we can lookup facts, giving us parity with hostvars, or at least provide a feasible new path, such that we’re not here hanging out.
Thanks kindly,
rektide
[1] https://github.com/ansible/ansible/issues/10859
[2] https://github.com/ansible/ansible/issues/5000