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 91af978..b9181ed 100644 (file)
@@ -8,5 +8,6 @@ version           "1.0.0"
 depends           "apache"
 depends           "chef"
 depends           "mysql"
+depends           "ssl"
 gem               "httpclient"
 gem               "php_serialize"
index 36b6f5a..25c5aad 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 200c500..b627051 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>