Unable to gather virtual machines configuration information from KVM hypervisor

33 views
Skip to first unread message

jaya...@gmail.com

unread,
Jan 15, 2021, 8:40:17 AM1/15/21
to Ansible Project

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 }}"

ERROR! conflicting action statements: debug, ovirt.ovirt.ovirt_vm_info

The error appears to be in '/home/testuser/ansible/test.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

 Regards,
Jayan

Stefan Hornburg (Racke)

unread,
Jan 15, 2021, 8:49:07 AM1/15/21
to ansible...@googlegroups.com
On 1/15/21 2:40 PM, jaya...@gmail.com wrote:
>
> 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

> ERROR! conflicting action statements: debug, ovirt.ovirt.ovirt_vm_info
>
> The error appears to be in '/home/testuser/ansible/test.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
>
>  Regards,
> Jayan
>
> --
> 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
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/b0160345-7996-4bf1-a5a6-a9200fd1fb77n%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/b0160345-7996-4bf1-a5a6-a9200fd1fb77n%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

OpenPGP_signature

jaya...@gmail.com

unread,
Jan 15, 2021, 9:01:59 AM1/15/21
to Ansible Project
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

The error appears to be in '/home/testuser/ansible/test.yml': line 2, column 3, but may

be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- hosts: all
  ^ here

Regards,
Jayan

Stefan Hornburg (Racke)

unread,
Jan 15, 2021, 9:10:36 AM1/15/21
to ansible...@googlegroups.com
On 1/15/21 3:01 PM, jaya...@gmail.com wrote:
> 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
> <https://groups.google.com/d/msgid/ansible-project/b0160345-7996-4bf1-a5a6-a9200fd1fb77n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/ansible-project/b0160345-7996-4bf1-a5a6-a9200fd1fb77n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
>
> --
> Ecommerce and Linux consulting + Perl and web application programming.
> Debian and Sympa administration. Provisioning with Ansible.
>
> --
> 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
> ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/53b7de82-0f7c-4317-8196-ac079e2b43cdn%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/53b7de82-0f7c-4317-8196-ac079e2b43cdn%40googlegroups.com?utm_medium=email&utm_source=footer>.
OpenPGP_signature

Ramakrishna Veeragandham

unread,
Jan 15, 2021, 9:27:48 AM1/15/21
to ansible...@googlegroups.com
-
- hosts: all
  name:
  become: yes
  tasks:
  - name: Gathering Facts
    ovirt.ovirt.ovirt_vm_info:
    register: result
  - debug:
     msg: "{{ result.ovirt_vms }}"


To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/53b7de82-0f7c-4317-8196-ac079e2b43cdn%40googlegroups.com.

Jayan Anirudhan

unread,
Jan 15, 2021, 10:09:43 AM1/15/21
to ansible...@googlegroups.com
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



--
Regards,

Jayan Anirudhan
Mob:09885994156
Reply all
Reply to author
Forward
0 new messages