Dynamically expand dictionary variables

I’m trying to unify the way I install packages, I have the following vars/main.yml:

`

Got it, it works with: “{{ packages.system[ansible_distribution] }}”