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