Skip to content

Commit

Permalink
Switch from merge() to native puppet
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasAud authored and bastelfreak committed Jun 5, 2023
1 parent 371eab3 commit 7645e20
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
assert_type(Integer, $update['tries'])
}

$_update = merge($apt::update_defaults, $update)
$_update = $apt::update_defaults + $update
include apt::update

if $purge['sources.list'] {
Expand All @@ -222,11 +222,11 @@
assert_type(Boolean, $purge['apt.conf.d'])
}

$_purge = merge($apt::purge_defaults, $purge)
$_purge = $apt::purge_defaults + $purge

if $proxy['perhost'] {
$_perhost = $proxy['perhost'].map |$item| {
$_item = merge($apt::proxy_defaults, $item)
$_item = $apt::proxy_defaults + $item
$_scheme = $_item['https'] ? {
true => 'https',
default => 'http',
Expand All @@ -239,17 +239,13 @@
true => 'DIRECT',
default => "${_scheme}://${_item['host']}${_port}/",
}
merge($item, {
'scheme' => $_scheme,
'target' => $_target,
}
)
$item + { 'scheme' => $_scheme, 'target' => $_target, }
}
} else {
$_perhost = {}
}

$_proxy = merge($apt::proxy_defaults, $proxy, { 'perhost' => $_perhost })
$_proxy = $apt::proxy_defaults + $proxy + { 'perhost' => $_perhost }

$confheadertmp = epp('apt/_conf_header.epp')
$proxytmp = epp('apt/proxy.epp', { 'proxies' => $_proxy })
Expand Down

0 comments on commit 7645e20

Please sign in to comment.