Skip to content

Commit c7cc6f2

Browse files
committed
(CAT-2511) Address sles box misconfigurations
Testing possible fixes for SLES failures.
1 parent 8aa4f50 commit c7cc6f2

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

lib/puppet/provider/postgresql_conf/ruby.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def exists?
8080

8181
# remove resource if exists and is set to absent
8282
def destroy
83-
entry_regex = %r{#{resource[:key]}.*=.*#{resource[:value]}}
83+
entry_regex = %r{^\s*#{resource[:key]}\s*=}
8484
lines = File.readlines(resource[:target])
8585

8686
lines.delete_if do |entry|

spec/spec_helper_acceptance_local.rb

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,17 @@ def install_dependencies
4444
4545
# needed for netstat, for serverspec checks
4646
if $facts['os']['family'] in ['SLES', 'SUSE'] {
47-
exec { 'Enable legacy repos':
48-
path => '/bin:/usr/bin/:/sbin:/usr/sbin',
49-
command => "SUSEConnect --product sle-module-legacy/${$facts['os']['distro']['release']['full']}/x86_64",
50-
unless => "SUSEConnect --status-text | grep sle-module-legacy/${$facts['os']['distro']['release']['full']}/x86_64",
47+
# TEMPORARY FIX: Add fallback repo for unregistered SLES systems
48+
exec { 'Configure zypper repo for SLES':
49+
path => '/bin:/usr/bin:/sbin:/usr/sbin',
50+
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',
51+
unless => "zypper lr 2>/dev/null | grep -q 'opensuse-leap-fallback\\|http'",
52+
logoutput => true,
5153
}
5254
5355
package { 'net-tools-deprecated':
54-
ensure => 'latest',
56+
ensure => 'latest',
57+
require => Exec['Configure zypper repo for SLES'],
5558
}
5659
}
5760

0 commit comments

Comments
 (0)