I have a playbook which install windows updates with win_updates.
The output is registred. See example output below.
I want to filter that output with the result title,kb where the installed value is equal to true
I was trying something like this:
updates.*.[?installed==“true”]{name:title,installed:installed}
But that is not working.
{
“updates”: {
“adab657d-7124-4d67-98a0-78bb2d9db5bf”: {
“id”: “adab657d-7124-4d67-98a0-78bb2d9db5bf”,
“title”: “2023-09 Cumulative Update for .NET Framework 3.5, 4.8 and 4.8.1 for Microsoft server operating system version 21H2 for x64 (KB5030186)”,
“categories”: [
“Microsoft Server operating system-21H2”,
“Security Updates”
],
“kb”: [
“5030186”
],
“installed”: true
},
“91722aa2-d45a-4a79-b59a-2365f590b8c6”: {
“id”: “91722aa2-d45a-4a79-b59a-2365f590b8c6”,
“title”: “Windows Malicious Software Removal Tool x64 - v5.117 (KB890830)”,
“categories”: [
“Update Rollups”,
“Windows Server 2016”,
“Windows Server 2019”,
“Windows Server, version 1903 and later”
],
“kb”: [
“890830”
],
“installed”: true
},
“f1e3c23a-45c2-47ae-a9ca-7139585571d5”: {
“id”: “f1e3c23a-45c2-47ae-a9ca-7139585571d5”,
“title”: “2023-09 Cumulative Update for Microsoft server operating system version 21H2 for x64-based Systems (KB5030216)”,
“categories”: [
“Security Updates”
],
“kb”: [
“5030216”
],
“installed”: true
},
“696baba6-f559-4e24-b099-3170606e6096”: {
“id”: “696baba6-f559-4e24-b099-3170606e6096”,
“title”: “Security Intelligence Update for Microsoft Defender Antivirus - KB2267602 (Version 1.397.1155.0)”,
“categories”: [
“Definition Updates”,
“Microsoft Defender Antivirus”
],
“kb”: [
“2267602”
],
“installed”: true
}
},
“failed_update_count”: 0,
“found_update_count”: 4,
“changed”: true,
“reboot_required”: true,
“installed_update_count”: 4,
“filtered_updates”: {},
“_ansible_no_log”: false,
“failed_when_result”: false
}