Release prep v9.1.0
[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   if $facts['os']['family'] != 'Debian' {
7     fail('This module only works on Debian or derivatives like Ubuntu')
8   }
9
10   $root                 = '/etc/apt'
11   $provider             = '/usr/bin/apt-get'
12   $sources_list         = "${root}/sources.list"
13   $sources_list_force   = false
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   $include_defaults = {
74     'deb' => true,
75     'src' => false,
76   }
77
78   case $facts['os']['name'] {
79     'Debian': {
80       $backports = {
81         'location' => 'http://deb.debian.org/debian',
82         'repos'    => 'main contrib non-free',
83       }
84       $ppa_options = undef
85       $ppa_package = undef
86       $auth_conf_owner = '_apt'
87     }
88     'Ubuntu': {
89       $backports = {
90         'location' => 'http://archive.ubuntu.com/ubuntu',
91         'key'      => '630239CC130E1A7FD81A27B140976EAF437D05B5',
92         'repos'    => 'main universe multiverse restricted',
93       }
94       $ppa_options        = ['-y']
95       $ppa_package        = 'software-properties-common'
96       $auth_conf_owner = '_apt'
97     }
98     undef: {
99       fail('Unable to determine value for fact os[\"name\"]')
100     }
101     default: {
102       $ppa_options = undef
103       $ppa_package = undef
104       $backports   = undef
105       $auth_conf_owner = 'root'
106     }
107   }
108 }