Skip to content

Commit 3b851b6

Browse files
committed
(CAT-2511) Address sles box misconfigurations
Addressing misconfigurations in the SLES box to ensure proper setup for CI.
1 parent e627cdb commit 3b851b6

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

manifests/init.pp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,17 @@
110110
default => '--jre'
111111
}
112112

113-
# If the OS is SLES >= 15.3, enable the legacy repo to install net-tools-deprecated package
114-
if ($facts['os']['family'] in ['SLES', 'SUSE']) and (versioncmp($facts['os']['release']['full'], '15.3') >= 0) {
115-
exec { 'Enable legacy repos':
116-
path => '/bin:/usr/bin/:/sbin:/usr/sbin',
117-
command => "SUSEConnect --product sle-module-legacy/${facts['os']['release']['full']}/x86_64",
118-
unless => "SUSEConnect --status-text | grep sle-module-legacy/${facts['os']['release']['full']}/x86_64",
113+
# TEMPORARY FIX: If no repos are configured on SLES, add openSUSE Leap as fallback
114+
# This workaround is needed because GCP-provisioned SLES images are unregistered BYOS
115+
# without any package repositories configured. Remove this once proper PAYG images are used.
116+
if ($facts['os']['family'] in ['SLES', 'SUSE']) {
117+
exec { 'Configure zypper repo for SLES':
118+
path => '/bin:/usr/bin:/sbin:/usr/sbin',
119+
command => 'zypper --non-interactive --gpg-auto-import-keys ar http://download.opensuse.org/distribution/leap/15.6/repo/oss/ opensuse-leap-fallback && zypper --non-interactive --gpg-auto-import-keys refresh',
120+
unless => "zypper lr 2>/dev/null | grep -q 'opensuse-leap-fallback\\|http'",
121+
logoutput => true,
119122
}
123+
-> Package['java']
120124
}
121125

122126
if $facts['os']['family'] == 'Debian' {

0 commit comments

Comments
 (0)