summaryrefslogtreecommitdiff
path: root/manifests/params.pp
blob: 046da459a5b3bcbaa80b345d1930bc0fe4dbf70e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#
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, 'reboot_time' => 'now', }
  $default_mail                 = { 'only_on_error'        => true, }
  $default_backup               = { 'archive_interval'     => 0, 'level'     => 3, }
  $default_age                  = { 'min'                  => 2, 'max'       => 0, }
  $default_upgradeable_packages = { 'download_only'        => 0, 'debdelta'  => 1, }
  $default_options              = { 'force_confdef'        => true,
                                    'force_confold'        => true,
                                    'force_confnew'        => false,
                                    'force_confmiss'       => false, }
  # prior to puppet 3.5.0, defined couldn't test if a variable was defined
  # strict variables wasn't added until 3.5.0, so this should be fine.
  if ! $::settings::strict_variables {
    $xfacts = {
      'lsbdistid'           => $::lsbdistid,
      'lsbdistcodename'     => $::lsbdistcodename,
      'lsbmajdistrelease'   => $::lsbmajdistrelease,
    }
  } else {
    # Strict variables facts lookup compatibility
    $xfacts = {
      'lsbdistid' => defined('$lsbdistid') ? {
        true    => $::lsbdistid,
        default => undef,
      },
      'lsbdistcodename' => defined('$lsbdistcodename') ? {
        true    => $::lsbdistcodename,
        default => undef,
      },
      'lsbmajdistrelease' => defined('$lsbmajdistrelease') ? {
        true    => $::lsbmajdistrelease,
        default => undef,
      },
    }
  }

  case $xfacts['lsbdistid'] {
    'debian', 'raspbian': {
      case $xfacts['lsbdistcodename'] {
        'squeeze': {
          $legacy_origin       = true
          $origins             = ['${distro_id} oldoldstable', #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
        }
        'wheezy': {
          $legacy_origin      = false
          $origins            = [
            'origin=Debian,archive=stable,label=Debian-Security',
            'origin=Debian,archive=oldstable,label=Debian-Security',
          ]
        }
        default: {
          $legacy_origin      = false
          $origins            = ['origin=Debian,codename=${distro_codename},label=Debian-Security',] #lint:ignore:single_quote_string_with_variables
        }
      }
    }
    'ubuntu': {
      # TODO do we really want to pull in ${distro_codename}-updates by default?
      case $xfacts['lsbdistcodename'] {
        'precise': {
          $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
          ]

        }
        'trusty', 'utopic', 'vivid', 'wily': {
          $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: {
          $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
          ]
        }
      }
    }
    'LinuxMint': {
      case $xfacts['lsbmajdistrelease'] {
        # Linux Mint 13 is based on Ubuntu 12.04
        '13': {
          $legacy_origin      = true
          $origins            = [
            'Ubuntu:precise-security',
          ]
        }
        # Linux Mint 17* is based on Ubuntu 14.04.
        '17': {
          $legacy_origin      = true
          $origins            = [
            'Ubuntu:trusty-security',
          ]
        }
        # Linux Mint 18* is based on Ubuntu 16.04
        '18': {
          $legacy_origin      = true
          $origins            = [
            'Ubuntu:xenial-security',
          ]
        }
        default: {
          $legacy_origin      = true
          $origins            = [
            '${distro_id}:${distro_codename}-security', #lint:ignore:single_quote_string_with_variables
          ]
        }
      }
    }
    default: {
      $legacy_origin = undef
      $origins       = undef
    }
  }
}