From e28c3e8485304bd885f2bf23e63637f513f13399 Mon Sep 17 00:00:00 2001 From: Daniele Sluijters Date: Fri, 8 Jan 2016 15:46:12 +0100 Subject: 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 7fe64ca..3d9f2df 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -20,6 +20,10 @@ class unattended_upgrades ( $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 d1b439d..e8ed8c9 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -82,7 +82,8 @@ class unattended_upgrades::params { } } default: { - fail('Please explicitly specify unattended_upgrades::legacy_origin and unattended_upgrades::origins') + $legacy_origin = undef + $origins = undef } } } -- cgit v1.2.3 From 7f9c04e1c45bd5b25c1b48206a5b52c7a08b6dfd Mon Sep 17 00:00:00 2001 From: Daniele Sluijters Date: Fri, 8 Jan 2016 15:50:19 +0100 Subject: 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 61abf5c..c6cdb84 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. -- cgit v1.2.3