Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
COOK-753, use file resource instead of execute[generate-module-list] …
…script for LoadModule .load files
  • Loading branch information
jtimberman committed Sep 13, 2011
1 parent 01e8566 commit c732810
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion apache2/attributes/default.rb
Expand Up @@ -32,7 +32,7 @@
else
set[:apache][:pid_file] = "/var/run/httpd.pid"
end
set[:apache][:lib_dir] = node[:architecture] == "i386" ? "/usr/lib/httpd" : "/usr/lib64/httpd"
set[:apache][:lib_dir] = node[:kernel][:machine] == "i386" ? "/usr/lib/httpd" : "/usr/lib64/httpd"
when "debian","ubuntu"
set[:apache][:dir] = "/etc/apache2"
set[:apache][:log_dir] = "/var/log/apache2"
Expand Down
13 changes: 5 additions & 8 deletions apache2/definitions/apache_module.rb
Expand Up @@ -20,19 +20,16 @@
define :apache_module, :enable => true, :conf => false do
include_recipe "apache2"

params[:filename] = params[:filename] || "mod_#{params[:name]}.so"

if params[:conf]
apache_conf params[:name]
end

if platform?("redhat", "centos", "scientific", "fedora", "arch", "suse" )
execute "generate-module-list" do
if node[:kernel][:machine] == "x86_64"
libdir = value_for_platform("arch" => { "default" => "lib" }, "default" => "lib64")
else
libdir = "lib"
end
command "/usr/local/bin/apache2_module_conf_generate.pl /usr/#{libdir}/httpd/modules /etc/httpd/mods-available"
action :run
file "#{node['apache']['dir']}/mods-available/#{params[:name]}.load" do
content "LoadModule #{params[:name]}_module #{node['apache']['lib_dir']}/modules/#{params[:filename]}\n"
mode 0644
end
end

Expand Down
4 changes: 3 additions & 1 deletion apache2/recipes/mod_auth_openid.rb
Expand Up @@ -90,7 +90,9 @@
mode 0644
end

apache_module "authopenid"
apache_module "authopenid" do
filename "mod_auth_openid.so"
end

template "/usr/local/bin/mod_auth_openid.rb" do
source "mod_auth_openid.rb.erb"
Expand Down
8 changes: 6 additions & 2 deletions apache2/recipes/mod_php5.rb
Expand Up @@ -70,5 +70,9 @@
end
end

apache_module "php5"

apache_module "php5" do
case node['platform']
when "redhat","centos","scientific","fedora"
filename "libphp5.so"
end
end

0 comments on commit c732810

Please sign in to comment.