Adding dict key + value

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

Apologies, ‘the car’ should be ‘the var’, in case it’s not obvious.