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
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
hmm, process_facts ... sounds nice.