Merge pull request #429 from mhaskel/remove_include_update
[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   = "${root}/sources.list"
5   $sources_list_d = "${root}/sources.list.d"
6   $conf_d         = "${root}/apt.conf.d"
7   $preferences    = "${root}/preferences"
8   $preferences_d  = "${root}/preferences.d"
9
10   if $::osfamily != 'Debian' {
11     fail('This module only works on Debian or derivatives like Ubuntu')
12   }
13
14   case $::lsbdistid {
15     'ubuntu', 'debian': {
16       $distid = $::lsbdistid
17       $distcodename = $::lsbdistcodename
18     }
19     'linuxmint': {
20       if $::lsbdistcodename == 'debian' {
21         $distid = 'debian'
22         $distcodename = 'wheezy'
23       } else {
24         $distid = 'ubuntu'
25         $distcodename = $::lsbdistcodename ? {
26           'qiana'  => 'trusty',
27           'petra'  => 'saucy',
28           'olivia' => 'raring',
29           'nadia'  => 'quantal',
30           'maya'   => 'precise',
31         }
32       }
33     }
34     '': {
35       fail('Unable to determine lsbdistid, is lsb-release installed?')
36     }
37     default: {
38       fail("Unsupported lsbdistid (${::lsbdistid})")
39     }
40   }
41   case $distid {
42     'ubuntu': {
43       case $distcodename {
44         'lucid': {
45           $ppa_options        = undef
46         }
47         'precise', 'trusty', 'utopic', 'vivid': {
48           $ppa_options        = '-y'
49         }
50         default: {
51           $ppa_options        = '-y'
52         }
53       }
54     }
55   }
56 }