Skip to content

Commit

Permalink
(MODULES-8141) - Addition of support for SLES 15
Browse files Browse the repository at this point in the history
On SLES 15 when `gensslcert` is called without a name it defaults it to the hostname
Extension of SLES exceptions
SLES 15 requires 'net-tools-deprecated' to be installed prior to test's running
  • Loading branch information
david22swan committed Dec 18, 2018
1 parent bfad584 commit 4cb1379
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
10 changes: 8 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -725,8 +725,14 @@
$logroot_mode = undef
$lib_path = '/usr/lib64/apache2' #changes for some modules based on mpm
$mpm_module = 'prefork'
$default_ssl_cert = '/etc/apache2/ssl.crt/server.crt'
$default_ssl_key = '/etc/apache2/ssl.key/server.key'

if $::operatingsystemrelease < '15' {
$default_ssl_cert = '/etc/apache2/ssl.crt/server.crt'
$default_ssl_key = '/etc/apache2/ssl.key/server.key'
} else {
$default_ssl_cert = '/etc/apache2/ssl.crt/default-server.crt'
$default_ssl_key = '/etc/apache2/ssl.key/default-server.key'
}
$ssl_sessioncache = '/var/lib/apache2/ssl_scache(512000)'
$suphp_addhandler = 'x-httpd-php'
$suphp_engine = 'off'
Expand Down
3 changes: 2 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
"operatingsystem": "SLES",
"operatingsystemrelease": [
"11 SP1",
"12"
"12",
"15"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/default_mods_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class { 'apache':
end
end

unless fact('operatingsystem') == 'SLES' && fact('operatingsystemmajrelease') == '12'
unless fact('operatingsystem') == 'SLES' && fact('operatingsystemmajrelease') >= '12'
describe 'no default mods and failing' do
before :all do
pp = <<-PP
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/mod_php_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper_acceptance'
require_relative './version.rb'

unless fact('operatingsystem') == 'SLES' && fact('operatingsystemmajrelease') == '12'
unless fact('operatingsystem') == 'SLES' && fact('operatingsystemmajrelease') >= '12'
describe 'apache::mod::php class' do
context 'default php config' do
if ['16.04', '18.04'].include?(fact('operatingsystemmajrelease'))
Expand Down
7 changes: 6 additions & 1 deletion spec/acceptance/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ class { 'apache':
default_ssl_vhost => false,
service_ensure => stopped,
}
if ($::osfamily == 'Suse') {
if ($::osfamily == 'Suse' and $::operatingsystemrelease < '15') {
exec { '/usr/bin/gensslcert':
require => Class['apache'],
}
} elsif ($::osfamily == 'Suse' and $::operatingsystemrelease >= '15') {
# In SLES 15, if not given a name, gensslcert defaults the name to be the hostname
exec { '/usr/bin/gensslcert -n default':
require => Class['apache'],
}
}
MANIFEST
it 'creates no default vhosts' do
Expand Down
6 changes: 6 additions & 0 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
package { 'net-tools': ensure => installed }
EOS

apply_manifest_on(agents, pp, catch_failures: false)
elsif fact('operatingsystem') == 'SLES' && fact('operatingsystemmajrelease') == '15'
pp = <<-EOS
package { 'net-tools-deprecated': ensure => installed }
EOS

apply_manifest_on(agents, pp, catch_failures: false)
end

Expand Down

0 comments on commit 4cb1379

Please sign in to comment.