]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Merge pull request #1013 from mpdude/patch-3
authorLukas Audzevicius <97180854+LukasAud@users.noreply.github.com>
Mon, 7 Feb 2022 11:26:31 +0000 (11:26 +0000)
committerGitHub <noreply@github.com>
Mon, 7 Feb 2022 11:26:31 +0000 (11:26 +0000)
Omit empty options in source.list template to fix MODULES-11174

manifests/ppa.pp
manifests/source.pp

index 311f81df0e79d72b309e5edd303c00a4f63fbe3c..accf0fc4bc53250f383f8d0a01a07115397c74d5 100644 (file)
@@ -55,7 +55,8 @@ define apt::ppa(
 
   $sources_list_d_filename  = "${dash_filename_no_specialchars}-${release}.list"
 
-  if versioncmp($facts['os']['release']['full'], '15.10') >= 0 {
+  if versioncmp($facts['os']['release']['full'], '15.10') >= 0 and
+    versioncmp($facts['os']['release']['full'], '21.04') < 0 {
     $trusted_gpg_d_filename = "${underscore_filename_no_specialchars}.gpg"
   } else {
     $trusted_gpg_d_filename = "${dash_filename_no_specialchars}.gpg"
index 4e14d8a0a53d95afb9cac6d300d1119904809a08..be5b1c475253758aa1bd9799dd53df7b3e8fabf2 100644 (file)
@@ -125,11 +125,17 @@ define apt::source(
 
   $header = epp('apt/_header.epp')
 
+  if $architecture {
+    $_architecture = regsubst($architecture, '\baarch64\b', 'arm64')
+  } else {
+    $_architecture = undef
+  }
+
   $sourcelist = epp('apt/source.list.epp', {
     'comment'          => $comment,
     'includes'         => $includes,
     'options'          => delete_undef_values({
-      'arch'      => $architecture,
+      'arch'      => $_architecture,
       'trusted'   => $allow_unsigned ? {true => "yes", false => undef},
       'signed-by' => $keyring,
     }),