Use ansible adhoc command with vmware

23 views
Skip to first unread message

Wael ElMasry

unread,
Jul 17, 2023, 9:41:02 AM7/17/23
to Ansible Project
I am new to Ansible, is it possible to use the adhoc command with ansible module (vmware.vmware_rest.*) ?

I am trying to run a simple comma to get virtual machine info.

ansible -m vmware.vmware_rest.vcenter_vm_info -a "vcenter_hostname=vcenter-ip vcenter_username=username vcenter_password=password"

Looks like this is failing because its missing the the pattern/hosts.

Also, using the ipaddress/hostname for the vcenter does not work.

ansible vcenter-ip  -m vmware.vmware_rest.vcenter_vm_info -a "vcenter_hostname=vcenter-ip vcenter_username=username vcenter_password=password"

and that vcenter ip is already in the inventory file.

Please help

Abhijeet Kasurde

unread,
Jul 17, 2023, 10:08:13 AM7/17/23
to ansible...@googlegroups.com
What is the error you get when you run ad-hoc command?

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/624dd2ba-e118-48dd-bba2-aa12d6fee052n%40googlegroups.com.


--
Thanks,
Abhijeet Kasurde
Reply all
Reply to author
Forward
0 new messages