File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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:
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments