bundlewrap/bundles/systemd-timers/items.py
mwiegand e2fbf6da92 wip
2021-07-13 02:07:14 +02:00

26 lines
764 B
Python

# svc_systemd['cron'] = {
# 'enabled': False,
# }
for name, config in node.metadata.get('systemd-timers').items():
files[f'/etc/systemd/system/{name}.timer'] = {
'content': repo.libs.systemd.generate_unitfile({
'Unit':{
'Description': f'{name} timer',
},
'Timer': {
'OnCalendar': config['when'],
'Persistent': config.get('persistent', False),
'Unit': f'{name}.service',
},
'Install': {
'WantedBy': 'multi-user.target',
}
}),
'triggers': [
'action:systemd-reload',
f'svc_systemd:{name}:restart',
],
}
svc_systemd[f'{name}.timer'] = {}