I am using gather fact variable to get size from ansible_devices variable. for some host I am getting variable "ansible_devices": { "sda" and for few server getting "ansible_devices": { "cciss!c0d0".
Problem:- When I am using variable {{** ansible_devices.**__sda.size__ }} its working perfectly. But when I am trying to access value from {{ ansible_devices.**cciss!c0d0**.size }} in my playbook then it is not returning any value whereas in json ansible_devices variable there is value exist for {{ ansible_devices.**cciss!c0d0**.size }}.
``
`
{
“ansible_devices”: {
“cciss!c0d0”: {
“holders”: ,
“host”: “RAID bus controller: Hewlett-Packard Company Smart Array Controller (rev 03)”,
“model”: “LOGICAL VOLUME”,
“partitions”: {},
“removable”: “0”,
“rotational”: “1”,
“scheduler_mode”: “cfq”,
“sectors”: “143299800”,
“sectorsize”: “512”,
“size”: “68.33 GB”,
“support_discard”: “0”,
“vendor”: “HP”
}
},
“item”: “”
}
`
It might be the case special character in a json key that’s why I am unable to fetch its value. can anyone suggest me how can I access {{ ansible_devices.**cciss!c0d0**.size }} value here ?