annotate modules/apt/manifests/init.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 adf6fe9bbc17
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
386
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
1 # @summary Main class, includes all other classes.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
3 # @see https://docs.puppetlabs.com/references/latest/function.html#createresources for the create resource function
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
5 # @param provider
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
6 # Specifies the provider that should be used by apt::update.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
7 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 # @param keyserver
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 # Specifies a keyserver to provide the GPG key. Valid options: a string containing a domain name or a full URL (http://, https://, or
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 # hkp://).
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 # @param key_options
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 # Specifies the default options for apt::key resources.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
14 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15 # @param ppa_options
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16 # Supplies options to be passed to the `add-apt-repository` command.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
17 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18 # @param ppa_package
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
19 # Names the package that provides the `apt-add-repository` command.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
20 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
21 # @param backports
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
22 # Specifies some of the default parameters used by apt::backports. Valid options: a hash made up from the following keys:
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
23 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
24 # @option backports [String] :location
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
25 # See apt::backports for documentation.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
26 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
27 # @option backports [String] :repos
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
28 # See apt::backports for documentation.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
29 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
30 # @option backports [String] :key
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
31 # See apt::backports for documentation.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
32 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
33 # @param confs
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
34 # Creates new `apt::conf` resources. Valid options: a hash to be passed to the create_resources function linked above.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
35 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
36 # @param update
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
37 # Configures various update settings. Valid options: a hash made up from the following keys:
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
38 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
39 # @option update [String] :frequency
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
40 # Specifies how often to run `apt-get update`. If the exec resource `apt_update` is notified, `apt-get update` runs regardless of this value.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
41 # Valid options: 'always' (at every Puppet run); 'daily' (if the value of `apt_update_last_success` is less than current epoch time minus 86400);
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
42 # 'weekly' (if the value of `apt_update_last_success` is less than current epoch time minus 604800); and 'reluctantly' (only if the exec resource
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
43 # `apt_update` is notified). Default: 'reluctantly'.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
44 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
45 # @option update [Integer] :loglevel
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
46 # Specifies the log level of logs outputted to the console. Default: undef.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
47 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
48 # @option update [Integer] :timeout
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
49 # Specifies how long to wait for the update to complete before canceling it. Valid options: an integer, in seconds. Default: undef.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
50 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
51 # @option update [Integer] :tries
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
52 # Specifies how many times to retry the update after receiving a DNS or HTTP error. Default: undef.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
53 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
54 # @param purge
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
55 # Specifies whether to purge any existing settings that aren't managed by Puppet. Valid options: a hash made up from the following keys:
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
56 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
57 # @option purge [Boolean] :sources.list
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
58 # Specifies whether to purge any unmanaged entries from sources.list. Default false.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
59 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
60 # @option purge [Boolean] :sources.list.d
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
61 # Specifies whether to purge any unmanaged entries from sources.list.d. Default false.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
62 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
63 # @option purge [Boolean] :preferences
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
64 # Specifies whether to purge any unmanaged entries from preferences. Default false.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
65 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
66 # @option purge [Boolean] :preferences.d.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
67 # Specifies whether to purge any unmanaged entries from preferences.d. Default false.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
68 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
69 # @param proxy
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
70 # Configures Apt to connect to a proxy server. Valid options: a hash matching the locally defined type apt::proxy.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
71 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
72 # @param sources
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
73 # Creates new `apt::source` resources. Valid options: a hash to be passed to the create_resources function linked above.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
74 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
75 # @param keys
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
76 # Creates new `apt::key` resources. Valid options: a hash to be passed to the create_resources function linked above.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
77 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
78 # @param ppas
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
79 # Creates new `apt::ppa` resources. Valid options: a hash to be passed to the create_resources function linked above.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
80 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
81 # @param pins
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
82 # Creates new `apt::pin` resources. Valid options: a hash to be passed to the create_resources function linked above.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
83 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
84 # @param settings
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
85 # Creates new `apt::setting` resources. Valid options: a hash to be passed to the create_resources function linked above.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
86 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
87 # @param manage_auth_conf
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
88 # Specifies whether to manage the /etc/apt/auth.conf file. When true, the file will be overwritten with the entries specified in
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
89 # the auth_conf_entries parameter. When false, the file will be ignored (note that this does not set the file to absent.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
90 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
91 # @param auth_conf_entries
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
92 # An optional array of login configuration settings (hashes) that are recorded in the file /etc/apt/auth.conf. This file has a netrc-like
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
93 # format (similar to what curl uses) and contains the login configuration for APT sources and proxies that require authentication. See
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
94 # https://manpages.debian.org/testing/apt/apt_auth.conf.5.en.html for details. If specified each hash must contain the keys machine, login and
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
95 # password and no others. Specifying manage_auth_conf and not specifying this parameter will set /etc/apt/auth.conf to absent.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
96 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
97 # @param auth_conf_owner
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
98 # The owner of the file /etc/apt/auth.conf. Default: '_apt' or 'root' on old releases.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
99 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
100 # @param root
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
101 # Specifies root directory of Apt executable.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
102 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
103 # @param sources_list
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
104 # Specifies the path of the sources_list file to use.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
105 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
106 # @param sources_list_d
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
107 # Specifies the path of the sources_list.d file to use.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
108 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
109 # @param conf_d
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
110 # Specifies the path of the conf.d file to use.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
111 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
112 # @param preferences
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
113 # Specifies the path of the preferences file to use.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
114 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
115 # @param preferences_d
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
116 # Specifies the path of the preferences.d file to use.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
117 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
118 # @param config_files
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
119 # A hash made up of the various configuration files used by Apt.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
120 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
121 # @param sources_list_force
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
122 # Specifies whether to perform force purge or delete. Default false.
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
123 #
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
124 class apt (
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
125 Hash $update_defaults = $apt::params::update_defaults,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
126 Hash $purge_defaults = $apt::params::purge_defaults,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
127 Hash $proxy_defaults = $apt::params::proxy_defaults,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
128 Hash $include_defaults = $apt::params::include_defaults,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
129 String $provider = $apt::params::provider,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
130 String $keyserver = $apt::params::keyserver,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
131 Optional[String] $key_options = $apt::params::key_options,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
132 Optional[String] $ppa_options = $apt::params::ppa_options,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
133 Optional[String] $ppa_package = $apt::params::ppa_package,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
134 Optional[Hash] $backports = $apt::params::backports,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
135 Hash $confs = $apt::params::confs,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
136 Hash $update = $apt::params::update,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
137 Hash $purge = $apt::params::purge,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
138 Apt::Proxy $proxy = $apt::params::proxy,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
139 Hash $sources = $apt::params::sources,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
140 Hash $keys = $apt::params::keys,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
141 Hash $ppas = $apt::params::ppas,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
142 Hash $pins = $apt::params::pins,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
143 Hash $settings = $apt::params::settings,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
144 Boolean $manage_auth_conf = $apt::params::manage_auth_conf,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
145 Array[Apt::Auth_conf_entry]
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
146 $auth_conf_entries = $apt::params::auth_conf_entries,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
147 String $auth_conf_owner = $apt::params::auth_conf_owner,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
148 String $root = $apt::params::root,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
149 String $sources_list = $apt::params::sources_list,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
150 String $sources_list_d = $apt::params::sources_list_d,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
151 String $conf_d = $apt::params::conf_d,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
152 String $preferences = $apt::params::preferences,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
153 String $preferences_d = $apt::params::preferences_d,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
154 String $apt_conf_d = $apt::params::apt_conf_d,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
155 Hash $config_files = $apt::params::config_files,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
156 Boolean $sources_list_force = $apt::params::sources_list_force,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
157
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
158 Hash $source_key_defaults = {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
159 'server' => $keyserver,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
160 'options' => undef,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
161 'content' => undef,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
162 'source' => undef,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
163 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
164
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
165 ) inherits apt::params {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
166
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
167 if $facts['os']['family'] != 'Debian' {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
168 fail('This module only works on Debian or derivatives like Ubuntu')
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
169 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
170
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
171 if $update['frequency'] {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
172 assert_type(
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
173 Enum['always','daily','weekly','reluctantly'],
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
174 $update['frequency'],
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
175 )
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
176 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
177 if $update['timeout'] {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
178 assert_type(Integer, $update['timeout'])
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
179 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
180 if $update['tries'] {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
181 assert_type(Integer, $update['tries'])
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
182 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
183
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
184 $_update = merge($::apt::update_defaults, $update)
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
185 include ::apt::update
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
186
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
187 if $purge['sources.list'] {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
188 assert_type(Boolean, $purge['sources.list'])
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
189 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
190 if $purge['sources.list.d'] {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
191 assert_type(Boolean, $purge['sources.list.d'])
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
192 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
193 if $purge['preferences'] {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
194 assert_type(Boolean, $purge['preferences'])
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
195 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
196 if $purge['preferences.d'] {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
197 assert_type(Boolean, $purge['preferences.d'])
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
198 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
199 if $sources_list_force {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
200 assert_type(Boolean, $sources_list_force)
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
201 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
202 if $purge['apt.conf.d'] {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
203 assert_type(Boolean, $purge['apt.conf.d'])
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
204 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
205
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
206 $_purge = merge($::apt::purge_defaults, $purge)
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
207
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
208 if $proxy['perhost'] {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
209 $_perhost = $proxy['perhost'].map |$item| {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
210 $_item = merge($apt::proxy_defaults, $item)
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
211 $_scheme = $_item['https'] ? {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
212 true => 'https',
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
213 default => 'http' }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
214 $_port = $_item['port'] ? {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
215 Integer => ":${_item['port']}",
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
216 default => ''
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
217 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
218 $_target = $_item['direct'] ? {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
219 true => 'DIRECT',
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
220 default => "${_scheme}://${_item['host']}${_port}/" }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
221 merge($item, {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
222 'scheme' => $_scheme,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
223 'target' => $_target })
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
224 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
225 } else {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
226 $_perhost = {}
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
227 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
228
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
229 $_proxy = merge($apt::proxy_defaults, $proxy, { 'perhost' => $_perhost } )
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
230
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
231 $confheadertmp = epp('apt/_conf_header.epp')
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
232 $proxytmp = epp('apt/proxy.epp', {'proxies' => $_proxy})
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
233 $updatestamptmp = epp('apt/15update-stamp.epp')
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
234
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
235 if $_proxy['ensure'] == 'absent' or $_proxy['host'] {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
236 apt::setting { 'conf-proxy':
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
237 ensure => $_proxy['ensure'],
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
238 priority => '01',
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
239 content => "${confheadertmp}${proxytmp}",
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
240 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
241 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
242
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
243 if $sources_list_force {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
244 $sources_list_ensure = $_purge['sources.list'] ? {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
245 true => absent,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
246 default => file,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
247 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
248 $sources_list_content = $_purge['sources.list'] ? {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
249 true => nil,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
250 default => undef,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
251 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
252 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
253 else
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
254 {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
255 $sources_list_ensure = $_purge['sources.list'] ? {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
256 true => file,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
257 default => file,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
258 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
259 $sources_list_content = $_purge['sources.list'] ? {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
260 true => "# Repos managed by puppet.\n",
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
261 default => undef,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
262 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
263 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
264
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
265 $preferences_ensure = $_purge['preferences'] ? {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
266 true => absent,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
267 default => file,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
268 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
269
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
270 if $_update['frequency'] == 'always' {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
271 Exec <| title=='apt_update' |> {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
272 refreshonly => false,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
273 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
274 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
275
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
276 apt::setting { 'conf-update-stamp':
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
277 priority => 15,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
278 content => "${confheadertmp}${updatestamptmp}",
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
279 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
280
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
281 file { 'sources.list':
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
282 ensure => $sources_list_ensure,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
283 path => $::apt::sources_list,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
284 owner => root,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
285 group => root,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
286 content => $sources_list_content,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
287 notify => Class['apt::update'],
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
288 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
289
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
290 file { 'sources.list.d':
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
291 ensure => directory,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
292 path => $::apt::sources_list_d,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
293 owner => root,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
294 group => root,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
295 purge => $_purge['sources.list.d'],
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
296 recurse => $_purge['sources.list.d'],
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
297 notify => Class['apt::update'],
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
298 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
299
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
300 file { 'preferences':
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
301 ensure => $preferences_ensure,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
302 path => $::apt::preferences,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
303 owner => root,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
304 group => root,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
305 notify => Class['apt::update'],
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
306 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
307
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
308 file { 'preferences.d':
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
309 ensure => directory,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
310 path => $::apt::preferences_d,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
311 owner => root,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
312 group => root,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
313 purge => $_purge['preferences.d'],
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
314 recurse => $_purge['preferences.d'],
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
315 notify => Class['apt::update'],
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
316 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
317
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
318 file { 'apt.conf.d':
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
319 ensure => directory,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
320 path => $::apt::apt_conf_d,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
321 owner => root,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
322 group => root,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
323 purge => $_purge['apt.conf.d'],
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
324 recurse => $_purge['apt.conf.d'],
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
325 notify => Class['apt::update'],
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
326 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
327
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
328 if $confs {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
329 create_resources('apt::conf', $confs)
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
330 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
331 # manage sources if present
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
332 if $sources {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
333 create_resources('apt::source', $sources)
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
334 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
335 # manage keys if present
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
336 if $keys {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
337 create_resources('apt::key', $keys)
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
338 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
339 # manage ppas if present
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
340 if $ppas {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
341 create_resources('apt::ppa', $ppas)
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
342 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
343 # manage settings if present
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
344 if $settings {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
345 create_resources('apt::setting', $settings)
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
346 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
347
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
348 if $manage_auth_conf {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
349 $auth_conf_ensure = $auth_conf_entries ? {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
350 [] => 'absent',
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
351 default => 'present',
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
352 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
353
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
354 $auth_conf_tmp = epp('apt/auth_conf.epp')
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
355
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
356 file { '/etc/apt/auth.conf':
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
357 ensure => $auth_conf_ensure,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
358 owner => $auth_conf_owner,
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
359 group => 'root',
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
360 mode => '0600',
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
361 content => Sensitive("${confheadertmp}${auth_conf_tmp}"),
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
362 notify => Class['apt::update'],
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
363 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
364 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
365
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
366 # manage pins if present
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
367 if $pins {
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
368 create_resources('apt::pin', $pins)
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
369 }
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
370
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
371 # required for adding GPG keys on Debian 9 (and derivatives)
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
372 ensure_packages(['gnupg'])
3fce34f642f1 Add a PHP module to handle platform differences
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
373 }