Mercurial > repos > other > Puppet
comparison modules/apt/manifests/params.pp @ 386:3fce34f642f1
Add a PHP module to handle platform differences
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 03 Jan 2022 17:09:39 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
385:d9009f54eb23 | 386:3fce34f642f1 |
---|---|
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 if versioncmp($facts['os']['release']['major'], '9') >= 0 { | |
88 $auth_conf_owner = '_apt' | |
89 } else { | |
90 $auth_conf_owner = 'root' | |
91 } | |
92 } | |
93 'Ubuntu': { | |
94 $backports = { | |
95 'location' => 'http://archive.ubuntu.com/ubuntu', | |
96 'key' => '630239CC130E1A7FD81A27B140976EAF437D05B5', | |
97 'repos' => 'main universe multiverse restricted', | |
98 } | |
99 $ppa_options = '-y' | |
100 $ppa_package = 'software-properties-common' | |
101 if versioncmp($facts['os']['release']['full'], '16.04') >= 0 { | |
102 $auth_conf_owner = '_apt' | |
103 } else { | |
104 $auth_conf_owner = 'root' | |
105 } | |
106 } | |
107 undef: { | |
108 fail('Unable to determine value for fact os[\"name\"]') | |
109 } | |
110 default: { | |
111 $ppa_options = undef | |
112 $ppa_package = undef | |
113 $backports = undef | |
114 $auth_conf_owner = 'root' | |
115 } | |
116 } | |
117 } |