|
55 | 55 | # @option update [Integer] :tries |
56 | 56 | # Specifies how many times to retry the update after receiving a DNS or HTTP error. Default: undef. |
57 | 57 | # |
| 58 | +# @param update_defaults |
| 59 | +# The default update settings that are combined and merged with the passed `update` value |
| 60 | +# |
58 | 61 | # @param purge |
59 | 62 | # Specifies whether to purge any existing settings that aren't managed by Puppet. Valid options: a hash made up from the following keys: |
60 | 63 | # |
|
70 | 73 | # @option purge [Boolean] :preferences.d. |
71 | 74 | # Specifies whether to purge any unmanaged entries from preferences.d. Default false. |
72 | 75 | # |
| 76 | +# @param purge_defaults |
| 77 | +# The default purge settings that are combined and merged with the passed `purge` value |
| 78 | +# |
73 | 79 | # @param proxy |
74 | 80 | # Configures Apt to connect to a proxy server. Valid options: a hash matching the locally defined type apt::proxy. |
75 | 81 | # |
| 82 | +# @param proxy_defaults |
| 83 | +# The default proxy settings that are combined and merged with the passed `proxy` value |
| 84 | +# |
76 | 85 | # @param sources |
77 | 86 | # Creates new `apt::source` resources. Valid options: a hash to be passed to the create_resources function linked above. |
78 | 87 | # |
|
125 | 134 | # @param sources_list_force |
126 | 135 | # Specifies whether to perform force purge or delete. Default false. |
127 | 136 | # |
| 137 | +# @param include_defaults |
| 138 | +# |
| 139 | +# @param apt_conf_d |
| 140 | +# The path to the file `apt.conf.d` |
| 141 | +# |
| 142 | +# @param source_key_defaults |
| 143 | +# The fault `source_key` settings |
| 144 | +# |
128 | 145 | class apt ( |
129 | 146 | Hash $update_defaults = $apt::params::update_defaults, |
130 | 147 | Hash $purge_defaults = $apt::params::purge_defaults, |
|
183 | 200 | assert_type(Integer, $update['tries']) |
184 | 201 | } |
185 | 202 |
|
186 | | - $_update = merge($::apt::update_defaults, $update) |
187 | | - include ::apt::update |
| 203 | + $_update = merge($apt::update_defaults, $update) |
| 204 | + include apt::update |
188 | 205 |
|
189 | 206 | if $purge['sources.list'] { |
190 | 207 | assert_type(Boolean, $purge['sources.list']) |
|
205 | 222 | assert_type(Boolean, $purge['apt.conf.d']) |
206 | 223 | } |
207 | 224 |
|
208 | | - $_purge = merge($::apt::purge_defaults, $purge) |
| 225 | + $_purge = merge($apt::purge_defaults, $purge) |
209 | 226 |
|
210 | 227 | if $proxy['perhost'] { |
211 | 228 | $_perhost = $proxy['perhost'].map |$item| { |
212 | 229 | $_item = merge($apt::proxy_defaults, $item) |
213 | 230 | $_scheme = $_item['https'] ? { |
214 | 231 | true => 'https', |
215 | | - default => 'http' } |
| 232 | + default => 'http', |
| 233 | + } |
216 | 234 | $_port = $_item['port'] ? { |
217 | 235 | Integer => ":${_item['port']}", |
218 | 236 | default => '' |
219 | 237 | } |
220 | 238 | $_target = $_item['direct'] ? { |
221 | 239 | true => 'DIRECT', |
222 | | - default => "${_scheme}://${_item['host']}${_port}/" } |
| 240 | + default => "${_scheme}://${_item['host']}${_port}/", |
| 241 | + } |
223 | 242 | merge($item, { |
224 | | - 'scheme' => $_scheme, |
225 | | - 'target' => $_target }) |
| 243 | + 'scheme' => $_scheme, |
| 244 | + 'target' => $_target, |
| 245 | + } |
| 246 | + ) |
226 | 247 | } |
227 | 248 | } else { |
228 | 249 | $_perhost = {} |
|
260 | 281 | true => "# Repos managed by puppet.\n", |
261 | 282 | default => undef, |
262 | 283 | } |
263 | | - } |
| 284 | + } |
264 | 285 |
|
265 | 286 | $preferences_ensure = $_purge['preferences'] ? { |
266 | 287 | true => absent, |
|
274 | 295 |
|
275 | 296 | file { 'sources.list': |
276 | 297 | ensure => $sources_list_ensure, |
277 | | - path => $::apt::sources_list, |
| 298 | + path => $apt::sources_list, |
278 | 299 | owner => root, |
279 | 300 | group => root, |
280 | 301 | content => $sources_list_content, |
|
283 | 304 |
|
284 | 305 | file { 'sources.list.d': |
285 | 306 | ensure => directory, |
286 | | - path => $::apt::sources_list_d, |
| 307 | + path => $apt::sources_list_d, |
287 | 308 | owner => root, |
288 | 309 | group => root, |
289 | 310 | purge => $_purge['sources.list.d'], |
|
293 | 314 |
|
294 | 315 | file { 'preferences': |
295 | 316 | ensure => $preferences_ensure, |
296 | | - path => $::apt::preferences, |
| 317 | + path => $apt::preferences, |
297 | 318 | owner => root, |
298 | 319 | group => root, |
299 | 320 | notify => Class['apt::update'], |
300 | 321 | } |
301 | 322 |
|
302 | 323 | file { 'preferences.d': |
303 | 324 | ensure => directory, |
304 | | - path => $::apt::preferences_d, |
| 325 | + path => $apt::preferences_d, |
305 | 326 | owner => root, |
306 | 327 | group => root, |
307 | 328 | purge => $_purge['preferences.d'], |
|
311 | 332 |
|
312 | 333 | file { 'apt.conf.d': |
313 | 334 | ensure => directory, |
314 | | - path => $::apt::apt_conf_d, |
| 335 | + path => $apt::apt_conf_d, |
315 | 336 | owner => root, |
316 | 337 | group => root, |
317 | 338 | purge => $_purge['apt.conf.d'], |
|
0 commit comments