# library/module\_utils functionality question

**URL:** <https://forum.ansible.com/t/library-module-utils-functionality-question/26720>\
**Category:** Ansible Project\
**Created:** [February 13, 2018, 4:40pm UTC](https://forum.ansible.com/t/library-module-utils-functionality-question/26720 "2018-02-13T16:40:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arthur\_Reyes](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@Arthur\_Reyes](https://forum.ansible.com/u/Arthur_Reyes)\
**Post date:** [February 13, 2018, 4:40pm UTC](https://forum.ansible.com/t/library-module-utils-functionality-question/26720/1 "2018-02-13T16:40:59Z")

</div>

If a module with the same name as a core module exists in the ./library or ./module\_utils directory of the plabyook, which module will be get invoked when I reference it in my playbook?

I have a need to modify the functionality of a core module. I could refactor/rename it to [module]\_internal or simply copy the module to ./library and add the needed functionality, so I’m curious how others have approached this. I see benefits of creating a new (renamed) module with the added functionality and refactoring my playbook to invoke this module instead, but there’s other benefits to just slipping the modified module directly into the ./library directory so that no further changes are required in the playbook.

Thoughts?

---

<div class="post-metadata">

**Author:** ![Arthur\_Reyes](https://avatars.discourse-cdn.com/v4/letter/a/90ced4/32.png) [@Arthur\_Reyes](https://forum.ansible.com/u/Arthur_Reyes)\
**Post date:** [February 13, 2018, 6:04pm UTC](https://forum.ansible.com/t/library-module-utils-functionality-question/26720/2 "2018-02-13T18:04:31Z")

</div>

Follow-up. I tested copying a module from core into the playbook library. Modifying the content, without altering the module name and observed that ansible.library picked up the local module first.
