Issue letsencrypt certificates for wordpress sites
authorTom Hughes <tom@compton.nu>
Sat, 11 Feb 2017 19:32:35 +0000 (19:32 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 11 Feb 2017 19:32:35 +0000 (19:32 +0000)
cookbooks/wordpress/metadata.rb
cookbooks/wordpress/providers/site.rb
cookbooks/wordpress/templates/default/apache.erb

index 91af9782b8f4f2ced29d8c79a32cb092fbd67827..b9181ed5e86537f254ebade7441965372b16f8dd 100644 (file)
@@ -8,5 +8,6 @@ version           "1.0.0"
 depends           "apache"
 depends           "chef"
 depends           "mysql"
+depends           "ssl"
 gem               "httpclient"
 gem               "php_serialize"
index 36b6f5a3be050f15ae935a02f4afa0c50fc8f820..25c5aadb2881a321f4cf9915a6b8d1fd51bd7edf 100644 (file)
@@ -124,6 +124,10 @@ action :create do
     backup false
   end
 
+  ssl_certificate new_resource.name do
+    domains [new_resource.name] + Array(new_resource.aliases)
+  end
+
   apache_site new_resource.name do
     cookbook "wordpress"
     template "apache.erb"
index 200c500894c285c1a0743e4fe7c306c07d432990..b627051000d7c4cfeb9f8a091c54c5597f34c68c 100644 (file)
@@ -12,6 +12,7 @@
   ErrorLog /var/log/apache2/<%= @name %>-error.log
 
 <% if @ssl_enabled -%>
+  RedirectPermanent /.well-known/acme-challenge/ http://acme.openstreetmap.org/.well-known/acme-challenge/
   RedirectPermanent / https://<%= @name %>/
 </VirtualHost>