Using Ansible 2.0 , is there a way to override a dictionary field in vars file ?
Let’s say I have a role with default dictionary values :
system:
packages_default: [curl, wget, python-software-properties, mc, dvtm, ncdu, vim, htop, iotop, bmon, tree, ntp]
apt_mirror: False
apt_upgrade: False
acl_enabled: False
And then I want to override just 1 dictionary field acl_enabled to True.
If I try the naive way “system.acl_enabled: True” it doesn’t work.
I thought I could use the new combine filter but it gets into a loop :
Both below assignments :
system: “{{ none|combine(system,{acl_enabled: True}) }}”
system: “{{ system|combine({acl_enabled: True}) }}”
results in :
ERROR! recursive loop detected in template string
Any solution ?