From 98676274a8be4b77071e61087125e5cf86bbf29c Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Tue, 16 Dec 2014 00:52:21 +0100 Subject: Add a draft version of the mediawiki role --- roles/mediawiki/defaults/main.yml | 3 +++ roles/mediawiki/meta/main.yml | 4 ++++ roles/mediawiki/tasks/main.yml | 31 +++++++++++++++++++++++++++++++ roles/mediawiki/templates/wiki.conf | 5 +++++ 4 files changed, 43 insertions(+) create mode 100644 roles/mediawiki/defaults/main.yml create mode 100644 roles/mediawiki/meta/main.yml create mode 100644 roles/mediawiki/tasks/main.yml create mode 100644 roles/mediawiki/templates/wiki.conf 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 }}/ + + Order deny,allow + Allow from all + -- cgit