Still no good:
TASK [Show results]
***********************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"msg": "The task includes an option with an
undefined variable. The error was: 'description' is undefined.
'description' is undefined\n\nThe error appears to be in
'/root/vm_snapshot_info.yml': line 48, column 7, but may\nbe elsewhere in
the file depending on the exact syntax problem.\n\nThe offending line
appears to be:\n\n\n - name: Show results\n ^ here\n"}
- name: Show results
ansible.builtin.debug:
msg: "{{ item,description }}"
loop:
- "{{ result.results | json_query('[*].ovirt_snapshots') }}"
Thanks,
Harry
On Thursday, February 23, 2023 at 3:32:32 PM UTC-5 Rowe, Walter P. (Fed)
wrote:
> - name: Show results
> ansible.builtin.debug:
> msg: "{{ item.description }}"
>
> loop:
> - "{{ result.results | json_query('[*].ovirt_snapshots') }}"
>
>
> Walter
> --
> Walter Rowe, Division Chief
> Infrastructure Services, OISM
> Mobile: 202.355.4123 <(202)%20355-4123>
>
> On Feb 23, 2023, at 3:21 PM, [email protected] <[email protected]> wrote:
>
> So that gives me the data under each VM's ovirt_snapshots, but I still
> can't access the "description" data. I tried this:
>
> - name: Show results
> ansible.builtin.debug:
> msg: "{{ item }}"
> with_nested:
> - "{{ item[0].description }}"
> loop:
> - "{{ result.results | json_query('[*].ovirt_snapshots') }}"
>
> And it shows me the same information with or without the "with_nested"
> clause in there.
>
> Thanks,
> Harry
> On Thursday, February 23, 2023 at 3:13:02 PM UTC-5 Rowe, Walter P. (Fed)
> wrote:
>
>> How about this?
>>
>> - name: Show results
>> ansible.builtin.debug:
>> msg: "{{ item }}"
>> loop:
>> - "{{ result.results | json_query('[*].ovirt_snapshots') }}"
>>
>> Walter
>> --
>> Walter Rowe, Division Chief
>> Infrastructure Services, OISM
>> Mobile: 202.355.4123 <(202)%20355-4123>
>>
>> On Feb 23, 2023, at 2:59 PM, [email protected] <[email protected]> wrote:
>>
>> That works, but it only shows the info for the first VM. There are 22
>> total. What I'd like to have is the VM name and list of all of that VMs
>> snapshots, so I need to be able to traverse through the output at the VM
>> level, then travers that VM's ovirt_snapshots data.
>>
>> Thanks,
>> Harry
>>
>> On Thursday, February 23, 2023 at 2:52:11 PM UTC-5 Rowe, Walter P. (Fed)
>> wrote:
>>
>>> - name: Show results
>>> ansible.builtin.debug:
>>> msg: "{{ item }}"
>>> loop:
>>> - "{{ result.results[0].ovirt_snapshots }}"
>>>
>>> Walter
>>> --
>>> Walter Rowe, Division Chief
>>> Infrastructure Services, OISM
>>> Mobile: 202.355.4123 <(202)%20355-4123>
>>>
>>> On Feb 23, 2023, at 2:37 PM, [email protected] <[email protected]>
>>> wrote:
>>>
>>> Nope. I get: "list object has no attribute 'ovirt_snapshots'.
>>>
>>> Thanks,
>>> Harry
>>>
>>> On Thursday, February 23, 2023 at 2:34:26 PM UTC-5 Rowe, Walter P. (Fed)
>>> wrote:
>>>
>>>> - name: Show results
>>>> ansible.builtin.debug:
>>>> msg: "{{ item }}"
>>>> loop:
>>>> - "{{ result.results.ovirt_snapshots }}"
>>>>
>>>> How about this?
>>>>
>>>> Walter
>>>>
>>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/b977149b-b0c9-4c62-9579-bec36f041f72n%40googlegroups.com
>>>
>>> <https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2Fb977149b-b0c9-4c62-9579-bec36f041f72n%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7Cad229e200c2149b59b7408db15dbca8a%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638127805966497448%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=HVFKyyAwVQzT23jBVyh4L%2B4gGj2ChsT6UhEsgk4V6aY%3D&reserved=0>
>>> .
>>>
>>>
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/65bac0a6-5df8-43e9-bd16-1ce0f2cf9610n%40googlegroups.com
>>
>> <https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2F65bac0a6-5df8-43e9-bd16-1ce0f2cf9610n%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7Cad229e200c2149b59b7408db15dbca8a%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638127805966497448%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=v9Uj8svCo2n9zzOHIKNSpTQQoruTrRxBAxCU07yf7FQ%3D&reserved=0>
>> .
>>
>>
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/5b077e4d-a84e-4d06-bee5-0d29509b06c2n%40googlegroups.com
>
> <https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2F5b077e4d-a84e-4d06-bee5-0d29509b06c2n%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7Cad229e200c2149b59b7408db15dbca8a%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638127805966653651%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7CX8KQnYkw1anIsUibi1Sdh1N4D%2B5ZbD5iQ3Cr3YMng%3D&reserved=0>
> .
>
>
>
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/beadb086-20cc-4f22-886e-8fdc33671844n%40googlegroups.com.