From e28c3e8485304bd885f2bf23e63637f513f13399 Mon Sep 17 00:00:00 2001 From: Daniele Sluijters Date: Fri, 8 Jan 2016 15:46:12 +0100 Subject: [PATCH 1/2] Don't fail immediatly if legacy_origin/origins not set Closes #37 --- manifests/init.pp | 4 ++++ manifests/params.pp | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 7fe64ca6..3d9f2df6 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -20,6 +20,10 @@ $notify_update = undef, ) inherits ::unattended_upgrades::params { + if $legacy_origin == undef or $origins == undef { + fail('Please explicitly specify unattended_upgrades::legacy_origin and unattended_upgrades::origins.') + } + validate_bool( $install_on_shutdown, $legacy_origin, diff --git a/manifests/params.pp b/manifests/params.pp index d1b439d9..e8ed8c94 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -82,7 +82,8 @@ } } default: { - fail('Please explicitly specify unattended_upgrades::legacy_origin and unattended_upgrades::origins') + $legacy_origin = undef + $origins = undef } } } From 7f9c04e1c45bd5b25c1b48206a5b52c7a08b6dfd Mon Sep 17 00:00:00 2001 From: Daniele Sluijters Date: Fri, 8 Jan 2016 15:50:19 +0100 Subject: [PATCH 2/2] README: Clarify random_sleep Closes #34 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 61abf5c6..c6cdb845 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ Using unattended\_upgrades simply consists of including the module and if needed * `minimal_steps` (`true`): Split the upgrade process into sections to allow shutdown during upgrade. * `origins`: The repositories from which to automatically upgrade included packages. * `package_ensure` (`installed`): The ensure state for the 'unattended-upgrades' package. -* `random_sleep` (`300`): Seconds of delay on the cron job execution. +* `random_sleep` (`300`): Maximum amount of time (in seconds) that the apt cron job can sleep before the execution. The exact amount of time will be random but upto the value specified. The purpose is to avoid that servers/mirrors get hammered at exactly the same time when a lot of machines are switched on, e.g. 9:00 in the morning. * `size` (`0`): Maximum size of the cache in MB. * `update` (`1`): Do "apt-get update" automatically every n-days. * `upgrade` (`1`): Run the "unattended-upgrade" security upgrade script every n-days.