Adding dict key + value

36 views
Skip to first unread message

Guy Knights

unread,
Oct 9, 2015, 5:41:10 PM10/9/15
to Ansible Project
I'm trying to add a new key to an existing dictionary but I'm having some trouble. I have this set_fact task:

- set_fact:
    ha
.listeners.backends[item.key].servers="{{ groups[item.key] }}"
  with_dict
: ha.listeners.backends

It runs through without complaining, but when I debug the car there's new data isn't in the dict. Is it even possible to do what I'm trying to do?

Thanks,
Guy

Guy Knights

unread,
Oct 13, 2015, 1:32:39 PM10/13/15
to Ansible Project
Apologies, 'the car' should be 'the var', in case it's not obvious.
Reply all
Reply to author
Forward
0 new messages