Install the tile.openstreetmap.org certificate on tile servers
authorTom Hughes <tom@compton.nu>
Thu, 17 Oct 2013 17:17:29 +0000 (18:17 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 17 Oct 2013 17:18:47 +0000 (18:18 +0100)
cookbooks/ssl/attributes/default.rb [new file with mode: 0644]
cookbooks/ssl/files/default/tile.openstreetmap.pem [new file with mode: 0644]
cookbooks/ssl/recipes/default.rb
roles/tilecache.rb

diff --git a/cookbooks/ssl/attributes/default.rb b/cookbooks/ssl/attributes/default.rb
new file mode 100644 (file)
index 0000000..c9f1dcd
--- /dev/null
@@ -0,0 +1 @@
+default[:ssl][:certificate] = "openstreetmap"
diff --git a/cookbooks/ssl/files/default/tile.openstreetmap.pem b/cookbooks/ssl/files/default/tile.openstreetmap.pem
new file mode 100644 (file)
index 0000000..730bb5c
--- /dev/null
@@ -0,0 +1,30 @@
+-----BEGIN CERTIFICATE-----
+MIIFNjCCBB6gAwIBAgIDDpOwMA0GCSqGSIb3DQEBBQUAMDwxCzAJBgNVBAYTAlVT
+MRcwFQYDVQQKEw5HZW9UcnVzdCwgSW5jLjEUMBIGA1UEAxMLUmFwaWRTU0wgQ0Ew
+HhcNMTMxMDE2MTIxMjQxWhcNMTcxMDE4MDc0OTI3WjCBxzEpMCcGA1UEBRMgR1g3
+Z1NuNS9OSnNiYUdrWlpLNHZ1U3dlTGNRZXZXTXMxEzARBgNVBAsTCkdUMTA5NTY2
+OTcxMTAvBgNVBAsTKFNlZSB3d3cucmFwaWRzc2wuY29tL3Jlc291cmNlcy9jcHMg
+KGMpMTMxLzAtBgNVBAsTJkRvbWFpbiBDb250cm9sIFZhbGlkYXRlZCAtIFJhcGlk
+U1NMKFIpMSEwHwYDVQQDDBgqLnRpbGUub3BlbnN0cmVldG1hcC5vcmcwggEiMA0G
+CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsfSa4q/TOq5/FVGKxoNaY4T7dXIRS
+jAH+dnm3zlStyD/o9N8kuf1cRYF/qGb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y6EdgycU3+iayswIyxSABL29W4nhusJqhw6I9
+Zcxd1FErz+Al0qfuEBDxcuUaywhTolka8YFtflBoGTMPWwh8NHxc9zZhJ1JcLve2
+uY0c2wS2CJWGAsTFN6i0Xxy/jsuP23uXTmHSk7fKcV0UkdjiQB6+WP6OoFwWISM6
+YiuxK+wu50s8Cb2OJ12aBmojbEH/QBKJXIVBsbtumUA+3LEcUnor3nz7
+-----END CERTIFICATE-----
index 4bbcea4..a3a2708 100644 (file)
@@ -29,17 +29,17 @@ cookbook_file "/etc/ssl/certs/rapidssl.pem" do
   backup false
 end
 
-cookbook_file "/etc/ssl/certs/openstreetmap.pem" do
+cookbook_file "/etc/ssl/certs/#{node[:ssl][:certificate]}.pem" do
   owner "root"
   group "root"
   mode 0444
   backup false
 end
 
-file "/etc/ssl/private/openstreetmap.key" do
+file "/etc/ssl/private/#{node[:ssl][:certificate]}.key" do
   owner "root"
   group "ssl-cert"
   mode 0440
-  content keys["openstreetmap"].join("\n")
+  content keys[node[:ssl][:certificate]].join("\n")
   backup false
 end
index daaaddf..3f3f3f0 100644 (file)
@@ -2,6 +2,9 @@ name "tilecache"
 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",
@@ -20,5 +23,6 @@ default_attributes(
 
 run_list(
   "role[geodns]",
+  "recipe[ssl]",
   "recipe[tilecache]"
 )