From 5e82eb85edc36fb978588fceb8e622d76d727afa Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Mon, 23 Mar 2015 18:32:29 +0100 Subject: Add a bit more code for deploying mediawiki --- roles/mediawiki/tasks/main.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'roles/mediawiki/tasks') diff --git a/roles/mediawiki/tasks/main.yml b/roles/mediawiki/tasks/main.yml index 2f52933..2a9f1da 100644 --- a/roles/mediawiki/tasks/main.yml +++ b/roles/mediawiki/tasks/main.yml @@ -6,6 +6,9 @@ - php-gd - php-xml +- set_fact: wiki_secret_key="{{ lookup('password', 'passwords/mediawiki/wiki_secret_key length=60') }}" +- set_fact: wiki_db_password="{{ lookup('password', 'passwords/mediawiki/wiki_db_password length=12') }}" + - 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 @@ -14,18 +17,20 @@ # TODO verify the signature when downloaded -- file: state=directory name=/var/www/mediawiki{{ item }} +- set_fact: wiki_dir=/var/www/mediawiki/ + +- file: state=directory name={{ wiki_dir }}{{ item.path }} owner={{ item.owner }} with_items: - - / - - /cache + - { path: "/", owner: "root" } + - { path: "/cache", owner: "apache" } + - { path: "/images", owner: "apache" } -- command: creates=/var/www/mediawiki/mediawiki-{{ version }} tar -x --owner=root --group=root -f {{ cache_dir }}/mediawiki-{{ version }}.tar.gz -C /var/www/mediawiki/ +- set_fact: image_dir={{ wiki_dir }}/images +- set_fact: code_dir={{ wiki_dir }}/mediawiki-{{ version }} -# TODO selinux path ? -- file: path=/var/www/mediawiki/mediawiki-{{ version }}/cache owner=apache state=directory +- command: creates={{ code_dir }} tar -x --owner=root --group=root -f {{ cache_dir }}/mediawiki-{{ version }}.tar.gz -C {{ wiki_dir }} + +- template: src=LocalSettings.php dest={{ code_dir }}/LocalSettings.php - 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 -- cgit