# access local file from ansible custom module

**URL:** <https://forum.ansible.com/t/access-local-file-from-ansible-custom-module/18011>\
**Category:** Ansible Project\
**Created:** [April 17, 2015, 11:39pm UTC](https://forum.ansible.com/t/access-local-file-from-ansible-custom-module/18011 "2015-04-17T23:39:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jack1](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@jack1](https://forum.ansible.com/u/jack1)\
**Post date:** [April 17, 2015, 11:39pm UTC](https://forum.ansible.com/t/access-local-file-from-ansible-custom-module/18011/1 "2015-04-17T23:39:28Z")

</div>

Hi,

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

Thanks  
Jack

---

<div class="post-metadata">

**Author:** ![Chris\_Church1](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@Chris\_Church1](https://forum.ansible.com/u/Chris_Church1)\
**Post date:** [April 18, 2015, 5:44pm UTC](https://forum.ansible.com/t/access-local-file-from-ansible-custom-module/18011/2 "2015-04-18T17:44:42Z")

</div>

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:

---

<div class="post-metadata">

**Author:** ![jack1](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@jack1](https://forum.ansible.com/u/jack1)\
**Post date:** [April 20, 2015, 8:14pm UTC](https://forum.ansible.com/t/access-local-file-from-ansible-custom-module/18011/3 "2015-04-20T20:14:37Z")

</div>

Thanks you so much, we will give a try.
