summaryrefslogtreecommitdiff
path: root/manifests/params.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/params.pp')
-rw-r--r--manifests/params.pp50
1 files changed, 50 insertions, 0 deletions
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')
+ }
+ }
+}