diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2cdfc30f..6801412f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,5 +15,5 @@ jobs: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" with: - flags: "--nightly" + flags: "--platform-include sles-15 --platform-include sles-12" secrets: "inherit" diff --git a/manifests/init.pp b/manifests/init.pp index 31750303..ce5dcb9a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -110,13 +110,17 @@ default => '--jre' } - # If the OS is SLES >= 15.3, enable the legacy repo to install net-tools-deprecated package - if ($facts['os']['family'] in ['SLES', 'SUSE']) and (versioncmp($facts['os']['release']['full'], '15.3') >= 0) { - exec { 'Enable legacy repos': - path => '/bin:/usr/bin/:/sbin:/usr/sbin', - command => "SUSEConnect --product sle-module-legacy/${facts['os']['release']['full']}/x86_64", - unless => "SUSEConnect --status-text | grep sle-module-legacy/${facts['os']['release']['full']}/x86_64", + # TEMPORARY FIX: If no repos are configured on SLES, add openSUSE Leap as fallback + # This workaround is needed because GCP-provisioned SLES images are unregistered BYOS + # without any package repositories configured. Remove this once proper PAYG images are used. + if ($facts['os']['family'] in ['SLES', 'SUSE']) { + exec { 'Configure zypper repo for SLES': + path => '/bin:/usr/bin:/sbin:/usr/sbin', + 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', + unless => "zypper lr 2>/dev/null | grep -q 'opensuse-leap-fallback\\|http'", + logoutput => true, } + -> Package['java'] } if $facts['os']['family'] == 'Debian' {