X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/3a38185237fab2c369bce4cdc3723f1fa563c1c1..a4d04a4891133e5b8e623c316dc2147f1b333ae9:/cookbooks/mediawiki/providers/site.rb diff --git a/cookbooks/mediawiki/providers/site.rb b/cookbooks/mediawiki/providers/site.rb index 24a3ae984..c17f871ca 100644 --- a/cookbooks/mediawiki/providers/site.rb +++ b/cookbooks/mediawiki/providers/site.rb @@ -160,9 +160,9 @@ action :create do :database_params => new_resource.database_params end - mediawiki_skin "CologneBlue" do + mediawiki_skin "CologneBlue" do # ~FC005 site new_resource.name - update_site false + update_site false end mediawiki_skin "Modern" do @@ -400,13 +400,15 @@ action :create do backup false end + ports = new_resource.ssl_enabled ? [80, 443] : [80] + apache_site new_resource.name do cookbook "mediawiki" template "apache.erb" directory site_directory variables :aliases => Array(new_resource.aliases), :private => new_resource.private, - :ssl_enabled => new_resource.ssl_enabled, + :ports => ports, :ssl_certificate => new_resource.ssl_certificate, :ssl_certificate_chain => new_resource.ssl_certificate_chain reload_apache false @@ -422,6 +424,31 @@ action :create do end end +action :update do + mediawiki_directory = "#{site_directory}/w" + + template "#{mediawiki_directory}/LocalSettings.php" do + cookbook "mediawiki" + source "LocalSettings.php.erb" + owner node[:mediawiki][:user] + group node[:mediawiki][:group] + mode 0664 + variables :name => new_resource.name, + :directory => mediawiki_directory, + :database_params => new_resource.database_params, + :mediawiki => new_resource.mediawiki_params + notifies :run, "execute[#{mediawiki_directory}/maintenance/update.php]" + end + + execute "#{mediawiki_directory}/maintenance/update.php" do + action :run + command "php maintenance/update.php --quick" + cwd mediawiki_directory + user node[:mediawiki][:user] + group node[:mediawiki][:group] + end +end + action :delete do apache_site new_resource.name do action :delete