Jinja map 'extract'

21 views
Skip to first unread message

Mike Fennemore

unread,
Aug 18, 2016, 5:33:13 AM8/18/16
to Ansible Project
I have a playbook running Windows update and want to use set_fact to get a list of updates installed and the kb numbers.
At the end of the win_updates I register a variable which has the following:

 "update_result.updates": {
        "cdde339c-ebdb-4a16-add4-fb196a5053a8": {
            "id": "cdde339c-ebdb-4a16-add4-fb196a5053a8",
            "installed": false,
            "kb": [
                "3172729"
            ],
            "title": "Security Update for Windows Server 2012 R2 (KB3172729)"
        },
        "f77e3686-2b8e-4282-b231-b08e49ddddee": {
            "id": "f77e3686-2b8e-4282-b231-b08e49ddddee",
            "installed": false,
            "kb": [
                "3167679"
            ],
            "title": "Security Update for Windows Server 2012 R2 (KB3167679)"
        }
    }
}

How do I go about using map extract filter to get the kb, title and installed values for each item in the list?

Reply all
Reply to author
Forward
0 new messages