# Dynamically expand dictionary variables

**URL:** <https://forum.ansible.com/t/dynamically-expand-dictionary-variables/27434>\
**Category:** Ansible Project\
**Created:** [May 3, 2018, 9:26am UTC](https://forum.ansible.com/t/dynamically-expand-dictionary-variables/27434 "2018-05-03T09:26:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![K\_de\_Jong](https://avatars.discourse-cdn.com/v4/letter/k/51bf81/32.png) [@K\_de\_Jong](https://forum.ansible.com/u/K_de_Jong)\
**Post date:** [May 3, 2018, 9:26am UTC](https://forum.ansible.com/t/dynamically-expand-dictionary-variables/27434/1 "2018-05-03T09:26:40Z")

</div>

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

`

---

<div class="post-metadata">

**Author:** ![K\_de\_Jong](https://avatars.discourse-cdn.com/v4/letter/k/51bf81/32.png) [@K\_de\_Jong](https://forum.ansible.com/u/K_de_Jong)\
**Post date:** [May 3, 2018, 10:29am UTC](https://forum.ansible.com/t/dynamically-expand-dictionary-variables/27434/2 "2018-05-03T10:29:55Z")

</div>

Got it, it works with: “{{ packages.system[ansible\_distribution] }}”
