Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FM-8140 Add Redhat 8 support #1941

Merged
merged 1 commit into from
Sep 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"operatingsystemrelease": [
"5",
"6",
"7"
"7",
"8"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion provision.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ travis_el7:
images: ['waffleimage/centos7', 'waffleimage/oraclelinux7', 'waffleimage/scientificlinux7']
release_checks:
provisioner: vmpooler
images: ['redhat-5-x86_64', 'redhat-6-x86_64', 'redhat-7-x86_64', 'centos-5-x86_64', 'centos-6-x86_64', 'centos-7-x86_64', 'oracle-6-x86_64', 'oracle-7-x86_64', 'scientific-6-x86_64', 'scientific-7-x86_64', 'debian-8-x86_64', 'debian-9-x86_64', 'ubuntu-1404-x86_64', 'ubuntu-1604-x86_64', 'ubuntu-1804-x86_64', 'sles-11-x86_64', 'sles-12-x86_64', 'sles-15-x86_64']
images: ['redhat-5-x86_64', 'redhat-6-x86_64', 'redhat-7-x86_64', 'redhat-8-x86_64', 'centos-5-x86_64', 'centos-6-x86_64', 'centos-7-x86_64', 'oracle-6-x86_64', 'oracle-7-x86_64', 'scientific-6-x86_64', 'scientific-7-x86_64', 'debian-8-x86_64', 'debian-9-x86_64', 'ubuntu-1404-x86_64', 'ubuntu-1604-x86_64', 'ubuntu-1804-x86_64', 'sles-11-x86_64', 'sles-12-x86_64', 'sles-15-x86_64']
6 changes: 3 additions & 3 deletions spec/acceptance/apache_parameters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class { 'apache':
apply_manifest(pp, catch_failures: true)
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end
Expand All @@ -68,7 +68,7 @@ class { 'apache':
apply_manifest(pp, catch_failures: true)
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.not_to be_running }
it { is_expected.not_to be_enabled }
end
Expand All @@ -86,7 +86,7 @@ class { 'apache':
apply_manifest(pp, catch_failures: true)
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.not_to be_running }
it { is_expected.not_to be_enabled }
end
Expand Down
4 changes: 2 additions & 2 deletions spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
it { is_expected.to be_installed }
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end
Expand Down Expand Up @@ -74,7 +74,7 @@ class { 'apache':
idempotent_apply(pp)
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end
Expand Down
8 changes: 4 additions & 4 deletions spec/acceptance/default_mods_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class { 'apache':
idempotent_apply(pp)
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.to be_running }
end
end
Expand Down Expand Up @@ -54,7 +54,7 @@ class { 'apache':
end
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.not_to be_running }
end
end
Expand Down Expand Up @@ -87,7 +87,7 @@ class { 'apache':
idempotent_apply(pp)
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.to be_running }
end
end
Expand All @@ -106,7 +106,7 @@ class { 'apache': default_mods => false }
idempotent_apply(pp)
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.to be_running }
end

Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/itk_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class { 'apache':
end
end

describe service(service_name) do
describe service(service_name), skip: 'FM-8483' do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end
Expand Down
6 changes: 3 additions & 3 deletions spec/acceptance/prefork_worker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class { 'apache':
end
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end
Expand All @@ -37,7 +37,7 @@ class { 'apache':
end
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end
Expand All @@ -59,7 +59,7 @@ class { 'apache':
end
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end
Expand Down
18 changes: 9 additions & 9 deletions spec/acceptance/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class { 'apache':
apply_manifest(pp, catch_failures: true)
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end
Expand Down Expand Up @@ -245,7 +245,7 @@ class { 'apache':
apply_manifest(pp, catch_failures: true)
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end
Expand Down Expand Up @@ -305,7 +305,7 @@ class { 'apache': }
apply_manifest(pp, catch_failures: true)
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end
Expand Down Expand Up @@ -367,7 +367,7 @@ class { 'apache': }
apply_manifest(pp_one, catch_failures: true)
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end
Expand Down Expand Up @@ -409,7 +409,7 @@ class { 'apache': }
apply_manifest(pp_two, catch_failures: true)
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end
Expand Down Expand Up @@ -485,7 +485,7 @@ class { 'apache': }
apply_manifest(pp_two, catch_failures: true)
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.to be_enabled }
it { is_expected.to be_running }

Expand Down Expand Up @@ -526,7 +526,7 @@ class { 'apache': }
apply_manifest(pp, catch_failures: true)
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end
Expand Down Expand Up @@ -572,7 +572,7 @@ class { 'apache': default_vhost => false, }
), catch_failures: true)
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end
Expand Down Expand Up @@ -617,7 +617,7 @@ class { 'apache': default_vhost => false, }
), catch_failures: true)
end

describe service(apache_hash['service_name']) do
describe service(apache_hash['service_name']), skip: 'FM-8483' do
it { is_expected.to be_enabled }
it { is_expected.to be_running }
end
Expand Down
10 changes: 10 additions & 0 deletions spec/classes/mod/passenger_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,16 @@
is_expected.to contain_file('zpassenger.load').with('path' => '/etc/httpd/conf.modules.d/zpassenger.load')
}
end
when '8'

context 'on EL8' do
it {
is_expected.to contain_file('passenger_package.conf').with('path' => '/etc/httpd/conf.d/passenger.conf')
}
it {
is_expected.to contain_file('zpassenger.load').with('path' => '/etc/httpd/conf.d/zpassenger.load')
}
end
end
end
when 'FreeBSD'
Expand Down
9 changes: 8 additions & 1 deletion spec/classes/mod/security_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,20 @@
)
}
it { is_expected.to contain_package('mod_security_crs') }
if facts[:os]['release']['major'].to_i > 6
if facts[:os]['release']['major'].to_i > 6 && facts[:os]['release']['major'].to_i <= 7
sheenaajay marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can do a compare using the gem version functionality. making it a single boolean check
if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')

it {
is_expected.to contain_file('security.conf').with(
path: '/etc/httpd/conf.modules.d/security.conf',
)
}
end
if facts[:os]['release']['major'].to_i >= 8
it {
is_expected.to contain_file('security.conf').with(
path: '/etc/httpd/conf.d/security.conf',
)
}
end
it {
is_expected.to contain_file('security.conf')
.with_content(%r{^\s+SecAuditLogRelevantStatus "\^\(\?:5\|4\(\?!04\)\)"$})
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/fastcgi_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

on_supported_os.each do |os, facts|
next if facts[:os]['release']['major'] == '18.04'
next if facts[:os]['release']['major'] == '7' && facts[:os]['family']['RedHat']
next if (facts[:os]['release']['major'] == '7' || facts[:os]['release']['major'] == '8') && facts[:os]['family']['RedHat']
context "on #{os} " do
let :facts do
facts
Expand Down
6 changes: 3 additions & 3 deletions spec/defines/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
describe 'apache::vhost', type: :define do
describe 'os-independent items' do
on_supported_os.each do |os, facts|
# this setup uses fastcgi wich isn't available on RHEL 7 / Ubuntu 18.04
# this setup uses fastcgi wich isn't available on RHEL 7 / RHEL 8 / Ubuntu 18.04
next if facts[:os]['release']['major'] == '18.04'
next if facts[:os]['release']['major'] == '7' && facts[:os]['family']['RedHat']
next if (facts[:os]['release']['major'] == '7' || facts[:os]['release']['major'] == '8') && facts[:os]['family']['RedHat']
# next if facts[:os]['name'] == 'SLES'

apache_name = case facts[:os]['family']
Expand Down Expand Up @@ -44,7 +44,7 @@
it { is_expected.to contain_class('apache::params') }
it { is_expected.to contain_apache__listen(params[:port]) }
# namebased virualhost is only created on apache 2.2 and older
if (facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'].to_i < 7) ||
if (facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'].to_i < 8) ||
(facts[:os]['name'] == 'Amazon') ||
(facts[:os]['name'] == 'SLES' && facts[:os]['release']['major'].to_i < 12)
it { is_expected.to contain_apache__namevirtualhost("*:#{params[:port]}") }
Expand Down
15 changes: 13 additions & 2 deletions spec/spec_helper_acceptance_local.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ class { 'epel':
epel_baseurl => "http://osmirror.delivery.puppetlabs.net/epel${::operatingsystemmajrelease}-\\$basearch/RPMS.all",
epel_mirrorlist => "http://osmirror.delivery.puppetlabs.net/epel${::operatingsystemmajrelease}-\\$basearch/RPMS.all",
}
} elsif $::operatingsystemmajrelease == '8' {
class { 'epel':
os_maj_release => "7",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need epel for this ? there is no epel for redhat 8 yet.

epel_baseurl => "http://osmirror.delivery.puppetlabs.net/epel7-\\$basearch/RPMS.all",
epel_mirrorlist => "http://osmirror.delivery.puppetlabs.net/epel7-\\$basearch/RPMS.all",
}
} else {
class { 'epel': }
}
Expand Down Expand Up @@ -60,8 +66,13 @@ def apache_settings_hash
apache['error_log'] = 'error_log'
apache['suphp_handler'] = 'php5-script'
apache['suphp_configpath'] = 'undef'

if operatingsystemrelease >= 7
if (operatingsystemrelease >= 7 && operatingsystemrelease < 8) && (osfamily == 'redhat')
apache['version'] = '2.4'
apache['mod_dir'] = '/etc/httpd/conf.modules.d'
elsif operatingsystemrelease >= 8 && osfamily == 'redhat'
apache['version'] = '2.4'
apache['mod_dir'] = '/etc/httpd/conf.d'
elsif operatingsystemrelease >= 7 && osfamily == 'oracle'
apache['version'] = '2.4'
apache['mod_dir'] = '/etc/httpd/conf.modules.d'
else
Expand Down