Omit empty options in source.list template to fix MODULES-11174
$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"
$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,
}),