X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/18e12b0e123fc3e5f344682f884feabc12da0f5a..901782e5452c232c7e6f644f2c56a3903b09edf3:/cookbooks/wordpress/resources/site.rb?ds=sidebyside diff --git a/cookbooks/wordpress/resources/site.rb b/cookbooks/wordpress/resources/site.rb index ee934318f..1f4e67cc0 100644 --- a/cookbooks/wordpress/resources/site.rb +++ b/cookbooks/wordpress/resources/site.rb @@ -1,8 +1,7 @@ -http -# Cookbook Name:: wordpress +# Cookbook:: wordpress # Resource:: wordpress_site # -# Copyright 2015, OpenStreetMap Foundation +# Copyright:: 2015, OpenStreetMap Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -21,7 +20,7 @@ require "securerandom" default_action :create -property :site, :kind_of => String, :name_attribute => true +property :site, :kind_of => String, :name_property => true property :aliases, :kind_of => [String, Array] property :directory, :kind_of => String property :version, :kind_of => String @@ -29,7 +28,6 @@ property :database_name, :kind_of => String, :required => true property :database_user, :kind_of => String, :required => true property :database_password, :kind_of => String, :required => true property :database_prefix, :kind_of => String, :default => "wp_" -property :ssl_enabled, :kind_of => [TrueClass, FalseClass], :default => false property :urls, :kind_of => Hash, :default => {} property :reload_apache, :kind_of => [TrueClass, FalseClass], :default => true @@ -92,10 +90,8 @@ action :create do line += " * Don't allow file editing.\n" line += " */\n" line += "define('DISALLOW_FILE_EDIT', true);\n" - if new_resource.ssl_enabled - line += "define('FORCE_SSL_LOGIN', true);\n" - line += "define('FORCE_SSL_ADMIN', true);\n" - end + line += "define('FORCE_SSL_LOGIN', true);\n" + line += "define('FORCE_SSL_ADMIN', true);\n" end line @@ -132,7 +128,6 @@ action :create do ssl_certificate new_resource.site do domains [new_resource.site] + Array(new_resource.aliases) - only_if { new_resource.ssl_enabled } end apache_site new_resource.site do @@ -140,14 +135,13 @@ action :create do template "apache.erb" directory site_directory variables :aliases => Array(new_resource.aliases), - :urls => new_resource.urls, - :ssl_enabled => new_resource.ssl_enabled + :urls => new_resource.urls reload_apache false end - http_request "http://#{new_resource.site}/wp-admin/upgrade.php" do + http_request "https://#{new_resource.site}/wp-admin/upgrade.php" do action :nothing - url "http://#{new_resource.site}/wp-admin/upgrade.php?step=1" + url "https://#{new_resource.site}/wp-admin/upgrade.php?step=1" subscribes :get, "subversion[#{site_directory}]" end