wip
This commit is contained in:
parent
65ef24f403
commit
9db53faf23
2 changed files with 10 additions and 5 deletions
|
@ -12,15 +12,15 @@ for name, unit in node.metadata.get('systemd/units').items():
|
|||
extension = name.split('.')[-1]
|
||||
|
||||
if extension in ['netdev', 'network']:
|
||||
files[f'/etc/systemd/network/{name}'] = {
|
||||
'content': repo.libs.systemd.generate_unitfile(unit),
|
||||
path = f'/etc/systemd/network/{name}'
|
||||
dependencies = {
|
||||
'triggers': [
|
||||
'svc_systemd:systemd-networkd:restart',
|
||||
],
|
||||
}
|
||||
elif extension in ['timer', 'service']:
|
||||
files[f'/etc/systemd/system/{name}'] = {
|
||||
'content': repo.libs.systemd.generate_unitfile(unit),
|
||||
path = f'/etc/systemd/system/{name}'
|
||||
dependencies = {
|
||||
'triggers': [
|
||||
"action:systemd-reload",
|
||||
],
|
||||
|
@ -28,6 +28,11 @@ for name, unit in node.metadata.get('systemd/units').items():
|
|||
else:
|
||||
raise Exception(f'unknown unit extension: "{extension}"')
|
||||
|
||||
files[path] = {
|
||||
'content': repo.libs.systemd.generate_unitfile(unit),
|
||||
**dependencies,
|
||||
}
|
||||
|
||||
for name, config in node.metadata.get('systemd/services').items():
|
||||
svc_systemd[name] = merge_dict(config, {
|
||||
'needs': [
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from mako.template import Template
|
||||
|
||||
template = '''
|
||||
% for segment, options in data.items():
|
||||
% for segment, options in sorted(data.items()):
|
||||
|
||||
% if '#' in segment:
|
||||
# ${segment.split('#', 2)[1]}
|
||||
|
|
Loading…
Reference in a new issue