diff --git a/roles/services/wiki/tasks/main.yml b/roles/services/wiki/tasks/main.yml index d10e1da..4d2d2a3 100644 --- a/roles/services/wiki/tasks/main.yml +++ b/roles/services/wiki/tasks/main.yml @@ -77,3 +77,8 @@ enabled: yes state: restarted when: php_config.changed + +- name: Deploy wiki-farm update maintenance script + template: + src: wiki_update.sh.j2 + dest: "/home/{{ ansible_user }}/.local/bin/wiki_update.sh" diff --git a/roles/services/wiki/templates/LocalSettings.php.j2 b/roles/services/wiki/templates/LocalSettings.php.j2 index e9e82e3..c5ccddf 100644 --- a/roles/services/wiki/templates/LocalSettings.php.j2 +++ b/roles/services/wiki/templates/LocalSettings.php.j2 @@ -3,6 +3,10 @@ if ( !defined( 'MEDIAWIKI' ) ) { exit; } +if ( !isset( $_SERVER['REQUEST_URI'] ) ) { + $_SERVER['REQUEST_URI'] = $argv; +} + $callingurl = strtolower( $_SERVER['REQUEST_URI'] ); // get the calling url if ( strpos( $callingurl, '/{{ wiki_names[0] }}' ) === 0 ) { require_once 'LocalSettings_{{ wiki_names[0] }}.php'; diff --git a/roles/services/wiki/templates/wiki_update.sh.j2 b/roles/services/wiki/templates/wiki_update.sh.j2 new file mode 100644 index 0000000..95a2bca --- /dev/null +++ b/roles/services/wiki/templates/wiki_update.sh.j2 @@ -0,0 +1,9 @@ +#!/bin/sh + +cd /usr/share/webapps/mediawiki + +maintenance/update.php "/{{ wiki_names[0] }}" + +{%- for extra_wiki in wiki_names[1:] %} +maintenance/update.php "/{{ extra_wiki }}" +{% endfor %}