summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorMichael Scherer <misc@zarb.org>2014-12-16 00:52:21 +0100
committerMichael Scherer <misc@zarb.org>2014-12-16 00:52:21 +0100
commit98676274a8be4b77071e61087125e5cf86bbf29c (patch)
treed5e06231a276f31815f63c14b2ab07f063462da2 /roles
parent4670294ffdd1adc98a2523a7d667e79f2315feb1 (diff)
Add a draft version of the mediawiki role
Diffstat (limited to 'roles')
-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>