Add wiki-farm update script

This commit is contained in:
dogeystamp 2022-03-12 15:12:07 -05:00
parent df2c5ec021
commit 5c552736bb
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
3 changed files with 18 additions and 0 deletions

View File

@ -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"

View File

@ -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';

View File

@ -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 %}