# How to change/redefine variables in nested dictionary?

**URL:** <https://forum.ansible.com/t/how-to-change-redefine-variables-in-nested-dictionary/22349>\
**Category:** Ansible Project\
**Created:** [August 22, 2016, 7:41pm UTC](https://forum.ansible.com/t/how-to-change-redefine-variables-in-nested-dictionary/22349 "2016-08-22T19:41:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dmitry\_Owl](https://avatars.discourse-cdn.com/v4/letter/d/2bfe46/32.png) [@Dmitry\_Owl](https://forum.ansible.com/u/Dmitry_Owl)\
**Post date:** [August 22, 2016, 7:41pm UTC](https://forum.ansible.com/t/how-to-change-redefine-variables-in-nested-dictionary/22349/1 "2016-08-22T19:41:49Z")

</div>

I have dictionary:

`  
test:  
a:  
name: ‘somevalue’  
other: ‘somevalue’  
another: ‘somevalue’  
b:  
name: ‘somevalue’  
other: ‘somevalue’  
another: ‘somevalue’

`

How can I change value of **“name”** in each dictionary during play of playbook and that this has affected on all further reference to the **“test”** dictionary? I want to get something like this:

`test: a: name: 'newvalue' other: 'somevalue' another: 'somevalue' b: name: 'newvalue' other: 'somevalue' another: 'somevalue'`

I have tried to use **“with\_dict”** , **“debug”** and **“combine”** jinja filter but didn’t get any result.

I will be grateful for any help!Thank you!
