Downgrade mysql cookbook for now
It doesn't play well with our current dev server setup
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#
|
||||
# Cookbook Name:: apache2
|
||||
# Cookbook:: apache2
|
||||
# Recipe:: default
|
||||
#
|
||||
# Copyright 2008-2013, Chef Software, Inc.
|
||||
# Copyright 2014-2015, Alexander van Zoest
|
||||
# Copyright:: 2008-2013, Chef Software, Inc.
|
||||
# Copyright:: 2014-2015, Alexander van Zoest
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -18,8 +18,9 @@
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
package 'apache2' do
|
||||
package 'apache2' do # ~FC009 only available in apt_package. See #388
|
||||
package_name node['apache']['package']
|
||||
default_release node['apache']['default_release'] unless node['apache']['default_release'].nil?
|
||||
end
|
||||
|
||||
%w(sites-available sites-enabled mods-available mods-enabled conf-available conf-enabled).each do |dir|
|
||||
@@ -43,18 +44,16 @@ end
|
||||
end
|
||||
end
|
||||
|
||||
directory "#{node['apache']['dir']}/conf.d" do
|
||||
action :delete
|
||||
recursive true
|
||||
end
|
||||
|
||||
directory node['apache']['log_dir'] do
|
||||
mode '0755'
|
||||
recursive true
|
||||
end
|
||||
|
||||
# perl is needed for the a2* scripts
|
||||
package node['apache']['perl_pkg']
|
||||
|
||||
package 'perl-Getopt-Long-Descriptive' if platform?('fedora')
|
||||
|
||||
%w(a2ensite a2dissite a2enmod a2dismod a2enconf a2disconf).each do |modscript|
|
||||
link "/usr/sbin/#{modscript}" do
|
||||
action :delete
|
||||
@@ -82,9 +81,6 @@ unless platform_family?('debian')
|
||||
command "/usr/local/bin/apache2_module_conf_generate.pl #{node['apache']['lib_dir']} #{node['apache']['dir']}/mods-available"
|
||||
action :nothing
|
||||
end
|
||||
|
||||
# enable mod_deflate for consistency across distributions
|
||||
include_recipe 'apache2::mod_deflate'
|
||||
end
|
||||
|
||||
if platform_family?('freebsd')
|
||||
@@ -128,7 +124,7 @@ end
|
||||
|
||||
directory node['apache']['lock_dir'] do
|
||||
mode '0755'
|
||||
if node['platform_family'] == 'debian' && node['apache']['version'] == '2.2'
|
||||
if node['platform_family'] == 'debian'
|
||||
owner node['apache']['user']
|
||||
else
|
||||
owner 'root'
|
||||
@@ -143,7 +139,7 @@ template "/etc/sysconfig/#{node['apache']['package']}" do
|
||||
group node['apache']['root_group']
|
||||
mode '0644'
|
||||
notifies :restart, 'service[apache2]', :delayed
|
||||
only_if { platform_family?('rhel', 'fedora', 'suse') }
|
||||
only_if { platform_family?('rhel', 'amazon', 'fedora', 'suse') }
|
||||
end
|
||||
|
||||
template "#{node['apache']['dir']}/envvars" do
|
||||
@@ -156,7 +152,7 @@ template "#{node['apache']['dir']}/envvars" do
|
||||
end
|
||||
|
||||
template 'apache2.conf' do
|
||||
if platform_family?('rhel', 'fedora', 'arch', 'freebsd')
|
||||
if platform_family?('rhel', 'amazon', 'fedora', 'arch', 'freebsd')
|
||||
path "#{node['apache']['conf_dir']}/httpd.conf"
|
||||
elsif platform_family?('debian')
|
||||
path "#{node['apache']['conf_dir']}/apache2.conf"
|
||||
@@ -182,8 +178,7 @@ apache_conf 'ports' do
|
||||
conf_path node['apache']['dir']
|
||||
end
|
||||
|
||||
if node['apache']['version'] == '2.4' && !platform_family?('freebsd')
|
||||
# on freebsd the prefork mpm is staticly compiled in
|
||||
if node['apache']['version'] == '2.4'
|
||||
if node['apache']['mpm_support'].include?(node['apache']['mpm'])
|
||||
include_recipe "apache2::mpm_#{node['apache']['mpm']}"
|
||||
else
|
||||
@@ -203,18 +198,22 @@ if node['apache']['default_site_enabled']
|
||||
end
|
||||
end
|
||||
|
||||
apache_service_name = node['apache']['service_name']
|
||||
|
||||
service 'apache2' do
|
||||
service_name node['apache']['service_name']
|
||||
service_name apache_service_name
|
||||
case node['platform_family']
|
||||
when 'rhel'
|
||||
restart_command '/sbin/service httpd restart && sleep 1' if node['apache']['version'] == '2.2'
|
||||
reload_command '/sbin/service httpd graceful'
|
||||
if node['platform_version'].to_f < 7.0 && node['apache']['version'] != '2.4'
|
||||
restart_command "/sbin/service #{apache_service_name} restart && sleep 1"
|
||||
reload_command "/sbin/service #{apache_service_name} graceful && sleep 1"
|
||||
end
|
||||
when 'debian'
|
||||
provider Chef::Provider::Service::Debian
|
||||
when 'arch'
|
||||
service_name 'httpd'
|
||||
service_name apache_service_name
|
||||
end
|
||||
supports [:start, :restart, :reload, :status]
|
||||
action [:enable, :start]
|
||||
only_if "#{node['apache']['binary']} -t", :environment => { 'APACHE_LOG_DIR' => node['apache']['log_dir'] }, :timeout => 10
|
||||
only_if "#{node['apache']['binary']} -t", environment: { 'APACHE_LOG_DIR' => node['apache']['log_dir'] }, timeout: 10
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user