access local file from ansible custom module

246 views
Skip to first unread message

jack

unread,
Apr 17, 2015, 7:39:28 PM4/17/15
to ansible...@googlegroups.com
Hi,

We are trying to deploying some custom modules which have a requirement to access some local files? Is that possible?

Thanks
Jack

Chris Church

unread,
Apr 18, 2015, 1:45:05 PM4/18/15
to ansible...@googlegroups.com
If you need to use a local file from your module, you may need to create an action plugin along with your remote module.  The patch "module", for example, uses an action plugin to read the source file (when remote_src=False) and copy it to the remote system before running the patch module remotely:


If you're thinking this custom module may be published or contributed back to Ansible at some point, note that the action plugin API is changing for v2:



--
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/bb4a603b-c8f0-4bc2-a151-fcb51f905515%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

m...@andreatartaglia.com

unread,
Apr 18, 2015, 10:09:11 PM4/18/15
to ansible...@googlegroups.com
Hi jack, 

what do you mean by accessing local files? 
You can use synchronise or copy to push the file to the remote or "fetch" to pull it. 

--
Andrea

----- Reply message -----
From: "jack" <jackm...@gmail.com>
To: <ansible...@googlegroups.com>
Subject: [ansible-project] access local file from ansible custom module
Date: Sat, Apr 18, 2015 12:39 AM

jack

unread,
Apr 20, 2015, 4:14:37 PM4/20/15
to ansible...@googlegroups.com
Thanks you so much, we will give a try.
Reply all
Reply to author
Forward
0 new messages