bundles/pacman: add opt-in unattended-upgrades
Some checks failed
kunsi/bundlewrap/pipeline/head There was a failure building this commit
Some checks failed
kunsi/bundlewrap/pipeline/head There was a failure building this commit
This commit is contained in:
parent
14b402cdf3
commit
60c31d2d11
8 changed files with 182 additions and 1 deletions
|
@ -1,5 +1,14 @@
|
|||
% for monitored_node in sorted(monitored_nodes):
|
||||
% if monitored_node.has_any_bundle(['apt', 'c3voc-addons']):
|
||||
<%
|
||||
auto_updates_enabled = (
|
||||
monitored_node.has_any_bundle(['apt', 'c3voc-addons'])
|
||||
or (
|
||||
monitored_node.has_bundle('pacman')
|
||||
and monitored_node.metadata.get('pacman/unattended-upgrades/is_enabled', False)
|
||||
)
|
||||
)
|
||||
%>\
|
||||
% if auto_updates_enabled:
|
||||
object ScheduledDowntime "unattended_upgrades" {
|
||||
host_name = "${monitored_node.name}"
|
||||
|
||||
|
@ -9,7 +18,11 @@ object ScheduledDowntime "unattended_upgrades" {
|
|||
fixed = true
|
||||
|
||||
ranges = {
|
||||
% if monitored_node.has_bundle('pacman'):
|
||||
"${days[monitored_node.metadata.get('pacman/unattended-upgrades/day')]}" = "${monitored_node.metadata.get('pacman/unattended-upgrades/hour')}:${monitored_node.magic_number%30}-${monitored_node.metadata.get('pacman/unattended-upgrades/hour')}:${(monitored_node.magic_number%30)+30}"
|
||||
% else:
|
||||
"${days[monitored_node.metadata.get('apt/unattended-upgrades/day')]}" = "${monitored_node.metadata.get('apt/unattended-upgrades/hour')}:${monitored_node.magic_number%30}-${monitored_node.metadata.get('apt/unattended-upgrades/hour')}:${(monitored_node.magic_number%30)+30}"
|
||||
% endif
|
||||
}
|
||||
|
||||
child_options = "DowntimeTriggeredChildren"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue