How to change/redefine variables in nested dictionary?

19 views
Skip to first unread message

Dmitry Owl

unread,
Aug 22, 2016, 3:41:49 PM8/22/16
to Ansible Project
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!
Reply all
Reply to author
Forward
0 new messages