Unverified Commit b5b57475 authored by Dan Webb's avatar Dan Webb
Browse files

Don't use node attributes directly in the templates

parent ab3ecdfb
......@@ -18,3 +18,6 @@ module Apache2
end
end
end
Chef::Recipe.include(Apache2::Cookbook::Helpers)
Chef::Resource.include(Apache2::Cookbook::Helpers)
......@@ -137,6 +137,9 @@ template "/etc/sysconfig/#{node['apache']['service_name']}" do
group node['apache']['root_group']
mode '0644'
notifies :restart, 'service[apache2]', :delayed
variables({
apache_binary: apache_binary
})
only_if { platform_family?('rhel', 'amazon', 'fedora', 'suse') }
end
......@@ -162,6 +165,9 @@ template 'apache2.conf' do
owner 'root'
group node['apache']['root_group']
mode '0644'
variables({
apache_binary: apache_binary
})
notifies :reload, 'service[apache2]', :delayed
end
......@@ -196,8 +202,6 @@ end
apache_service_name = node['apache']['service_name']
Chef::Recipe.send(:include, Apache2::Cookbook::Helpers)
service 'apache2' do
service_name apache_service_name
supports [:start, :restart, :reload, :status]
......
......@@ -6,7 +6,7 @@
# available, but does not work with some modules (such as PHP).
# The service must be stopped before changing this variable.
#
HTTPD=<%= apache_binary %>
HTTPD=<%= @apache_binary %>
#
# To pass additional options (for instance, -D definitions) to the
......
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