mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-09-14 14:26:04 +02:00
MediaWiki: runtime patch for LocalSettings.php (URL, DB, lang) + safe quoting
- Add 03_patch_settings.yml to sync $wgServer/$wgCanonicalServer, DB vars, and language - Use single-quoted PHP strings with proper escaping; idempotent grep guards - Wire task into main.yml; rename 03_admin→04_admin and 04_extensions→05_extensions Ref: https://chatgpt.com/share/68c3649a-e830-800f-a059-fc8eda8f76bb
This commit is contained in:
19
roles/web-app-mediawiki/tasks/04_admin.yml
Normal file
19
roles/web-app-mediawiki/tasks/04_admin.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
- name: "Create MediaWiki admin user"
|
||||
command: >
|
||||
docker exec
|
||||
-u {{ MEDIAWIKI_USER }}
|
||||
{{ MEDIAWIKI_CONTAINER }}
|
||||
php /var/www/html/maintenance/createAndPromote.php
|
||||
--bureaucrat --sysop
|
||||
{{ MEDIAWIKI_ADMINISTRATOR_NAME }}
|
||||
{{ MEDIAWIKI_ADMINISTRATOR_PASSWORD }}
|
||||
{{ MEDIAWIKI_ADMINISTRATOR_EMAIL }}
|
||||
register: create_admin
|
||||
changed_when: >
|
||||
('created' in ((create_admin.stdout | default('')) ~ (create_admin.stderr | default('')))) or
|
||||
('Created' in ((create_admin.stdout | default('')) ~ (create_admin.stderr | default(''))))
|
||||
failed_when: >
|
||||
create_admin.rc != 0 and
|
||||
('already exists' not in ((create_admin.stdout | default('')) ~ (create_admin.stderr | default('')))) and
|
||||
('Account exists' not in ((create_admin.stdout | default('')) ~ (create_admin.stderr | default(''))))
|
||||
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
|
Reference in New Issue
Block a user