Skip to content
Permalink
Browse files

[debops.unattended_upgrades] Ensure valid reboot time generation

Previously, if the user took this as an example and changed the
parameters to the `random` Jinja2 filter, a time like "02:3" could have
been generated.

With the default settings of the role, such a invalid time was not a
concern because only the times from "02:40" to "02:54" (including start
and end) where possible.
  • Loading branch information...
ypid committed Sep 5, 2019
1 parent 3cbae8b commit 1b7a0e88df339c922dc4f8879d02fcef380b4037
Showing with 1 addition and 1 deletion.
  1. +1 −1 ansible/roles/debops.unattended_upgrades/defaults/main.yml
@@ -277,7 +277,7 @@ unattended_upgrades__auto_reboot: False
# Specify the time of the automatic reboot instead of ``now``.
unattended_upgrades__auto_reboot_time: '{{ "02:30"
if (ansible_virtualization_role in [ "host", "NA" ])
else "02:" + ((55 |random(seed=inventory_hostname, start=40))|string) }}'
else ("02:%02d"|format(55 |random(seed=inventory_hostname, start=40))) }}'

# ]]]
# .. envvar:: unattended_upgrades__bandwidth_limit [[[

0 comments on commit 1b7a0e8

Please sign in to comment.
You can’t perform that action at this time.