From 886245f2cb7614a8c749d34e6f08ee17b92c970f Mon Sep 17 00:00:00 2001 From: Daniele Sluijters Date: Tue, 14 Apr 2015 17:25:40 +0200 Subject: Initial commit (this is not finished). --- manifests/params.pp | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 manifests/params.pp (limited to 'manifests/params.pp') diff --git a/manifests/params.pp b/manifests/params.pp new file mode 100644 index 0000000..49aec20 --- /dev/null +++ b/manifests/params.pp @@ -0,0 +1,50 @@ +class unattended_upgrades::params { + + if $::osfamily != 'Debian' { + fail('This module only works on Debian or derivatives like Ubuntu') + } + + $default_auto = { 'fix_interrupted_dpkg' => true, 'remove' => true, 'reboot' => false, 'clean' => 0, } + $default_mail = { 'only_on_errors' => true, 'to' => undef, } + $default_backup = { 'archive_interval' => 0, 'level' => 3, } + $default_age = { 'min' => 2, 'max' => 0, } + $default_size = { 'max' => 0, } + $default_upgradeable_packages = { 'download_only' => 0, 'debdelta' => 1, } + + # Strict variables facts lookup compatibility + $xfacts = { + 'lsbdistid' => defined('$lsbdistid') ? { + true => $::lsbdistid, + default => undef, + }, + 'lsbdistcodename' => defined('$lsbdistcodename') ? { + true => $::lsbdistcodename, + default => undef, + }, + } + + case $xfacts['lsbdistid'] { + 'debian': { + case $xfacts['lsbdistcodename'] { + 'squeeze': { + $legacy_origin = true + $origins = ['${distro_id} oldstable', #lint:ignore:single_quote_string_with_variables + '${distro_id} ${distro_codename}-security', #lint:ignore:single_quote_string_with_variables + '${distro_id} ${distro_codename}-lts',] #lint:ignore:single_quote_string_with_variables + } + default: { + $legacy_origin = false + $origins = ['origin=Debian,archive=stable,label=Debian-Security'] + } + } + } + 'ubuntu': { + $legacy_origin = true + $origins = ['${distro_id} {$distro_codename}-security', #lint:ignore:single_quote_string_with_variables + '${distro_id} {$distro_codename}-updates',] #lint:ignore:single_quote_string_with_variables + } + default: { + fail('Please explicitly specify unattended_upgrades::legacy_origin and unattended_upgrades::origins') + } + } +} -- cgit v1.2.3