Unverified Commit beb271f9 authored by Dan Webb's avatar Dan Webb Committed by GitHub
Browse files

Add missing unified_mode from mod_php and mod_wscgi (#738)

* Add missing unified_mode from mod_php and mod_wscgi
* Switch ActionsHub workflows to use main instead of master
* Remove the service resource from install
  This was causing the service to keep restarting and never become
  idempotent.
* Fix spec tests to now include an extra service resource
* Update supported Chef version to 15,.3
parent f7392dc3
......@@ -12,9 +12,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
uses: actions/checkout@main
- name: Run Chef Delivery
uses: actionshub/chef-delivery@master
uses: actionshub/chef-delivery@main
env:
CHEF_LICENSE: accept-no-persist
......@@ -22,17 +22,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
uses: actions/checkout@main
- name: Run yaml Lint
uses: actionshub/yamllint@master
uses: actionshub/yamllint@main
mdl:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
uses: actions/checkout@main
- name: Run Markdown Lint
uses: actionshub/markdownlint@master
uses: actionshub/markdownlint@main
dokken:
needs: [mdl, yamllint, delivery]
......@@ -71,11 +71,11 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@master
uses: actions/checkout@main
- name: Install Chef
uses: actionshub/chef-install@master
uses: actionshub/chef-install@main
- name: Dokken
uses: actionshub/kitchen-dokken@master
uses: actionshub/kitchen-dokken@main
env:
CHEF_LICENSE: accept-no-persist
KITCHEN_LOCAL_YAML: kitchen.dokken.yml
......@@ -94,4 +94,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
uses: actions/checkout@main
......@@ -4,6 +4,10 @@ This file is used to list changes made in each version of the apache2 cookbook.
## Unreleased
- Add missing unified_mode from mod_php and mod_wscgi
- Fix service resource restarting the service every run
- Bump minimum Chef version to 15.3 to support unified_mode
## 8.10.0 - *2021-04-09*
- Fix `apache2_mod_auth_cas` resource for all supported platforms
......
......@@ -3,7 +3,7 @@ source_url 'https://github.com/sous-chefs/apache2'
issues_url 'https://github.com/sous-chefs/apache2/issues'
maintainer 'Sous Chefs'
maintainer_email 'help@sous-chefs.org'
chef_version '>= 15'
chef_version '>= 15.3'
license 'Apache-2.0'
description 'Installs and configures apache2'
version '8.10.0'
......
......@@ -270,13 +270,6 @@ action :install do
only_if { platform_family?('debian') }
end
service 'apache2' do
service_name apache_platform_service_name
supports [:start, :restart, :reload, :status, :graceful, :reload]
action [:enable]
only_if "#{apachectl} -t", environment: { 'APACHE_LOG_DIR' => new_resource.log_dir }, timeout: new_resource.httpd_t_timeout
end
apache2_config 'apache2.conf' do
access_file_name new_resource.access_file_name
log_dir new_resource.log_dir
......
......@@ -118,7 +118,7 @@ action :install do
validate_url: new_resource.validate_url,
directives: new_resource.directives
)
notifies :reload, 'service[apache2]'
notifies :reload, 'service[apache2]', :delayed
end
directory "#{cache_dir}/mod_auth_cas" do
......
unified_mode true
property :name, String, default: ''
property :module_name, String,
......
unified_mode true
property :name, String, default: ''
property :module_name, String,
......
......@@ -7,6 +7,13 @@ describe 'apache2_install' do
context 'install an apache2_module with default properties' do
recipe do
apache2_install 'default'
service 'apache2' do
service_name lazy { apache_platform_service_name }
supports restart: true, status: true, reload: true
action :nothing
end
apache2_module 'sed'
end
......
......@@ -7,6 +7,13 @@ describe 'apache2_install' do
context 'Enable the default site' do
recipe do
apache2_install 'default'
service 'apache2' do
service_name lazy { apache_platform_service_name }
supports restart: true, status: true, reload: true
action :nothing
end
apache2_default_site ''
end
......
......@@ -7,6 +7,12 @@ describe 'apache2_install' do
context 'install apache2 with default properties' do
recipe do
apache2_install 'package'
service 'apache2' do
service_name lazy { apache_platform_service_name }
supports restart: true, status: true, reload: true
action :nothing
end
end
it 'has a correct Group' do
......@@ -38,6 +44,12 @@ describe 'apache2_install' do
apache2_install 'custom' do
template_cookbook 'test'
end
service 'apache2' do
service_name lazy { apache_platform_service_name }
supports restart: true, status: true, reload: true
action :nothing
end
end
it 'render template properly' do
......
......@@ -5,6 +5,12 @@ describe 'apache2_mod_auth_cas' do
recipe do
apache2_install 'package'
service 'apache2' do
service_name lazy { apache_platform_service_name }
supports restart: true, status: true, reload: true
action :nothing
end
apache2_mod_auth_cas 'default' do
directives(CASDebug: 'Off')
end
......
......@@ -8,6 +8,13 @@ describe 'apache2_mod_php' do
context 'Setup and enable PHP module' do
recipe do
apache2_install 'phptest'
service 'apache2' do
service_name lazy { apache_platform_service_name }
supports restart: true, status: true, reload: true
action :nothing
end
apache2_mod_php 'phptest'
end
......@@ -34,6 +41,13 @@ describe 'apache2_mod_php' do
context 'Enable PHP module with custom properties' do
recipe do
apache2_install 'phpcustom'
service 'apache2' do
service_name lazy { apache_platform_service_name }
supports restart: true, status: true, reload: true
action :nothing
end
apache2_mod_php 'phpcustom' do
module_name 'phptest_module'
so_filename 'libphptest.so'
......@@ -60,6 +74,13 @@ describe 'apache2_mod_php' do
context 'Do not install module package' do
recipe do
apache2_install 'phpcustom'
service 'apache2' do
service_name lazy { apache_platform_service_name }
supports restart: true, status: true, reload: true
action :nothing
end
apache2_mod_php 'phpcustom' do
package_name 'mod_phptest'
install_package false
......
......@@ -33,6 +33,12 @@ describe 'apache2_install' do
context 'mod_setenvif' do
recipe do
service 'apache2' do
service_name lazy { apache_platform_service_name }
supports restart: true, status: true, reload: true
action :nothing
end
apache2_mod_setenvif ''
end
......
......@@ -7,7 +7,14 @@ describe 'apache2_mod_wsgi' do
context 'Setup and enable WSGI module' do
recipe do
service 'apache2' do
service_name lazy { apache_platform_service_name }
supports restart: true, status: true, reload: true
action :nothing
end
apache2_install 'wsgitest'
apache2_mod_wsgi 'wsgitest'
end
......@@ -30,6 +37,13 @@ describe 'apache2_mod_wsgi' do
context 'Enable WSGI module with custom properties' do
recipe do
apache2_install 'wsgicustom'
service 'apache2' do
service_name lazy { apache_platform_service_name }
supports restart: true, status: true, reload: true
action :nothing
end
apache2_mod_wsgi 'wsgicustom' do
module_name 'wsgitest_module'
so_filename 'libwsgitest.so'
......@@ -56,6 +70,13 @@ describe 'apache2_mod_wsgi' do
context 'Do not install module package' do
recipe do
apache2_install 'wsgicustom'
service 'apache2' do
service_name lazy { apache_platform_service_name }
supports restart: true, status: true, reload: true
action :nothing
end
apache2_mod_wsgi 'wsgicustom' do
package_name 'mod_wsgitest'
install_package false
......
......@@ -7,6 +7,13 @@ describe 'apache2_install' do
context 'install an apache2_module with default properties' do
recipe do
apache2_install 'default'
service 'apache2' do
service_name lazy { apache_platform_service_name }
supports restart: true, status: true, reload: true
action :nothing
end
apache2_module 'test'
end
......@@ -22,6 +29,13 @@ describe 'apache2_install' do
recipe do
apache2_install 'default'
service 'apache2' do
service_name lazy { apache_platform_service_name }
supports restart: true, status: true, reload: true
action :nothing
end
apache2_module 'proxy' do
mod_conf add_default_charset: 'utf-8'
end
......
......@@ -5,7 +5,7 @@ end
service 'apache2' do
service_name lazy { apache_platform_service_name }
supports restart: true, status: true, reload: true
action [:start, :enable]
action :nothing
end
apache2_mod_auth_cas 'default' do
......
apache2_install 'default'
# service 'apache2' do
# service_name lazy { apache_platform_service_name }
# supports restart: true, status: true, reload: true
# action [:start, :enable]
# end
service 'apache2' do
service_name lazy { apache_platform_service_name }
supports restart: true, status: true, reload: true
action [:start, :enable]
action :nothing
end
apache2_module 'deflate'
......@@ -13,6 +19,8 @@ app_dir = '/var/www/basic_site'
directory app_dir do
recursive true
owner lazy { default_apache_user }
group lazy { default_apache_group }
end
file "#{app_dir}/index.html" do
......
......@@ -4,6 +4,12 @@ apache2_install 'default_install' do
template_cookbook 'test'
end
service 'apache2' do
service_name lazy { apache_platform_service_name }
supports restart: true, status: true, reload: true
action :nothing
end
apache2_site '000-default' do
action :disable
end
......@@ -20,8 +26,5 @@ apache2_conf 'custom' do
)
end
service 'apache2' do
service_name lazy { apache_platform_service_name }
supports restart: true, status: true, reload: true
action :nothing
end
# /etc/apache2/conf-enabled/custom.conf
# /etc/httpd/conf-available/custom.conf
......@@ -8,7 +8,7 @@ apache2_install 'default'
service 'apache2' do
service_name lazy { apache_platform_service_name }
supports restart: true, status: true, reload: true
action [:start, :enable]
action :nothing
end
apache2_module 'deflate'
......
......@@ -3,7 +3,7 @@ apache2_install 'default'
service 'apache2' do
service_name lazy { apache_platform_service_name }
supports restart: true, status: true, reload: true
action [:start, :enable]
action :nothing
end
apache2_module 'info' do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment