summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--manifests/init.pp4
-rw-r--r--manifests/params.pp3
3 files changed, 7 insertions, 2 deletions
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.
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
}
}
}