Hi All,
Our required in-built module gives huge output of different keys that have
multiple values with objects. I used 'with_dict' and when to narrow and get
desired output as below. Here also am facing a road block that how can I
get the element where any value doesn't meet. How can get output of the
block when "status": "CRITICAL" instead of all.
Output:
"msg": {
"key": "devices",
"value": [
{
"configuration": "Configured",
"version": "PD-0.7",
"label": "device-1",
"location": "1",
"serial_number": "PWH12GVF",
"status": "OK"
},
{
"configuration": "Configured",
"version": "PD-0.7",
"label": "device-2",
"location": "2",
"serial_number": "PWH12GWF",
"status": "OK"
},
{
"configuration": "Configured",
"version": "PD-0.7",
"label": "device-3",
"location": "3",
"serial_number": "PWH12GXF",
"status": "CRITICAL"
}
]
}
Desired output:
"configuration": "Configured",
version": "PD-0.7",
"label": "device-3",
"location": "3",
"serial_number": "PWH12GXF",
"status": "CRITICAL"
--
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/b0c56d3a-b546-49c9-912d-c4a9cdd6d4c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.