On Friday, 1 December 2017 03.01.23 CET area0 wrote:
> Here's the raw output; each item in the 'updates' list is defined by the 
> value of the 'id' field. Normally this would be a key like 'item' where i 
> could then specify, updates.item.title, right?

I'm not sure what you mean, but it sound wrong.


> How can i get around this?
> 
> Cheers
> 
> ok: [host1] => {
>     "available_updates": {
>         "changed": true,
>         "failed": false,
>         "found_update_count": 2,
>         "installed_update_count": 0,
>         "reboot_required": false,
>         "updates": {
>             "749e3c7a-4779-4c14-bccd-2b608c39ddc9": {
>                 "id": "749e3c7a-4779-4c14-bccd-2b608c39ddc9",
>                 "installed": false,
>                 "kb": [
>                     "3084905"
>                 ],
>                 "title": "Update for Windows Server 2012 R2 (KB3084905)"
>             },
>             "8832eabb-68ee-4ef9-b45e-b8fee94581b8": {
>                 "id": "8832eabb-68ee-4ef9-b45e-b8fee94581b8",
>                 "installed": false,
>                 "kb": [
>                     "890830"
>                 ],
>                 "title": "Windows Malicious Software Removal Tool for 
> Windows 8, 8.1, 10 and Windows Server 2012, 2012 R2, 2016 x64 Edition - 
> November 2017 (KB890830)"
>             },
> },
> }

Something like this will give you what you're looking for.

  - debug:
      msg: |
        {{ inventory_hostname }} has {{ available_updates.found_update_count }} 
updates available. The following updates are available for install:
        {% for key, value in available_updates.updates.iteritems() %}
        - {{ value.kb | join(',') }}
        {% endfor %}


-- 
Kai Stian Olstad

-- 
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/2624800.S9B26H97fX%40x1.
For more options, visit https://groups.google.com/d/optout.

Reply via email to