ae656dbf8f7fde2a8eb5f8c0b94cacf1b629661b
[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 $facts['os']['family'] != '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_force   = false
15   $sources_list_d       = "${root}/sources.list.d"
16   $trusted_gpg_d        = "${root}/trusted.gpg.d"
17   $conf_d               = "${root}/apt.conf.d"
18   $preferences          = "${root}/preferences"
19   $preferences_d        = "${root}/preferences.d"
20   $apt_conf_d           = "${root}/apt.conf.d"
21   $keyserver            = 'keyserver.ubuntu.com'
22   $key_options          = undef
23   $confs                = {}
24   $update               = {}
25   $purge                = {}
26   $proxy                = {}
27   $sources              = {}
28   $keys                 = {}
29   $ppas                 = {}
30   $pins                 = {}
31   $settings             = {}
32   $manage_auth_conf     = true
33   $auth_conf_entries    = []
34
35   $config_files = {
36     'conf'   => {
37       'path' => $conf_d,
38       'ext'  => '',
39     },
40     'pref'   => {
41       'path' => $preferences_d,
42       'ext'  => '.pref',
43     },
44     'list'   => {
45       'path' => $sources_list_d,
46       'ext'  => '.list',
47     }
48   }
49
50   $update_defaults = {
51     'frequency' => 'reluctantly',
52     'loglevel'  => undef,
53     'timeout'   => undef,
54     'tries'     => undef,
55   }
56
57   $proxy_defaults = {
58     'ensure'     => undef,
59     'host'       => undef,
60     'port'       => 8080,
61     'https'      => false,
62     'https_acng' => false,
63     'direct'     => false,
64   }
65
66   $purge_defaults = {
67     'sources.list'   => false,
68     'sources.list.d' => false,
69     'preferences'    => false,
70     'preferences.d'  => false,
71     'apt.conf.d'     => false,
72   }
73
74   $include_defaults = {
75     'deb' => true,
76     'src' => false,
77   }
78
79   case $facts['os']['name']{
80     'Debian': {
81           $backports = {
82             'location' => 'http://deb.debian.org/debian',
83             'repos'    => 'main contrib non-free',
84           }
85       $ppa_options = undef
86       $ppa_package = undef
87       $auth_conf_owner = '_apt'
88     }
89     'Ubuntu': {
90       $backports = {
91         'location' => 'http://archive.ubuntu.com/ubuntu',
92         'key'      => '630239CC130E1A7FD81A27B140976EAF437D05B5',
93         'repos'    => 'main universe multiverse restricted',
94       }
95       $ppa_options        = '-y'
96       $ppa_package        = 'software-properties-common'
97       $auth_conf_owner = '_apt'
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       $auth_conf_owner = 'root'
107     }
108   }
109 }