(FM-7318) - Added Puppet Strings formatting to documentation
[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('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   $keyserver      = 'keyserver.ubuntu.com'
20   $confs          = {}
21   $update         = {}
22   $purge          = {}
23   $proxy          = {}
24   $sources        = {}
25   $keys           = {}
26   $ppas           = {}
27   $pins           = {}
28   $settings       = {}
29   $auth_conf_entries = []
30
31   $config_files = {
32     'conf'   => {
33       'path' => $conf_d,
34       'ext'  => '',
35     },
36     'pref'   => {
37       'path' => $preferences_d,
38       'ext'  => '.pref',
39     },
40     'list'   => {
41       'path' => $sources_list_d,
42       'ext'  => '.list',
43     }
44   }
45
46   $update_defaults = {
47     'frequency' => 'reluctantly',
48     'loglevel'  => undef,
49     'timeout'   => undef,
50     'tries'     => undef,
51   }
52
53   $proxy_defaults = {
54     'ensure' => undef,
55     'host'   => undef,
56     'port'   => 8080,
57     'https'  => false,
58     'direct' => false,
59   }
60
61   $purge_defaults = {
62     'sources.list'   => false,
63     'sources.list.d' => false,
64     'preferences'    => false,
65     'preferences.d'  => false,
66   }
67
68   $source_key_defaults = {
69     'server'  => $keyserver,
70     'options' => undef,
71     'content' => undef,
72     'source'  => undef,
73   }
74
75   $include_defaults = {
76     'deb' => true,
77     'src' => false,
78   }
79
80   case $facts['os']['name']{
81     'Debian': {
82           $backports = {
83             'location' => 'http://deb.debian.org/debian',
84             'key'      => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553',
85             'repos'    => 'main contrib non-free',
86           }
87       $ppa_options = undef
88       $ppa_package = undef
89     }
90     'Ubuntu': {
91       $backports = {
92         'location' => 'http://archive.ubuntu.com/ubuntu',
93         'key'      => '630239CC130E1A7FD81A27B140976EAF437D05B5',
94         'repos'    => 'main universe multiverse restricted',
95       }
96       $ppa_options        = '-y'
97       $ppa_package        = 'software-properties-common'
98     }
99     undef: {
100       fail('Unable to determine value for fact os["name"]')
101     }
102     default: {
103       $ppa_options = undef
104       $ppa_package = undef
105       $backports   = undef
106     }
107   }
108 }