buluma.mediawiki
Ansible Role mediawiki
This role installs and configures MediaWiki on your system.
GitHub | Version | Issues | Pull Requests | Downloads |
---|---|---|---|---|
Example Playbook
Here is a simple playbook example taken from molecule/default/converge.yml
, which is tested after each change.
---
- name: Converge
hosts: all
become: true
gather_facts: true
pre_tasks:
- name: Update apt cache
apt: update_cache=yes cache_valid_time=600
when: ansible_os_family == 'Debian'
changed_when: false
- name: Check if python3.11 EXTERNALLY-MANAGED file exists
ansible.builtin.stat:
path: /usr/lib/python3.11/EXTERNALLY-MANAGED
register: externally_managed_file_py311
- name: Rename python3.11 EXTERNALLY-MANAGED file if it exists
ansible.builtin.command:
cmd: mv /usr/lib/python3.11/EXTERNALLY-MANAGED /usr/lib/python3.11/EXTERNALLY-MANAGED.old
when: externally_managed_file_py311.stat.exists
args:
creates: /usr/lib/python3.11/EXTERNALLY-MANAGED.old
- name: Check if python3.12 EXTERNALLY-MANAGED file exists
ansible.builtin.stat:
path: /usr/lib/python3.12/EXTERNALLY-MANAGED
register: externally_managed_file_py312
- name: Rename python3.12 EXTERNALLY-MANAGED file if it exists
ansible.builtin.command:
cmd: mv /usr/lib/python3.12/EXTERNALLY-MANAGED /usr/lib/python3.12/EXTERNALLY-MANAGED.old
when: externally_managed_file_py312.stat.exists
args:
creates: /usr/lib/python3.12/EXTERNALLY-MANAGED.old
roles:
- role: buluma.mediawiki
mediawiki_destination: /opt
Before running MediaWiki, your machine must be prepared. This is done in CI using molecule/default/prepare.yml
:
---
- name: Prepare
hosts: all
gather_facts: false
become: true
roles:
- role: buluma.bootstrap
- role: buluma.core_dependencies
- role: buluma.epel
- role: buluma.python_pip
- role: buluma.buildtools
- role: buluma.openssl
openssl_items:
- name: apache-httpd
common_name: "{{ ansible_fqdn }}"
- role: buluma.httpd
- role: buluma.php
- role: buluma.mysql
mysql_databases:
- name: mediawiki
mysql_users:
- name: mediawiki
password: m3d14w1k1
priv: "mediawiki.*:ALL"
You can find a full guide on using these roles.
Role Variables
Default variable values are defined in defaults/main.yml
:
---
# defaults file for mediawiki
# The version (major.minor.release) to install.
mediawiki_major: 1
mediawiki_minor: 37
mediawiki_release: 1
mediawiki_version: "{{ mediawiki_major }}.{{ mediawiki_minor }}.{{ mediawiki_release }}"
# Where to install MediaWiki. Change this to a simple path string.
mediawiki_destination: "{{ _mediawiki_destination[ansible_distribution] | default(_mediawiki_destination['default']) }}"
Requirements
- You need to install pip packages from requirements.txt.
State of Used Roles
Several roles are used to prepare the system. You can also prepare your system differently.
Requirement | GitHub | Version |
---|---|---|
buluma.bootstrap | ||
buluma.buildtools | ||
buluma.core_dependencies | ||
buluma.epel | ||
buluma.httpd | ||
buluma.mysql | ||
buluma.openssl | ||
buluma.php | ||
buluma.python_pip |
Dependencies
Most roles need some setup, which is done in molecule/default/prepare.yml
. This role heavily depends on the following role:
- {'role': 'buluma.httpd'}
Context
This role works with many compatible roles. Check the documentation of these roles for more details.
Here’s a visual overview of related roles:
Compatibility
This role has been tested on the following container images:
container | tags |
---|---|
Debian | all |
Fedora | all |
Ubuntu | jammy, bionic, noble |
You need Ansible version 2.12 or higher. Tests have been run on:
- Previous version.
- Current version.
- Development version.
If you find any issues, please report them on GitHub.
Changelog
See the Role History.
License
This project is licensed under Apache-2.0.
Author Information
Created by Shadow Walker.
Install and configure mediawiki on your system.
ansible-galaxy install buluma.mediawiki