On 06.04.2019 13:20, Lucas Possamai wrote:

Or just keep "hosts: dbservers" and add "delegate_to: localhost" on the
purefa_snap task.
Then you don't have to deal the SDK on the remote machine since the
module Python code is run on localhost.


The thing is... I want the playbook to be executed on the host (not
locally). Testing it locally was only really a test to see where the
problem is. So I need to fix the missing SDK error.

It's more a Python problem than Ansible.
Ansible is running /usr/bin/python so your module need to be install in one of it's search path.

To check the path you can run
/usr/bin/python -c 'import sys; print sys.path'

If the path listed is one of the paths that purestorage is this command should work.

To check if you can import purestorage
/usr/bin/python -c 'import purestorage'

You should also check from you Ansible control machine to rule out environment variables not set by running ssh <user>@<dbserver> "/usr/bin/python -c 'import sys; print sys.path; import purestorage'"


--
Kai Stian Olstad

--
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/b0d3e1fe19e61f0fa75a9df877501330%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to