pyvmomi needs to be installed where the module is executing, per your
output, it is failing to import pyvmomi on `x.x.x.x` (which is of course
some obscured host)

You likely want to use `delegate_to: localhost` on that task to have
ansible execute the module locally, instead of on a remote host.

On Tue, Jan 16, 2018 at 1:29 PM, <[email protected]> wrote:

> When I add the following section to otherwise working ansible playbook:
>
> - name: Revert to a snapshot
>       vmware_guest_snapshot:
>         hostname: myvcenter
>         username: myusername
>         password: mypassword
>         datacenter: myvcenter
>         folder: myfolder
>         name: guestname
>         state: revert
>         snapshot_name: snapshotname
>
> and run:
>
> ansible-playbook myplaybook
>
> I get the following error:
>
> TASK [Revert to a snapshot] ******************************
> ************************************************************
> *********************************************************************
> fatal: [x.x.x.x]: FAILED! => {"changed": false, "msg": "pyvmomi module
> required"}
>
>
> I was referencing the ansible documentation, linked below:
>
> http://docs.ansible.com/ansible/latest/vmware_guest_snapshot_module.html
>
> Here's some info about my ansible server:
>
> [root@ansible ansible]# uname -a
> Linux ansible 2.6.32-696.6.3.el6.x86_64 #1 SMP Wed Jul 12 14:17:22 UTC
> 2017 x86_64 x86_64 x86_64 GNU/Linux
>
> [root@ansible ansible]# cat /etc/*release
> CentOS release 6.9 (Final)
>
> [root@ansible ansible]# ansible --version
> ansible 2.4.2.0
>   config file = /etc/ansible/ansible.cfg
>   configured module search path = [u'/root/.ansible/plugins/modules', u
> '/usr/share/ansible/plugins/modules']
>   ansible python module location = /usr/lib/python2.6/site-packages/
> ansible
>   executable location = /usr/bin/ansible
>   python version = 2.6.6 (r266:84292, Aug 18 2016, 15:13:37) [GCC 4.4.7
> 20120313 (Red Hat 4.4.7-17)]
>
> [root@ansible ansible]# pip list | grep pyvmomi
> DEPRECATION: Python 2.6 is no longer supported by the Python core team,
> please upgrade your Python. A future version of pip will drop support for
> Python 2.6
> DEPRECATION: The default format will switch to columns in the future. You
> can use --format=(legacy|columns) (or define a format=(legacy|columns) in
> your pip.conf under the [list] section) to disable this warning.
> pyvmomi (6.5.0.2017.5.post1)
>
> I tried googling for the error, but wasn't able to find any solutions so
> far. I would appreciate any help, regarding this issue.
>
> Thank you!
>
> --
> 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 post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/b3607d3c-4474-4364-887b-3997be13b114%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/b3607d3c-4474-4364-887b-3997be13b114%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
@sivel
sivel.net

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v8Wkw%3DtH88kdfp7%3DmPsEHx5RtSwc619e8fYFEiqTLba8g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to