I am using the ovirt_snapshot_info module to obtain information about our VM snapshots. I register the output and it contains an array of values, 1 for each VM, then within that output, there's an array of values called ovirt_snapshots (See sample below). I'm trying to get to the "description" value for each snapshot, but for the life of me, I can't get it to work. I'd appreciate any thoughts or ideas.
My sample output:
TASK [Show results] ************************************************************
ok: [localhost] => {
"msg": {
"changed": false,
"msg": "All items completed",
"results": [
{
"ansible_loop_var": "item",
"changed": false,
"failed": false,
"invocation": {
"module_args": {
"description": null,
"fetch_nested": false,
"nested_attributes": [],
"snapshot_id": null,
"vm": "vm1"
}
},
"item": "vm1",
"ovirt_snapshots": [
{
"cdroms": [],
"date": "2022-05-12 13:13:19.186000+00:00",
"description": "Snapshot before 12.2 update may122022",
"disks": [],
"href": "/ovirt-engine/api/vms/1eadb46c-e8a9-4ecd-b375-15b93079e1b3/snapshots/187b0431-b7fa-4b29-9dbc-d5298c0ba3e4",
"id": "187b0431-b7fa-4b29-9dbc-d5298c0ba3e4",
"nics": [],
"persist_memorystate": true,
"snapshot_status": "ok",
"snapshot_type": "regular",
My playbook code:
- name: Show results
ansible.builtin.debug:
msg: "{{ result }}"
with_nested:
- "{{ item.ovirt_snapshots }}"
loop:
- "{{ result.results }}"
Thanks,
Harry