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