bundles/apt: introduce additional_update_commands for updating other stuff

This commit is contained in:
Franzi 2022-03-06 12:49:46 +01:00
parent a0e943a243
commit 50ea6a92a5
Signed by: kunsi
GPG key ID: 12E3D2136B818350
2 changed files with 5 additions and 0 deletions

View file

@ -29,6 +29,10 @@ then
fi
% endif
% for command in sorted(additional_update_commands):
${command}
% endfor
% for affected, restarts in sorted(restart_triggers.items()):
up_since=$(systemctl show "${affected}" | sed -n 's/^ActiveEnterTimestamp=//p' || echo 0)
up_since_ts=$(date -d "$up_since" +%s || echo 0)

View file

@ -55,6 +55,7 @@ files = {
'content_type': 'mako',
'mode': '0700',
'context': {
'additional_update_commands': node.metadata.get('apt/additional_update_commands', set()),
'clean_old_kernels': node.metadata.get('apt/clean_old_kernels', True),
'restart_triggers': node.metadata.get('apt/restart_triggers', {}),
}