MediaWiki web GUI installer comes up

This commit is contained in:
Kris Lamoureux 2020-01-30 20:06:53 -05:00
parent c9b21fa712
commit 9a6e6a0d43
Signed by: kris
GPG Key ID: 3EDA9C3441EDA925
3 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,56 @@
- name: Install MySQL Support for Python
apt:
name: python-pymysql
state: present
- name: Create Database
mysql_db:
name: "{{ mw_db_name }}"
state: present
login_unix_socket: /var/run/mysqld/mysqld.sock
- name: Create Database User
mysql_user:
name: "{{ mw_db_user }}"
password: "{{ mw_db_pass }}"
priv: "{{ mw_db_name }}.*:ALL,GRANT"
state: present
login_unix_socket: /var/run/mysqld/mysqld.sock
- name: Create Public HTML Directory
file:
path: "{{ mw_dir }}/public_html"
state: directory
- name: Create Logs Directory
file:
path: "{{ mw_dir }}/logs"
state: directory
- name: Download MediaWiki
get_url:
url: "https://releases.wikimedia.org/mediawiki/\
{{ mw_version | regex_replace('\\.\\d+$', '') }}/\
mediawiki-{{ mw_version }}.tar.gz"
dest: /tmp/mediawiki-{{ mw_version }}.tar.gz
- name: Extract MediaWiki
unarchive:
src: /tmp/mediawiki-{{ mw_version }}.tar.gz
dest: "{{ mw_dir }}/public_html"
owner: www-data
group: www-data
extra_opts: [--strip-components=1]
remote_src: yes
- name: Apply Apache Configuration
template:
src: mediawiki.conf.j2
dest: /etc/apache2/sites-available/{{ mw_domain }}.conf
notify: Reload Apache2
- name: Enable Apache Website
shell: a2ensite {{ mw_domain }}
args:
creates: /etc/apache2/sites-enabled/{{ mw_domain }}.conf
notify: Reload Apache2

View File

@ -0,0 +1,11 @@
<VirtualHost *:80>
ServerName {{ mw_domain }}
ServerAdmin {{ mw_admin_email }}
DocumentRoot {{ mw_dir }}/public_html
ErrorLog {{ mw_dir }}/logs/error.log
CustomLog {{ mw_dir }}/logs/access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

View File

@ -22,3 +22,4 @@
- wordpress
- nextcloud
- timetrex
- mediawiki