# Creating custom module

**URL:** <https://forum.ansible.com/t/creating-custom-module/14878>\
**Category:** Ansible Project\
**Created:** [March 27, 2014, 11:54pm UTC](https://forum.ansible.com/t/creating-custom-module/14878 "2014-03-27T23:54:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Edelman](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@Jason\_Edelman](https://forum.ansible.com/u/Jason_Edelman)\
**Post date:** [March 27, 2014, 11:54pm UTC](https://forum.ansible.com/t/creating-custom-module/14878/1 "2014-03-27T23:54:10Z")

</div>

Hi All,

New guy to Ansible here…

- New python module called ‘pinger\_test.py’ and put it in ./ansible/library.
- Ran ‘make webdocs’ while in ./ansible  
Playbook is:

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [March 31, 2014, 11:52pm UTC](https://forum.ansible.com/t/creating-custom-module/14878/2 "2014-03-31T23:52:02Z")

</div>

remove the .py from the file

---

<div class="post-metadata">

**Author:** ![Jason\_Edelman](https://avatars.discourse-cdn.com/v4/letter/j/c37758/32.png) [@Jason\_Edelman](https://forum.ansible.com/u/Jason_Edelman)\
**Post date:** [April 1, 2014, 12:20pm UTC](https://forum.ansible.com/t/creating-custom-module/14878/3 "2014-04-01T12:20:08Z")

</div>

Okay, so my error was very very stupid. Everything was correct, but I was executing the playbook as such ‘sudo ansible-playbook xxxxx’ and believe since was sudo’ing, I was losing the environment variables that were previously set. Doh!
