Hi,

I have a fact as below:

"dns_parsed": [
    "10.4.3.2"
]

and another fact as:

"actual_config": {
    "dns": {
        "domains": ['test.com'],
        "servers": []
      }
 }

I want to update actual_config to make it:

"actual_config": {
    "dns": {
        "domains": ['test.com'],
        "servers": ["10.4.3.2"]
      }
 }

my playbook part to accomplish this:

- name: merge dns data
  set_fact:
    actual_config: "{{ actual_config.dns.servers | union(dns_parsed) }}"

- debug:
  var=actual_config

however it removes all other keys from actual_config.

"actual_config": [
      "10.4.3.2"
]

Any clue how to make it work ?

Thanks and Regards,
Punit

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAFXWBQ%2B0qy-kpxWOPkBDYw-Htq99Gm4cc53JE2JO_gG1zVSB-A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to