Move SSL certificates to private repository
authorTom Hughes <tom@compton.nu>
Thu, 27 Oct 2016 19:51:56 +0000 (20:51 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 27 Oct 2016 19:52:50 +0000 (20:52 +0100)
Having the keys and certificates live in the same place makes
it easier to mock them in the test environment.

cookbooks/ssl/files/default/openstreetmap.pem [deleted file]
cookbooks/ssl/files/default/osmfoundation.pem [deleted file]
cookbooks/ssl/files/default/tile.openstreetmap.pem [deleted file]
cookbooks/ssl/recipes/default.rb

diff --git a/cookbooks/ssl/files/default/openstreetmap.pem b/cookbooks/ssl/files/default/openstreetmap.pem
deleted file mode 100644 (file)
index 68b7f14..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIFfDCCBGSgAwIBAgIQeWB+DWjnV3piZyYD35jm/DANBgkqhkiG9w0BAQsFADBC
-MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMS
-UmFwaWRTU0wgU0hBMjU2IENBMB4XDTE2MDMwMjAwMDAwMFoXDTE3MDUwMTIzNTk1
-OVowHjEcMBoGA1UEAwwTKi5vcGVuc3RyZWV0bWFwLm9yZzCCASIwDQYJKoZIhvcN
-AQEBBQADggEPADCCAQoCggEBALoJ/ZP1Dqdujj8feEV2v8GAyN8CPk+YP0ME7X5g
-dVxTj7bBQjWvMPLT+AhxkTV/oH6h7PCk/Ew97PKcaOIKMmRKkChxDj5FY8iaSc0x
-xc0yGXqVRYalwJ3nh13SRuHLeYJp9shecXmhbRlEt+aTc40y4gbJl9FpP6BbKw+Z
-D34xQusCEHWAnXcH6qefhYyyu3RCposY4MQ6E+dnFxc9GynOhBbpwE4Y9RTavTiU
-TuonIpos5IFx+TNww/WC+tO9L5CwkW/iwJSnSedU2xoBjMLAgltxgIfv2Ft9QmzR
-PfCo7Z5F7CWsEFWBO4Dkcwjmvf03BhejBkO1yT7BZhqVtucCAwEAAaOCApAwggKM
-MDEGA1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QB0ImHocjRxa6a/gYjNSQms18/wc0HLKCugs1JgsTlWQrS2
-voYgIqH0nLiPKvxQgqvI69XTb5DsR6b57AjjEfEf9f+z3t5u0bDKwOXDWOmu/tS7
-gVD+GwqjdrOIhKVjFgoPS3/hm2BTUH3jlPUOpjvNPVtFNt8qqlWdk6RmB7USHUZ7
-u2abSKWWlzhmXKob6hXMeQ==
------END CERTIFICATE-----
diff --git a/cookbooks/ssl/files/default/osmfoundation.pem b/cookbooks/ssl/files/default/osmfoundation.pem
deleted file mode 100644 (file)
index fae3688..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIIzDCCB7SgAwIBAgIHBsLao8VPUzANBgkqhkiG9w0BAQsFADCBjDELMAkGA1UE
-BhMCSUwxFjAUBgNVBAoTDVN0YXJ0Q29tIEx0ZC4xKzApBgNVBAsTIlNlY3VyZSBE
-aWdpdGFsIENlcnRpZmljYXRlIFNpZ25pbmcxODA2BgNVBAMTL1N0YXJ0Q29tIENs
-YXNzIDIgUHJpbWFyeSBJbnRlcm1lZGlhdGUgU2VydmVyIENBMB4XDTE1MDIyMTAz
-MDg1OFoXDTE3MDIyMTAwNDk1OFowgacxCzAJBgNVBAYTAkdCMRMwEQYDVQQIEwpC
-aXJtaW5naGFtMRkwFwYDVQQHExBTdXR0b24gQ29sZGZpZWxkMSEwHwYDVQQKExhP
-cGVuU3RyZWV0TWFwIEZvdW5kYXRpb24xHDAaBgNVBAMUEyoub3NtZm91bmRhdGlv
-bi5vcmcxJzAlBgkqhkiG9w0BCQEWGGFkbWluc0BvcGVuc3RyZWV0bWFwLm9yZzCC
-ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJuxe5wR46CZT0V6j6mTiRf2
-14sK3tPuYsd88RplllgPpBFBBgbXaQHye/65b+TBKTwi1gaOFl9dwwa//Zo0iser
-rz+vO2/NKVnJVfZoP6X3TOGMGAssHxWsaPVaD/Kju91B6oC+8XlN3US2Pyzizt6M
-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wygd1uubzInmtrXWhpNmQ3M4W53RJlOeU98TMkJiUcqx2kqBFyYbvT2G6u2nxQ
-6U9ytr2VZF59iQ9tE9hDM+aqVPjMQdk45TKdraDu1MW0Q/zRPBp+FLn7+nl83Zdd
-HEk0+GC4+fU4L5luprtmlkSESA2+beQ613OzKcwYMfClPCRTTooJbgK1OShRCgYm
-gqEPJj20V0So8A1pTcLB2VQ68Fwrj5ckqJrjXN1djneWcnIFzEG9UvJlCKxd2pPc
------END CERTIFICATE-----
diff --git a/cookbooks/ssl/files/default/tile.openstreetmap.pem b/cookbooks/ssl/files/default/tile.openstreetmap.pem
deleted file mode 100644 (file)
index 8b12394..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIEszCCA5ugAwIBAgIDBG0mMA0GCSqGSIb3DQEBCwUAMEcxCzAJBgNVBAYTAlVT
-MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMSAwHgYDVQQDExdSYXBpZFNTTCBTSEEy
-NTYgQ0EgLSBHMzAeFw0xNTA1MTYwNzI4MDZaFw0xNzEwMjAxODE4MDFaMIGcMRMw
-EQYDVQQLEwpHVDEwOTU2Njk3MTEwLwYDVQQLEyhTZWUgd3d3LnJhcGlkc3NsLmNv
-bS9yZXNvdXJjZXMvY3BzIChjKTEzMS8wLQYDVQQLEyZEb21haW4gQ29udHJvbCBW
-YWxpZGF0ZWQgLSBSYXBpZFNTTChSKTEhMB8GA1UEAwwYKi50aWxlLm9wZW5zdHJl
-ZXRtYXAub3JnMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyW5uaqU3
-viA8NeRI3mFetA7LAruts+aXZhdtV2EBbdzlGEXN8qtolaI598EijEW/NP2dE0ra
-F5oNpRCwfj8dDDVoDZg3rD+aHARyYFH2ayOKoRs1zHeOKq7AsKbXfhWZCorrBQWU
-oGbhbuoHS0sId/XD7oIcWGxwJ7dRWteGLZ8bxLjD3jADmHecivhKWo9P/Yxl0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dXN0LmNvbS9yZXNvdXJjZXMvY3BzMA0GCSqGSIb3DQEBCwUAA4IBAQCjWB7GQzKs
-rC+TeLfqrlRARy1+eI1Q9vhmrNZPc9ZE768LzFvB9E+aj0l+YK/CJ8cW8fuTgZCp
-fO9vfm5FlBaEvexJ8cQO9K8EWYOHDyw7l8NaEpt7BDV7o5UzCHuTcSJCs6nZb0+B
-kvwHtnm8hEqddwnxxYny8LScVKoSew26T++TGezvfU5ho452nFnPjJSxhJf3GrkH
-uLLGTxN5279PURt/aQ1RKsHWFf83UTRlUfQevjhq7A6rvz17OQV79PP7GqHQyH5O
-ZI3NjGFVkP46yl0lD/gdo0p0Vk8aVUBwdSWmMy66S6VdU5oNMOGNX2Esr8zvsJmh
-gP8L8mJMcCaY
------END CERTIFICATE-----
index 33c9bcb..976db15 100644 (file)
@@ -18,6 +18,7 @@
 #
 
 keys = data_bag_item("ssl", "keys")
+certs = data_bag_item("ssl", "certs")
 
 package "openssl"
 package "ssl-cert"
@@ -33,10 +34,11 @@ end
 
 ["openstreetmap", "tile.openstreetmap", "osmfoundation"].each do |certificate|
   if node[:ssl][:certificates].include?(certificate)
-    cookbook_file "/etc/ssl/certs/#{certificate}.pem" do
+    file "/etc/ssl/certs/#{certificate}.pem" do
       owner "root"
       group "root"
       mode 0o444
+      content certs[certificate].join("\n")
       backup false
     end