2 # Cookbook Name:: apache
3 # Provider:: apache_conf
5 # Copyright 2014, OpenStreetMap Foundation
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
25 if node[:lsb][:release].to_f >= 14.04
31 if node[:lsb][:release].to_f >= 14.04
39 if node[:lsb][:release].to_f >= 14.04
47 if node[:lsb][:release].to_f >= 14.04
53 t = template available_name do
54 cookbook new_resource.cookbook
55 source new_resource.template
59 variables new_resource.variables
60 notifies :reload, "service[apache2]" if enabled? or available_name == enabled_name
63 new_resource.updated_by_last_action(t.updated_by_last_action?)
67 l = link enabled_name do
71 notifies :reload, "service[apache2]"
74 new_resource.updated_by_last_action(l.updated_by_last_action?)
78 l = link enabled_name do
80 notifies :reload, "service[apache2]"
83 new_resource.updated_by_last_action(l.updated_by_last_action?)
87 f = file available_name do
91 new_resource.updated_by_last_action(f.updated_by_last_action?)
95 if node[:lsb][:release].to_f >= 14.04
96 "/etc/apache2/conf-available/#{new_resource.name}"
98 "/etc/apache2/conf.d/#{new_resource.name}"
103 if node[:lsb][:release].to_f >= 14.04
104 "/etc/apache2/conf-enabled/#{new_resource.name}"
106 "/etc/apache2/conf.d/#{new_resource.name}"
111 ::File.exists?(enabled_name)