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