]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/blob - manifests/params.pp
Remove backports and debian
[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     'debian': {
41       case $distcodename {
42         'squeeze': {
43           $legacy_origin       = true
44           $origins             = ['${distro_id} oldstable', #lint:ignore:single_quote_string_with_variables
45                                   '${distro_id} ${distro_codename}-security', #lint:ignore:single_quote_string_with_variables
46                                   '${distro_id} ${distro_codename}-lts'] #lint:ignore:single_quote_string_with_variables
47         }
48         'wheezy': {
49           $legacy_origin      = false
50           $origins            = ['origin=Debian,archive=stable,label=Debian-Security',
51                                   'origin=Debian,archive=oldstable,label=Debian-Security']
52         }
53         default: {
54           $legacy_origin      = false
55           $origins            = ['origin=Debian,archive=stable,label=Debian-Security']
56         }
57       }
58     }
59     'ubuntu': {
60       case $distcodename {
61         'lucid': {
62           $ppa_options        = undef
63           $legacy_origin      = true
64           $origins            = ['${distro_id} ${distro_codename}-security'] #lint:ignore:single_quote_string_with_variables
65         }
66         'precise', 'trusty', 'utopic', 'vivid': {
67           $ppa_options        = '-y'
68           $legacy_origin      = true
69           $origins            = ['${distro_id}:${distro_codename}-security'] #lint:ignore:single_quote_string_with_variables
70         }
71         default: {
72           $ppa_options        = '-y'
73           $legacy_origin      = true
74           $origins            = ['${distro_id}:${distro_codename}-security'] #lint:ignore:single_quote_string_with_variables
75         }
76       }
77     }
78   }
79 }