Team, I have a task where am trying to reference value from a dictionary defined in my values file. but getting below error, any hint? am doing this exercise to use this reference in my other tasks later but first debug step itself is failing.
I referred this link [ansible dict reference][1]
values.yaml
loop_device: "loop"
available_device_default_config:
- device: any
partitions:
- number: 1
start: 0%
end: 100%
storage_class: services
task
- name: lookup dictionary vars
debug:
var: available_device_default_config.device
task output error
34 TASK [local_volume_mount : lookup dictionary vars] *****************************
Wednesday 28 April 2021 21:51:34 +0000 (0:00:04.915) 0:00:05.052 *******
ok: [node1] => {
"available_device_default_config.device": "VARIABLE IS NOT DEFINED!"
}
expected output:
ok: [node1] => {
"any"
}
I tried below but no luck
var: "{{ available_device_default_config.device }}"
var: "{{ available_device_default_config['device'] }}"