(FM-6273) - Removing Debian 6
[puppet-modules/puppetlabs-apt.git] / manifests / params.pp
1 class apt::params {
2
3   if $::osfamily != 'Debian' {
4     fail('This module only works on Debian or derivatives like Ubuntu')
5   }
6
7   $root           = '/etc/apt'
8   $provider       = '/usr/bin/apt-get'
9   $sources_list   = "${root}/sources.list"
10   $sources_list_d = "${root}/sources.list.d"
11   $conf_d         = "${root}/apt.conf.d"
12   $preferences    = "${root}/preferences"
13   $preferences_d  = "${root}/preferences.d"
14   $keyserver      = 'keyserver.ubuntu.com'
15   $confs          = {}
16   $update         = {}
17   $purge          = {}
18   $proxy          = {}
19   $sources        = {}
20   $keys           = {}
21   $ppas           = {}
22   $pins           = {}
23   $settings       = {}
24
25   $config_files = {
26     'conf'   => {
27       'path' => $conf_d,
28       'ext'  => '',
29     },
30     'pref'   => {
31       'path' => $preferences_d,
32       'ext'  => '.pref',
33     },
34     'list'   => {
35       'path' => $sources_list_d,
36       'ext'  => '.list',
37     }
38   }
39
40   $update_defaults = {
41     'frequency' => 'reluctantly',
42     'loglevel'  => undef,
43     'timeout'   => undef,
44     'tries'     => undef,
45   }
46
47   $proxy_defaults = {
48     'ensure' => undef,
49     'host'   => undef,
50     'port'   => 8080,
51     'https'  => false,
52   }
53
54   $purge_defaults = {
55     'sources.list'   => false,
56     'sources.list.d' => false,
57     'preferences'    => false,
58     'preferences.d'  => false,
59   }
60
61   $source_key_defaults = {
62     'server'  => $keyserver,
63     'options' => undef,
64     'content' => undef,
65     'source'  => undef,
66   }
67
68   $include_defaults = {
69     'deb' => true,
70     'src' => false,
71   }
72
73   case $facts['os']['name']{
74     'Debian': {
75       case $facts['os']['release']['full'] {
76         '6.0': {
77           $backports = {
78             'location' => 'http://httpredir.debian.org/debian-backports',
79             'key'      => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553',
80             'repos'    => 'main contrib non-free',
81           }
82         }
83         default: {
84           $backports = {
85             'location' => 'http://httpredir.debian.org/debian',
86             'key'      => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553',
87             'repos'    => 'main contrib non-free',
88           }
89         }
90       }
91
92       $ppa_options = undef
93       $ppa_package = undef
94
95     }
96     'Ubuntu': {
97       $backports = {
98         'location' => 'http://archive.ubuntu.com/ubuntu',
99         'key'      => '630239CC130E1A7FD81A27B140976EAF437D05B5',
100         'repos'    => 'main universe multiverse restricted',
101       }
102
103       case $facts['os']['release']['full'] {
104         '10.04': {
105           $ppa_options        = undef
106           $ppa_package        = 'python-software-properties'
107         }
108         '12.04': {
109           $ppa_options        = '-y'
110           $ppa_package        = 'python-software-properties'
111         }
112         '14.04', '14.10', '15.04', '15.10': {
113           $ppa_options        = '-y'
114           $ppa_package        = 'software-properties-common'
115         }
116         default: {
117           $ppa_options        = '-y'
118           $ppa_package        = 'python-software-properties'
119         }
120       }
121     }
122     undef: {
123       fail('Unable to determine value for fact os["name"]')
124     }
125     default: {
126       $ppa_options = undef
127       $ppa_package = undef
128       $backports   = undef
129     }
130   }
131 }