Question on import statement in ansible module?

21 views
Skip to first unread message

Pathangi Janardhanan

unread,
Apr 14, 2016, 10:09:03 AM4/14/16
to Ansible Project
Hi,

 I am in the process of writting a python module for Ansible, and in this I need to import a non-standard shipped python module. How should I solve this? Should I first ensure that I get it installed in the target hosts before the tasks using my module start executing, or is there any ways of having ansible temporarily copy over some modules etc.?

Thanks
Jana

Brian Coca

unread,
Apr 14, 2016, 4:34:56 PM4/14/16
to ansible...@googlegroups.com
currently you just have to install on targets, we are working on features to allow to 'bundle' some imported modules, but this will be limited.

--
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 post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d236627a-7887-4abc-b39c-4a753640597f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
----------
Brian Coca

Mike Biancaniello

unread,
Apr 14, 2016, 6:46:49 PM4/14/16
to Ansible Project
Have you looked into creating an action_plugin (runs on localhost) that uses the non-standard module to do what it needs to do, then calls your module to be run remotely, but not needing the py lib anymore? Depending on what the py lib is doing, this may be an option for you. Check out https://github.com/ansible/ansible/tree/devel/lib/ansible/plugins/action for examples. template or copy might be good examples.
Reply all
Reply to author
Forward
0 new messages