I created a dictionary variable like this in Ansible
sw_version:
v9_0_7:
src_copy: "files/9_0_7/Splunk Forwarder/"
dest_copy: 'C:tempsource_software_package9.0.7Splunk_Forwarder'
source_package_path: "{{dest_copy}}Installer.exe"
inst_creates_path: 'C:Program FilesSplunkUniversalForwarderbinsplunk.exe'
product_ID: '{XXXXXX-91DB-406D-XXXX-4E92366B381B}'
product_VERSION: '9.7.1.1.0'
When I try to access this variable like the below
"{{ sw_version['v9_0_7']['dest_copy'] }}"
it always throws error as
"sw_version": "VARIABLE IS NOT DEFINED!"
Is there some thing, I need to correct here…
Note: If I try to replace the values with a simple string for all the keys,I am able to parse it rightly….
such as if the variable was declared like this
sw_version:
v9_0_7:
src_copy: a
dest_copy: b
source_package_path: c
inst_creates_path: d
product_ID: e
product_VERSION: f
but it is throwing errors for the actual values…..