Let's have something like this in role defaults/main.yml:
num: 0
config:
0:
a: true
b: 'x'
1:
a: false
b: 'y'
2:
a: false
b: 'z'
Now I send -e num=1 in playbook call, and I want to use values a and b based on this value somewhere else in the role, something like:
aValue: '{{config[num].a}}'
bValue: '{{config[num].b}}'
How do I do that? I tried
aValue: '{{config[num].a}}'
but got an error: 'dict object' has no attribute u'1'
aValue: '{{config["num"].a}}'
but got an error: 'dict object' has no attribute 'num'