true
end
-action :create do
+action :create do # ~FC017
if node[:lsb][:release].to_f >= 14.04
create_conf
end
end
-action :enable do
+action :enable do # ~FC017
if node[:lsb][:release].to_f >= 14.04
enable_conf
else
end
end
-action :disable do
+action :disable do # ~FC017
if node[:lsb][:release].to_f >= 14.04
disable_conf
else
end
end
-action :delete do
+action :delete do # ~FC017
if node[:lsb][:release].to_f >= 14.04
delete_conf
end
group "root"
mode 0644
variables new_resource.variables
- notifies :reload, "service[apache2]" if enabled? or available_name == enabled_name
+ notifies :reload, "service[apache2]" if enabled? || available_name == enabled_name
end
new_resource.updated_by_last_action(t.updated_by_last_action?)
def available_name
if node[:lsb][:release].to_f >= 14.04
- "/etc/apache2/conf-available/#{new_resource.name}"
+ "/etc/apache2/conf-available/#{new_resource.name}.conf"
else
"/etc/apache2/conf.d/#{new_resource.name}"
end
def enabled_name
if node[:lsb][:release].to_f >= 14.04
- "/etc/apache2/conf-enabled/#{new_resource.name}"
+ "/etc/apache2/conf-enabled/#{new_resource.name}.conf"
else
"/etc/apache2/conf.d/#{new_resource.name}"
end
end
def enabled?
- ::File.exists?(enabled_name)
+ ::File.exist?(enabled_name)
end