...
 
Commits (2)
  • Lance Albertson's avatar
    Rename libexec_dir to apache_libexec_dir (#678) · 3b6f9bce
    Lance Albertson authored
    * Rename libexec_dir to apache_libexec_dir
    
    This works around an issue when using this cookbook with the docker cookbook at
    the same time. They both have a function called ``libexec_dir`` and docker seems
    to override this cookbook. To work around this, renaming our function to
    ``apache_libexec_dir`` seems to work.
    
    This resolves #677.
    
    * Disable MD024 because we follow Keep A Changelog syntax which conflicts
    3b6f9bce
  • Dan Webb's avatar
    Release 8.1.1 · 56f2db4d
    Dan Webb authored
    56f2db4d
rules "~MD013"
rules "~MD013", "~MD024"
......@@ -2,11 +2,17 @@
This file is used to list changes made in each version of the apache2 cookbook.
## Unreleased
## [8.1.1] - 2020-04-12
### Added
- Add CentOS 8 to CI pipeline
- Add Debian 10 / Remove Debian 8 from CI pipeline
### Changed
- Rename libexec_dir to apache_libexec_dir
## [8.1.0] - 2020-03-06
### Added
......
......@@ -81,7 +81,7 @@ module Apache2
end
end
def libexec_dir
def apache_libexec_dir
if platform_family?('freebsd') || platform_family?('suse')
lib_dir
else
......
......@@ -6,7 +6,7 @@ maintainer_email 'help@sous-chefs.org'
chef_version '>= 13.9'
license 'Apache-2.0'
description 'Installs and configures apache2'
version '8.1.0'
version '8.1.1'
supports 'debian'
supports 'ubuntu'
......
......@@ -41,7 +41,7 @@ action :install do
execute 'compile mod_auth_cas' do
command './configure && make && make install'
cwd '/tmp/mod_auth_cas'
not_if "test -f #{libexec_dir}/mod_auth_cas.so"
not_if "test -f #{apache_libexec_dir}/mod_auth_cas.so"
end
template "#{apache_dir}/mods-available/auth_cas.load" do
......
......@@ -5,7 +5,7 @@ property :mod_name, String,
description: 'The full name of the file'
property :path, String,
default: lazy { "#{libexec_dir}/#{mod_name}" },
default: lazy { "#{apache_libexec_dir}/#{mod_name}" },
description: ''
property :identifier, String,
......
require 'spec_helper'
RSpec.describe Apache2::Cookbook::Helpers do
class DummyClass < Chef::Node
include Apache2::Cookbook::Helpers
end
subject { DummyClass.new }
describe '#apache_libexec_dir' do
before do
allow(subject).to receive(:[]).with('platform_family').and_return(platform_family)
allow(subject).to receive(:[]).with(:platform_family).and_return(platform_family)
allow(subject).to receive(:[]).with('kernel').and_return('machine' => machine)
end
context 'x86_64' do
let(:machine) { 'x86_64' }
context 'redhat' do
let(:platform_family) { 'rhel' }
it { expect(subject.apache_libexec_dir).to eq '/usr/lib64/httpd/modules' }
end
context 'fedora' do
let(:platform_family) { 'fedora' }
it { expect(subject.apache_libexec_dir).to eq '/usr/lib64/httpd/modules' }
end
context 'amazon' do
let(:platform_family) { 'amazon' }
it { expect(subject.apache_libexec_dir).to eq '/usr/lib64/httpd/modules' }
end
context 'suse' do
let(:platform_family) { 'suse' }
it { expect(subject.apache_libexec_dir).to eq '/usr/lib64/apache2' }
end
context 'debian' do
let(:platform_family) { 'debian' }
it { expect(subject.apache_libexec_dir).to eq '/usr/lib/apache2/modules' }
end
context 'arch' do
let(:platform_family) { 'arch' }
it { expect(subject.apache_libexec_dir).to eq '/usr/lib/httpd/modules' }
end
context 'freebsd' do
let(:platform_family) { 'freebsd' }
it { expect(subject.apache_libexec_dir).to eq '/usr/local/libexec/apache24' }
end
end
context 'x86' do
let(:machine) { 'i686' }
context 'redhat' do
let(:platform_family) { 'rhel' }
it { expect(subject.apache_libexec_dir).to eq '/usr/lib/httpd/modules' }
end
context 'fedora' do
let(:platform_family) { 'fedora' }
it { expect(subject.apache_libexec_dir).to eq '/usr/lib/httpd/modules' }
end
context 'amazon' do
let(:platform_family) { 'amazon' }
it { expect(subject.apache_libexec_dir).to eq '/usr/lib/httpd/modules' }
end
context 'suse' do
let(:platform_family) { 'suse' }
it { expect(subject.apache_libexec_dir).to eq '/usr/lib/apache2' }
end
context 'debian' do
let(:platform_family) { 'debian' }
it { expect(subject.apache_libexec_dir).to eq '/usr/lib/apache2/modules' }
end
context 'arch' do
let(:platform_family) { 'arch' }
it { expect(subject.apache_libexec_dir).to eq '/usr/lib/httpd/modules' }
end
context 'freebsd' do
let(:platform_family) { 'freebsd' }
it { expect(subject.apache_libexec_dir).to eq '/usr/local/libexec/apache24' }
end
end
end
end
require 'spec_helper'
describe '#libexec_dir' do
context 'x86_64' do
automatic_attributes['kernel']['machine'] = 'x86_64'
recipe do
log libexec_dir
end
context 'redhat' do
platform 'redhat'
it { is_expected.to write_log('/usr/lib64/httpd/modules') }
end
context 'fedora' do
platform 'redhat'
it { is_expected.to write_log('/usr/lib64/httpd/modules') }
end
context 'amazon' do
platform 'amazon'
it { is_expected.to write_log('/usr/lib64/httpd/modules') }
end
context 'suse' do
platform 'suse'
it { is_expected.to write_log('/usr/lib64/apache2') }
end
context 'debian' do
platform 'debian'
it { is_expected.to write_log('/usr/lib/apache2/modules') }
end
context 'arch' do
platform 'arch'
it { is_expected.to write_log('/usr/lib/httpd/modules') }
end
context 'freebsd' do
platform 'freebsd'
it { is_expected.to write_log('/usr/local/libexec/apache24') }
end
end
context 'x86' do
automatic_attributes['kernel']['machine'] = 'i686'
recipe do
log libexec_dir
end
context 'redhat' do
platform 'redhat'
it { is_expected.to write_log('/usr/lib/httpd/modules') }
end
context 'fedora' do
platform 'redhat'
it { is_expected.to write_log('/usr/lib/httpd/modules') }
end
context 'amazon' do
platform 'amazon'
it { is_expected.to write_log('/usr/lib/httpd/modules') }
end
context 'suse' do
platform 'suse'
it { is_expected.to write_log('/usr/lib/apache2') }
end
context 'debian' do
platform 'debian'
it { is_expected.to write_log('/usr/lib/apache2/modules') }
end
context 'arch' do
platform 'arch'
it { is_expected.to write_log('/usr/lib/httpd/modules') }
end
context 'freebsd' do
platform 'freebsd'
it { is_expected.to write_log('/usr/local/libexec/apache24') }
end
end
end