Skip to content

Commit 8943700

Browse files
imaqsoodclaude
andcommitted
(MODULES-12075) apache::mod::php adds an EOL openSUSE repo with auto-trusted keys on customer SLES nodes
Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 688f56b commit 8943700

2 files changed

Lines changed: 12 additions & 18 deletions

File tree

‎manifests/mod/php.pp‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -106,30 +106,12 @@
106106
}
107107

108108
if $facts['os']['name'] == 'SLES' {
109-
# TEMPORARY FIX: Configure fallback repo for unregistered SLES systems
110-
# GCP BYOS images have zero repos configured, SUSEConnect doesn't work
111-
# Use version-appropriate repos: Leap 42.3 for SLES 12 (PHP 5), Leap 15.6 for SLES 15 (PHP 7)
112-
if versioncmp($facts['os']['release']['major'], '15') >= 0 {
113-
$repo_url = 'http://download.opensuse.org/distribution/leap/15.6/repo/oss/'
114-
} else {
115-
# SLES 12 needs older repo with PHP 5 support
116-
$repo_url = 'http://download.opensuse.org/distribution/leap/42.3/repo/oss/'
117-
}
118-
119-
exec { 'Configure zypper repo for SLES mod_php':
120-
path => '/bin:/usr/bin:/sbin:/usr/sbin',
121-
command => "zypper --non-interactive --gpg-auto-import-keys ar ${repo_url} opensuse-leap-fallback && zypper --non-interactive --gpg-auto-import-keys refresh",
122-
unless => "zypper lr 2>/dev/null | grep -q 'opensuse-leap-fallback\\|http'",
123-
logoutput => true,
124-
}
125-
126109
::apache::mod { $mod:
127110
package => $_package_name,
128111
package_ensure => $package_ensure,
129112
lib => "mod_${mod}.so",
130113
id => $_module_id,
131114
path => "${apache::lib_path}/mod_${mod}.so",
132-
require => Exec['Configure zypper repo for SLES mod_php'],
133115
}
134116
} else {
135117
::apache::mod { $mod:

‎spec/classes/mod/php_spec.rb‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,18 @@
245245
end
246246
end
247247
end
248+
when 'Suse'
249+
describe 'on a SLES OS' do
250+
it { is_expected.to compile.with_all_deps }
251+
it { is_expected.not_to contain_exec('Configure zypper repo for SLES mod_php') }
252+
253+
it 'does not manage any zypper repo' do
254+
zypper_execs = catalogue.resources.select do |r|
255+
r.type == 'Exec' && r[:command].to_s.include?('zypper')
256+
end
257+
expect(zypper_execs).to be_empty
258+
end
259+
end
248260
when 'FreeBSD'
249261
describe 'on a FreeBSD OS' do
250262
context 'with mpm_module => prefork' do

0 commit comments

Comments
 (0)