Your environments variable definition seems to be incorrectly quoted so I’m not even sure what that list looks like now.
You can also try the yaml list syntax:
environments:
DEV Managed
UAT somewhere else
PROD blah
Also you compare ‘version’ but your example mentions ‘env’ (which is also inconsistently indented).
You have env: Acceptance in there but if you had it DEV or UAT or PROD, it would have worked. I mean If you use DEV or UAT or PROD as value of env, then it’s all good which is fine. The problem is when the value of env is just D (first letter of DEV) ie env: D, it still matches DEV.
(ansible-2.9.15) dick.visser@mbp ~$ ansible-playbook
work/tasks/list3.yml -e env=DEV
[WARNING]: No inventory was parsed, only implicit localhost is available
PLAY [localhost] ***************************************************************
(ansible-2.9.15) dick.visser@geant-ams-049 ~$ ansible-playbook
work/tasks/list3.yml -e env=D
[WARNING]: No inventory was parsed, only implicit localhost is available