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 ? 

-- 
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/05587b8f-aa0d-4524-9694-6ebfb2deaf12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to