# limitations under the License.
#
+node.default[:ssl][:certificate] = node[:ssl][:certificate] | [ "openstreetmap" ]
+
include_recipe "apache"
include_recipe "ssl"
-default[:ssl][:certificate] = "openstreetmap"
+default[:ssl][:certificates] = []
backup false
end
-cookbook_file "/etc/ssl/certs/#{node[:ssl][:certificate]}.pem" do
- owner "root"
- group "root"
- mode 0444
- backup false
-end
+[ "openstreetmap", "tile.openstreetmap" ].each do |certificate|
+ if node[:ssl][:certificates].include?(certificate)
+ cookbook_file "/etc/ssl/certs/#{certificate}.pem" do
+ owner "root"
+ group "root"
+ mode 0444
+ backup false
+ end
-file "/etc/ssl/private/#{node[:ssl][:certificate]}.key" do
- owner "root"
- group "ssl-cert"
- mode 0440
- content keys[node[:ssl][:certificate]].join("\n")
- backup false
+ file "/etc/ssl/private/#{certificate}.key" do
+ owner "root"
+ group "ssl-cert"
+ mode 0440
+ content keys[certificate].join("\n")
+ backup false
+ end
+ else
+ file "/etc/ssl/certs/#{certificate}.pem" do
+ action :delete
+ end
+
+ file "/etc/ssl/private/#{certificate}.key" do
+ action :delete
+ end
+ end
end
description "Installs and configures a tile cache"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
version "1.0.0"
+depends "ssl"
depends "squid"
# limitations under the License.
#
+node.default[:ssl][:certificate] = node[:ssl][:certificate] | [ "tile.openstreetmap" ]
+
+include_recipe "ssl"
include_recipe "squid"
tilecaches = search(:node, "roles:tilecache").sort_by { |n| n[:hostname] }
description "Role applied to all tile cache servers"
default_attributes(
- :ssl => {
- :certificate => "tile.openstreetmap"
- },
:sysctl => {
:network_conntrack_time_wait => {
:comment => "Only track completed connections for 30 seconds",
run_list(
"role[geodns]",
- "recipe[ssl]",
"recipe[tilecache]"
)