My Favorite Module

52 views
Skip to first unread message

Greg DeKoenigsberg

unread,
Apr 7, 2015, 3:50:44 PM4/7/15
to ansible...@googlegroups.com
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

--
Greg DeKoenigsberg
Ansible Community Guy

Find out why SD Times named Ansible
their #1 Company to Watch in 2015:
http://sdtimes.com/companies-watch-2015/

Serge van Ginderachter

unread,
Apr 7, 2015, 4:12:26 PM4/7/15
to ansible...@googlegroups.com
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

`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


Brian Coca

unread,
Apr 7, 2015, 8:12:50 PM4/7/15
to ansible...@googlegroups.com
hmm, process_facts ... sounds nice.




--
Brian Coca
Reply all
Reply to author
Forward
0 new messages