Merge pull request #1 from puppet-community/daenney/remove_unattended_upgrades_remains
[puppet-modules/puppetlabs-apt.git] / manifests / params.pp
1 class apt::params {
2   $root           = '/etc/apt'
3   $provider       = '/usr/bin/apt-get'
4   $sources_list_d = "${root}/sources.list.d"
5   $apt_conf_d     = "${root}/apt.conf.d"
6   $preferences_d  = "${root}/preferences.d"
7
8   if $::osfamily != 'Debian' {
9     fail('This module only works on Debian or derivatives like Ubuntu')
10   }
11
12   case $::lsbdistid {
13     'ubuntu', 'debian': {
14       $distid = $::lsbdistid
15       $distcodename = $::lsbdistcodename
16     }
17     'linuxmint': {
18       if $::lsbdistcodename == 'debian' {
19         $distid = 'debian'
20         $distcodename = 'wheezy'
21       } else {
22         $distid = 'ubuntu'
23         $distcodename = $::lsbdistcodename ? {
24           'qiana'  => 'trusty',
25           'petra'  => 'saucy',
26           'olivia' => 'raring',
27           'nadia'  => 'quantal',
28           'maya'   => 'precise',
29         }
30       }
31     }
32     '': {
33       fail('Unable to determine lsbdistid, is lsb-release installed?')
34     }
35     default: {
36       fail("Unsupported lsbdistid (${::lsbdistid})")
37     }
38   }
39   case $distid {
40     'ubuntu': {
41       case $distcodename {
42         'lucid': {
43           $ppa_options        = undef
44         }
45         'precise', 'trusty', 'utopic', 'vivid': {
46           $ppa_options        = '-y'
47         }
48         default: {
49           $ppa_options        = '-y'
50         }
51       }
52     }
53   }
54 }