diff options
-rw-r--r-- | manifests/init.pp | 70 |
1 files changed, 52 insertions, 18 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 7b09d0a..5460948 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -21,31 +21,65 @@ class unattended_upgrades ( $options = {}, ) inherits ::unattended_upgrades::params { - if $legacy_origin == undef or $origins == undef { - fail('Please explicitly specify unattended_upgrades::legacy_origin and unattended_upgrades::origins.') - } + validate_hash($age) + $_age = merge($::unattended_upgrades::default_age, $age) + validate_integer($_age['min'], undef, 0) + validate_integer($_age['max'], undef, 0) - validate_bool( - $install_on_shutdown, - $legacy_origin, - $minimal_steps, - ) - validate_array($blacklist) - validate_array($origins) validate_hash($auto) $_auto = merge($::unattended_upgrades::default_auto, $auto) - validate_hash($mail) - if $mail['only_on_error'] { - validate_bool($mail['only_on_error']) - } - $_mail = merge($::unattended_upgrades::default_mail, $mail) + validate_integer($_auto['clean'], undef, 0) + validate_bool($_auto['fix_interrupted_dpkg']) + validate_bool($_auto['reboot']) + validate_string($_auto['reboot_time']) + validate_bool($_auto['remove']) + validate_hash($backup) $_backup = merge($::unattended_upgrades::default_backup, $backup) - validate_hash($age) - $_age = merge($::unattended_upgrades::default_age, $age) - validate_integer($size) + validate_integer($_backup['archive_interval'], undef, 0) + validate_integer($_backup['level'], undef, 0) + + validate_array($blacklist) + + if $dl_limit != undef { + validate_integer($dl_limit, undef, 0) + } + + validate_integer($enable, 1, 0) + + validate_bool($install_on_shutdown) + + validate_bool($legacy_origin) + + validate_hash($mail) + $_mail = merge($::unattended_upgrades::default_mail, $mail) + validate_bool($_mail['only_on_error']) + + validate_bool($minimal_steps) + + validate_array($origins) + + validate_string($package_ensure) + + if $random_sleep != undef { + validate_integer($random_sleep, undef, 0) + } + + validate_integer($size, undef, 0) + + validate_integer($update, undef, 0) + + validate_integer($upgrade, undef, 0) + validate_hash($upgradeable_packages) $_upgradeable_packages = merge($::unattended_upgrades::default_upgradeable_packages, $upgradeable_packages) + validate_integer($_upgradeable_packages['download_only'], undef, 0) + validate_integer($_upgradeable_packages['debdelta'], undef, 0) + + validate_integer($verbose, undef, 0) + + validate_bool($notify_update) + validate_hash($options) $_options = merge($unattended_upgrades::default_options, $options) validate_bool($_options['force_confdef']) |