TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/wikioasis/salt/llms.txt
Use this file to discover all available pages before exploring further.
mediawiki Salt state tree manages the full lifecycle infrastructure for deploying MediaWiki across the WikiOasis fleet. It is split into four sub-states: the main mediawiki state that sets up the staging server with the mwdeploy system user, deployment script, and config; mediawiki.proxy which provisions the deploy user on proxy* servers with HAProxy socket access; mediawiki.target which prepares mw* application servers to receive rsync pushes; and mediawiki.jobrunner which installs and runs the Wikimedia jobrunner and jobchron services for async job processing.
Pillar keys
All keys live under the top-levelmediawiki: map in pillar/mediawiki/init.sls.
| Key | Default | Description |
|---|---|---|
deploy_user | mwdeploy | System user that runs all deploy operations |
staging_path | /srv/mediawiki-staging | Path for the git-managed staging checkout |
prod_path | /srv/mediawiki | Production MediaWiki path on each server |
canary_vhost | test.wikioasis.org | Vhost used for canary validation before fleet rollout |
log_file | /var/log/mwdeploy.log | Path to the mwdeploy operation log |
haproxy_backend | mediawiki | HAProxy backend name to drain/restore during deploy |
haproxy_socket | /run/haproxy/admin.sock | Path to the HAProxy admin socket |
backup_path | /srv/mediawiki-backup | Path where the pre-deploy backup is stored |
mw_servers | [] | List of application server FQDNs to push to |
proxy_servers | [] | List of HAProxy server FQDNs to update routing on |
ssh_identity | /home/mwdeploy/.ssh/id_ed25519 | SSH private key used for all rsync/SSH operations |
deploy_ssh_public_key | (none) | Public key to authorize on the deploy user’s account |
webhooks | {} | Map of webhook targets; supports discord and slack URL keys |
Production pillar values
mediawiki (staging server)
Applied to the staging server, this state sets up everything themwdeploy script needs to operate.
Create the deploy user
Creates the
mwdeploy system user with a home directory and shell. If deploy_ssh_public_key is set in pillar, that key is added to the user’s authorized_keys so the deploy user can be reached via SSH from the master.Write /etc/mwdeploy/config.yaml
Renders the Jinja config template with all pillar values. The deploy user is given group read access (
0640, group mwdeploy).Pre-create the log file
Creates
/var/log/mwdeploy.log owned by the deploy user (replace: false — existing log is never truncated).Create staging and production directories
Creates
staging_path and prod_path owned by www-data so git operations (which run as www-data) can write to them.Staging sudoers
config.yaml template
The rendered/etc/mwdeploy/config.yaml is generated from salt://mediawiki/files/config.yaml.jinja:
mediawiki.proxy
Applied toproxy* servers. Creates the mwdeploy system user with membership in the haproxy group so it can write to the HAProxy admin socket at /run/haproxy/admin.sock. This allows the deploy script to drain and restore backends during rolling deploys without requiring root.
The
mwdeploy user must be in the haproxy group before a deploy is attempted. Run mediawiki.proxy after any new proxy server is provisioned.mediawiki.target
Applied tomw* application servers. Prepares each backend to receive rsync pushes from the staging server.
- Creates the
mwdeploysystem user and.sshdirectory - Authorizes the
deploy_ssh_public_keyfrom pillar (the staging server’s public key) - Creates the production directory at
prod_pathowned bywww-data - Writes
/etc/sudoers.d/mwdeploy_target:
mediawiki.jobrunner
Applied tomw* servers that run async MediaWiki jobs. Installs and runs the Wikimedia mediawiki-services-jobrunner and a companion mediawiki-jobchron cron dispatcher.
What it does
Clone the jobrunner repository
Uses
git.latest to keep /srv/mediawiki-services-jobrunner up to date from the upstream Wikimedia GitHub repository.Write the config
Renders
/etc/mediawiki-jobrunner/config.json from Jinja, populating Redis host, statsd endpoint, job group settings, and the PHP dispatcher command.Install systemd units
Manages
/etc/systemd/system/mediawiki-jobrunner.service and mediawiki-jobchron.service from the Salt fileserver.Jobrunner pillar keys
| Key | Default | Description |
|---|---|---|
mediawiki_jobrunner:redis_host | redis-us-east-012.ovvin.wonet | Redis host for job queues and aggregators |
mediawiki_jobrunner:redis_port | 6379 | Redis port |
mediawiki_jobrunner:mw_path | /srv/mediawiki | Path to the MediaWiki installation |
mediawiki_jobrunner:php_binary | /usr/bin/php | PHP binary used by the dispatcher |