Hi,
any idea how I can trigger a service restart based on a fact without using the exec-resource? Following the mantra "*if you're using exec, you're doing something wrong.*" I wonder how to do that.
## Situation
I have got a process that occasionally takes too much memory. The approved fix for this is to restart the involved service.
## Approach
I plan to gather the memory-usage in a fact and based on the value to restart the service if necessary.
Without writing something like:
if $fact > {
exec {'restart-service':
command => 'systemctl restart
.....
}
}
I wonder if I can take usage of the notify-attribute somehow... Any ideas?
↧