Iteration over msg

16 views
Skip to first unread message

Rama

unread,
May 25, 2019, 9:21:25 AM5/25/19
to Ansible Project
Hi All,

I have a playbook ran and got desired below output. Could anyone please help me how to iterate and get the Fan block which status is degraded.

TASK [debug] *******************
task path: /home/dev/test.yml:13
ok: [localhost] => {
    "msg": {
        "Fan Block 1": {
            "label": "Fan Block 1",
            "speed": [
                94,
                "Percentage"
            ],
            "status": "OK",
            "zone": "System"
        },
        "Fan Block 2": {
            "label": "Fan Block 2",
            "speed": [
                94,
                "Percentage"
            ],
            "status": "Degraded",
            "zone": "System"
        },
        "Fan Block 3": {
            "label": "Fan Block 3",
            "speed": [
                94,
                "Percentage"
            ],
            "status": "OK",
            "zone": "System"
        },
    }
}
Reply all
Reply to author
Forward
0 new messages