use_inline_resources
-action :create do # ~FC017
- if node[:lsb][:release].to_f >= 14.04
- create_conf
- end
+action :create do
+ create_conf
end
-action :enable do # ~FC017
- if node[:lsb][:release].to_f >= 14.04
- enable_conf
- else
- create_conf
- end
+action :enable do
+ enable_conf
end
-action :disable do # ~FC017
- if node[:lsb][:release].to_f >= 14.04
- disable_conf
- else
- delete_conf
- end
+action :disable do
+ disable_conf
end
-action :delete do # ~FC017
- if node[:lsb][:release].to_f >= 14.04
- delete_conf
- end
+action :delete do
+ delete_conf
end
def create_conf
end
def available_name
- if node[:lsb][:release].to_f >= 14.04
- "/etc/apache2/conf-available/#{new_resource.name}.conf"
- else
- "/etc/apache2/conf.d/#{new_resource.name}"
- end
+ "/etc/apache2/conf-available/#{new_resource.name}.conf"
end
def enabled_name
- if node[:lsb][:release].to_f >= 14.04
- "/etc/apache2/conf-enabled/#{new_resource.name}.conf"
- else
- "/etc/apache2/conf.d/#{new_resource.name}"
- end
+ "/etc/apache2/conf-enabled/#{new_resource.name}.conf"
end
end
def available_name
- if node[:lsb][:release].to_f >= 14.04
- "/etc/apache2/sites-available/#{new_resource.name}.conf"
- else
- "/etc/apache2/sites-available/#{new_resource.name}"
- end
+ "/etc/apache2/sites-available/#{new_resource.name}.conf"
end
def enabled_name
- if node[:lsb][:release].to_f >= 14.04
- case new_resource.name
- when "default"
- "/etc/apache2/sites-enabled/000-default.conf"
- else
- "/etc/apache2/sites-enabled/#{new_resource.name}.conf"
- end
+ case new_resource.name
+ when "default"
+ "/etc/apache2/sites-enabled/000-default.conf"
else
- case new_resource.name
- when "default"
- "/etc/apache2/sites-enabled/000-default"
- else
- "/etc/apache2/sites-enabled/#{new_resource.name}"
- end
+ "/etc/apache2/sites-enabled/#{new_resource.name}.conf"
end
end
package "apache2"
package "libwww-perl"
-if node[:lsb][:release].to_f < 14.04
- package "apache2-mpm-#{node[:apache][:mpm]}" do
- notifies :restart, "service[apache2]"
- end
-else
- %w(event itk prefork worker).each do |mpm|
- if mpm == node[:apache][:mpm]
- apache_module "mpm_#{mpm}" do
- action [:enable]
- end
- else
- apache_module "mpm_#{mpm}" do
- action [:disable]
- end
+%w(event itk prefork worker).each do |mpm|
+ if mpm == node[:apache][:mpm]
+ apache_module "mpm_#{mpm}" do
+ action [:enable]
+ end
+ else
+ apache_module "mpm_#{mpm}" do
+ action [:disable]
end
end
end
admins = data_bag_item("apache", "admins")
-if node[:lsb][:release].to_f < 14.04
- template "/etc/apache2/httpd.conf" do
- source "httpd.conf.erb"
- owner "root"
- group "root"
- mode 0644
- notifies :reload, "service[apache2]"
- end
-else
- apache_conf "httpd" do
- template "httpd.conf.erb"
- notifies :reload, "service[apache2]"
- end
+apache_conf "httpd" do
+ template "httpd.conf.erb"
+ notifies :reload, "service[apache2]"
end
template "/etc/apache2/ports.conf" do
include_recipe "apache"
include_recipe "ssl"
-apache_module "socache_shmcb" do
- only_if { node[:lsb][:release].to_f >= 14.04 }
-end
-
apache_module "ssl"
apache_conf "ssl" do
# DO NOT EDIT - This file is being maintained by Chef
# Listen on port 80
-<% if node[:lsb][:release].to_f < 14.04 -%>
-NameVirtualHost *:80
-<% end -%>
Listen <%= node[:apache][:listen_address] %>:80
# Listen on port 443 if mod_ssl is enabled
<IfModule mod_ssl.c>
- <% if node[:lsb][:release].to_f < 14.04 -%>
- NameVirtualHost *:443
- <% end -%>
Listen <%= node[:apache][:listen_address] %>:443
</IfModule>
# Listen on port 443 if mod_gnutls is enabled
<IfModule mod_gnutls.c>
- <% if node[:lsb][:release].to_f < 14.04 -%>
- NameVirtualHost *:443
- <% end -%>
Listen <%= node[:apache][:listen_address] %>:443
</IfModule>
SSLCertificateFile /etc/ssl/certs/<%= @certificate %>.pem
SSLCertificateKeyFile /etc/ssl/private/<%= @certificate %>.key
SSLCertificateChainFile /etc/ssl/certs/<%= @certificate_chain %>.pem
-<% if node[:lsb][:release].to_f >= 14.04 -%>
SSLUseStapling On
SSLStaplingResponderTimeout 5
SSLStaplingReturnResponderErrors off
SSLStaplingCache shmcb:${APACHE_RUN_DIR}/ssl_ocspcache(512000)
-<% end -%>
package "ruby"
package "ruby-dev"
-if node[:lsb][:release].to_f < 14.04
- package "rubygems"
-end
-
package "libproj-dev"
package "libxml2-dev"
stats_file=/var/run/renderd/renderd.stats
[mapnik]
-<% if node[:lsb][:release].to_f >= 14.04 -%>
plugins_dir=/usr/lib/mapnik/2.2/input
-<% else -%>
-plugins_dir=/usr/lib/mapnik/input
-<% end -%>
font_dir=/usr/share/fonts
font_dir_recurse=true
<% node[:tile][:styles].each do |name,details| -%>