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:
https://github.com/ansible/ansible/blob/devel/lib/ansible/runner/action_plugins/patch.py https://github.com/ansible/ansible-modules-extras/blob/devel/files/patch.py 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: https://github.com/ansible/ansible/blob/devel/v2/ansible/plugins/action/patch.py On Fri, Apr 17, 2015 at 7:39 PM, jack <[email protected]> wrote: > Hi, > > We are trying to deploying some custom modules which have a requirement to > access some local files? Is that possible? > > Thanks > Jack > > -- > 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/bb4a603b-c8f0-4bc2-a151-fcb51f905515%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/bb4a603b-c8f0-4bc2-a151-fcb51f905515%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CAH%2BKTJ4V_VUasYNtqOEeOppDykgzv7PjJkgBDk%2BbLbLXgQhU%3Dg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
