bundles/systemd-timers: add exclude_from_monitoring
This commit is contained in:
parent
3936e64227
commit
6b27128b6d
2 changed files with 6 additions and 1 deletions
|
@ -17,6 +17,8 @@ Type=oneshot
|
||||||
% for command in config['command']:
|
% for command in config['command']:
|
||||||
ExecStart=/usr/local/sbin/systemd-timer-monitored ${timer} ${command}
|
ExecStart=/usr/local/sbin/systemd-timer-monitored ${timer} ${command}
|
||||||
% endfor
|
% endfor
|
||||||
|
% elif config.get('exclude_from_monitoring', False):
|
||||||
|
ExecStart=${config['command']}
|
||||||
% else:
|
% else:
|
||||||
ExecStart=/usr/local/sbin/systemd-timer-monitored ${timer} ${config['command']}
|
ExecStart=/usr/local/sbin/systemd-timer-monitored ${timer} ${config['command']}
|
||||||
% endif
|
% endif
|
||||||
|
|
|
@ -5,7 +5,10 @@ def monitoring(metadata):
|
||||||
services = {}
|
services = {}
|
||||||
|
|
||||||
for timer, config in node.metadata.get('systemd-timers/timers', {}).items():
|
for timer, config in node.metadata.get('systemd-timers/timers', {}).items():
|
||||||
if config.get('delete', False):
|
if (
|
||||||
|
config.get('delete', False)
|
||||||
|
or config.get('exclude_from_monitoring', False)
|
||||||
|
):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
services[f'SYSTEMD-TIMER {timer}'] = {
|
services[f'SYSTEMD-TIMER {timer}'] = {
|
||||||
|
|
Loading…
Reference in a new issue