On Sun, 7 Apr 2019 at 01:32, Kai Stian Olstad < [email protected]> wrote:
> 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'" > It is definitely a Python problem than Ansible. [root@db2 ~]# /usr/bin/python -c 'import sys; print sys.path; > import purestorage' ['', '/usr/lib64/python26.zip', '/usr/lib64/python2.6', '/usr/lib64/python2.6/plat-linux2', '/usr/lib64/python2.6/lib-tk', '/usr/lib64/python2.6/lib-old', '/usr/lib64/python2.6/lib-dynload', '/usr/lib64/python2.6/site-packages', '/usr/lib64/python2.6/site-packages/gtk-2.0', '/usr/lib/python2.6/site-packages'] Traceback (most recent call last): File "<string>", line 2, in <module> ImportError: No module named purestorage Thanks for your help. Will try to get this python issue fixed. Thanks! -- 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/CAE_gQfUBmZGe-wvaH5bsd5BxKp28EqxOD1MObQ6OQqo1fhBNBw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
