Unable to gather virtual machines configuration information from KVM hypervisor

Hi Team,

I am trying to gather the entire configuration details of the virtual machine from KVM hypervisor and created a playbook as mentioned. Play book execution ends up with below mentioned error. I would highly appreciate if someone can guide me in this.

Hi Team,

I am trying to gather the entire configuration details of the virtual machine from KVM hypervisor and created a playbook
as mentioned. Play book execution ends up with below mentioned error. I would highly appreciate if someone can guide me
in this.

---
- hosts: all
name:
become: yes
tasks:
- name: Gathering Facts
ovirt.ovirt.ovirt_vm_info:
register: result
debug:
msg: "{{ result.ovirt_vms }}"

You are mixing two tasks, debug needs to be an extra task.

Regards
        Racke

Hi Racke,

Thanks a lot for the update.

I have corrected the playbook as mentioned below and ends up with different error.

Hi Racke,

Thanks a lot for the update.

I have corrected the playbook as mentioned below and ends up with different error.

---
- hosts: all
name:
become: yes
tasks:
- name: Gathering Facts
ovirt.ovirt.ovirt_vm_info:
register: result
debug:
msg: "{{ result.ovirt_vms }}"

ERROR! 'debug' is not a valid attribute for a Play

Please take the time and study the basics of Ansible playbooks.

Regards
        Racke

Hi Ramkrishna,

Thanks for the update.

I tried the same but still no luck.

ERROR! couldn’t resolve module/action ‘ovirt.ovirt.ovirt_vm_info’. This often indicates a misspelling, missing collection, or incorrect module path.

The error appears to be in ‘/home/testuser/ansible/testx.yml’: line 6, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

tasks:

  • name: Gathering Facts
    ^ here

Thanks,
Jayan