Skip to content

Commit cebcd85

Browse files
committed
(CAT-2511) Investigate possible sles fixes
Testing possible fixes for SLES failures.
1 parent 8aa4f50 commit cebcd85

4 files changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ jobs:
1616
Acceptance:
1717
needs: Spec
1818
uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
19+
with:
20+
flags: "--platform-include sles12 --platform-include sles15 --nightly"
1921
secrets: "inherit"

manifests/client.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
Variant[Enum['present', 'absent', 'purged', 'disabled', 'installed', 'latest'], String[1]] $package_ensure = 'present',
1919
) inherits postgresql::params {
2020
if $package_name != 'UNSET' {
21+
# TEMPORARY FIX: Configure fallback repo for unregistered SLES systems
22+
include postgresql::repo::sles_fallback
23+
Class['postgresql::repo::sles_fallback'] -> Package['postgresql-client']
24+
2125
package { 'postgresql-client':
2226
ensure => $package_ensure,
2327
name => $package_name,

manifests/repo/sles_fallback.pp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# @api private
2+
# @summary Configures fallback zypper repository for SLES systems without repos
3+
#
4+
# This class works around an infrastructure issue where GCP-provisioned SLES
5+
# images are unregistered BYOS (Bring Your Own Subscription) instances without
6+
# any configured package repositories. It adds openSUSE Leap 15.6 as a fallback
7+
# repository if no repositories are configured.
8+
#
9+
# This is a temporary workaround and should be removed once proper PAYG images
10+
# or registered SLES systems are used in CI.
11+
#
12+
class postgresql::repo::sles_fallback {
13+
if ($facts['os']['family'] in ['SLES', 'SUSE']) {
14+
exec { 'Configure zypper repo for SLES':
15+
path => '/bin:/usr/bin:/sbin:/usr/sbin',
16+
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',
17+
unless => "zypper lr 2>/dev/null | grep -q 'opensuse-leap-fallback\\|http'",
18+
logoutput => true,
19+
}
20+
}
21+
}

manifests/server/install.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
default => $package_ensure,
1111
}
1212

13+
# TEMPORARY FIX: Configure fallback repo for unregistered SLES systems
14+
include postgresql::repo::sles_fallback
15+
Class['postgresql::repo::sles_fallback'] -> Package['postgresql-server']
16+
1317
package { 'postgresql-server':
1418
ensure => $_package_ensure,
1519
name => $package_name,

0 commit comments

Comments
 (0)