# My Favorite Module

**URL:** <https://forum.ansible.com/t/my-favorite-module/17920>\
**Category:** Ansible Project\
**Created:** [April 7, 2015, 7:50pm UTC](https://forum.ansible.com/t/my-favorite-module/17920 "2015-04-07T19:50:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg\_DeKoenigsberg1](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@Greg\_DeKoenigsberg1](https://forum.ansible.com/u/Greg_DeKoenigsberg1)\
**Post date:** [April 7, 2015, 7:50pm UTC](https://forum.ansible.com/t/my-favorite-module/17920/1 "2015-04-07T19:50:39Z")

</div>

Hi folks.

Have a favorite module? One that you use frequently, love deeply,  
understand fully, and wish were better known?

Considering some kind of "module of the month" club. Talk about a  
module, explain what it does, why it's useful, and what cool things  
you do with it.

What do you think? Any good ideas come to mind? I've got a few myself,  
but would love to hear from others.

--g

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [April 7, 2015, 8:11pm UTC](https://forum.ansible.com/t/my-favorite-module/17920/2 "2015-04-07T20:11:54Z")

</div>

Well, it’s nice you ask. I have a specific module in use, that might interest some people.

I am using a custom module I wrote about two years ago, and which has evolved to something pretty stable, at least for my use case:

[https://github.com/ginsys/ansible-plugins/blob/devel/library/check\_process](https://github.com/ginsys/ansible-plugins/blob/devel/library/check_process)

`check\_process’ was written as a complement to the service module, when handling Java based services.

These are pretty much known for often bad behaviour, be it because of badly written init scripts, or just because a Java process can take time to clean up itself and shut down.

This module allows to e.g.

- check if a process is running

- check if a process is not running

- check if that process has exactly one process running (restarting a Java service might sometimes keep the old process around, then starting a new, second one…)

- make those checks within a given time-out

- optionally kill the process if it should not be running

- kill the process using several different kill signals, serially and each with its own time-out are possible

I sometimes wondered if this should be up streamed, but always thought it was a more of work-around, and by principle a bit of a hack.

If fellow users think otherwise, I’m willing to consider a PR.

Greetz,

Serge

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [April 8, 2015, 12:12am UTC](https://forum.ansible.com/t/my-favorite-module/17920/3 "2015-04-08T00:12:46Z")

</div>

hmm, process\_facts ... sounds nice.
