Skip to content

Commit

Permalink
Merge pull request #1113 from bastelfreak/pdksync_CONT-1028-update-st…
Browse files Browse the repository at this point in the history
…dlib-dependency

(CONT-1028) puppetlabs/stdlib: Allow 9.x
  • Loading branch information
LukasAud authored Jun 5, 2023
2 parents 91c8762 + c0b8640 commit 6c53cb7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 19 deletions.
18 changes: 7 additions & 11 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 Expand Up @@ -386,12 +382,12 @@
case $facts['os']['name'] {
'Debian': {
if versioncmp($facts['os']['release']['major'], '9') >= 0 {
ensure_packages(['gnupg'])
stdlib::ensure_packages(['gnupg'])
}
}
'Ubuntu': {
if versioncmp($facts['os']['release']['full'], '17.04') >= 0 {
ensure_packages(['gnupg'])
stdlib::ensure_packages(['gnupg'])
}
}
default: {
Expand Down
4 changes: 2 additions & 2 deletions manifests/key.pp
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@
case $facts['os']['name'] {
'Debian': {
if versioncmp($facts['os']['release']['major'], '9') >= 0 {
ensure_packages(['gnupg'])
stdlib::ensure_packages(['gnupg'])
Apt::Key<| title == $title |>
}
}
'Ubuntu': {
if versioncmp($facts['os']['release']['full'], '17.04') >= 0 {
ensure_packages(['gnupg'])
stdlib::ensure_packages(['gnupg'])
Apt::Key<| title == $title |>
}
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/ppa.pp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@

if $ensure == 'present' {
if $package_manage {
ensure_packages($package_name)
stdlib::ensure_packages($package_name)
$_require = [File['sources.list.d'], Package[$package_name]]
} else {
$_require = File['sources.list.d']
Expand Down
8 changes: 4 additions & 4 deletions manifests/source.pp
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@
# Newer oses, do not need the package for HTTPS transport.
$_transport_https_releases = ['9']
if (fact('os.release.major') in $_transport_https_releases) and $_location =~ /(?i:^https:\/\/)/ {
ensure_packages('apt-transport-https')
stdlib::ensure_packages('apt-transport-https')
Package['apt-transport-https'] -> Class['apt::update']
}
} else {
$_location = undef
}

$includes = merge($apt::include_defaults, $include)
$includes = $apt::include_defaults + $include

if $key and $keyring {
fail('parameters key and keyring are mutualy exclusive')
Expand All @@ -125,7 +125,7 @@
unless $key['id'] {
fail('key hash must contain at least an id entry')
}
$_key = merge($apt::source_key_defaults, $key)
$_key = $apt::source_key_defaults + $key
} else {
$_key = { 'id' => assert_type(String[1], $key) }
}
Expand Down Expand Up @@ -164,7 +164,7 @@

if $pin {
if $pin =~ Hash {
$_pin = merge($pin, { 'ensure' => $ensure, 'before' => $_before })
$_pin = $pin + { 'ensure' => $ensure, 'before' => $_before }
} elsif ($pin =~ Numeric or $pin =~ String) {
$url_split = split($location, '[:\/]+')
$host = $url_split[1]
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dependencies": [
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 4.16.0 < 9.0.0"
"version_requirement": ">= 4.16.0 < 10.0.0"
}
],
"operatingsystem_support": [
Expand Down

0 comments on commit 6c53cb7

Please sign in to comment.