summaryrefslogtreecommitdiffstats
path: root/roles/mediawiki
diff options
context:
space:
mode:
Diffstat (limited to 'roles/mediawiki')
-rw-r--r--roles/mediawiki/defaults/main.yml3
-rw-r--r--roles/mediawiki/meta/main.yml4
-rw-r--r--roles/mediawiki/tasks/main.yml31
-rw-r--r--roles/mediawiki/templates/wiki.conf5
4 files changed, 43 insertions, 0 deletions
diff --git a/roles/mediawiki/defaults/main.yml b/roles/mediawiki/defaults/main.yml
new file mode 100644
index 0000000..7772db3
--- /dev/null
+++ b/roles/mediawiki/defaults/main.yml
@@ -0,0 +1,3 @@
+---
+cache_dir: /var/tmp/
+version: 1.24.0
diff --git a/roles/mediawiki/meta/main.yml b/roles/mediawiki/meta/main.yml
new file mode 100644
index 0000000..30f5257
--- /dev/null
+++ b/roles/mediawiki/meta/main.yml
@@ -0,0 +1,4 @@
+---
+dependencies:
+- { role: httpd, custom_vhost: yes }
+
diff --git a/roles/mediawiki/tasks/main.yml b/roles/mediawiki/tasks/main.yml
new file mode 100644
index 0000000..2f52933
--- /dev/null
+++ b/roles/mediawiki/tasks/main.yml
@@ -0,0 +1,31 @@
+---
+- yum: name={{ item }} state=installed
+ with_items:
+ - php-fpm
+ - php-mysql
+ - php-gd
+ - php-xml
+
+- get_url: dest={{ cache_dir }}/{{ item }} url=https://releases.wikimedia.org/mediawiki/{{ version | regex_replace('^(\d+)\.(\d+).*$', '\\1.\\2') }}/{{ item }}
+ with_items:
+ - mediawiki-{{ version }}.tar.gz
+ - mediawiki-{{ version }}.tar.gz.sig
+ register: result
+
+# TODO verify the signature when downloaded
+
+- file: state=directory name=/var/www/mediawiki{{ item }}
+ with_items:
+ - /
+ - /cache
+
+- command: creates=/var/www/mediawiki/mediawiki-{{ version }} tar -x --owner=root --group=root -f {{ cache_dir }}/mediawiki-{{ version }}.tar.gz -C /var/www/mediawiki/
+
+# TODO selinux path ?
+- file: path=/var/www/mediawiki/mediawiki-{{ version }}/cache owner=apache state=directory
+
+- template: src=wiki.conf dest=/etc/httpd/conf.d/www.theopensourceway.org.conf.d/wiki.conf
+ notify: restart httpd
+
+# upload dir, SELinux
+- file: state=directory path=/var/www/mediawiki_upload owner=apache
diff --git a/roles/mediawiki/templates/wiki.conf b/roles/mediawiki/templates/wiki.conf
new file mode 100644
index 0000000..cc94ff6
--- /dev/null
+++ b/roles/mediawiki/templates/wiki.conf
@@ -0,0 +1,5 @@
+Alias /wiki/ /var/www/mediawiki/mediawiki-{{ version }}/
+<Directory "/var/www/mediawiki/mediawiki-{{ version }}">
+ Order deny,allow
+ Allow from all
+</Directory>