From 50ea6a92a5ee3d6e9b0d3a19ddb9d5208d4927b6 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sun, 6 Mar 2022 12:49:46 +0100 Subject: [PATCH] bundles/apt: introduce additional_update_commands for updating other stuff --- bundles/apt/files/do-unattended-upgrades | 4 ++++ bundles/apt/items.py | 1 + 2 files changed, 5 insertions(+) diff --git a/bundles/apt/files/do-unattended-upgrades b/bundles/apt/files/do-unattended-upgrades index be56863..5eb8adf 100644 --- a/bundles/apt/files/do-unattended-upgrades +++ b/bundles/apt/files/do-unattended-upgrades @@ -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) diff --git a/bundles/apt/items.py b/bundles/apt/items.py index 7d40483..ae0f87a 100644 --- a/bundles/apt/items.py +++ b/bundles/apt/items.py @@ -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', {}), }