diff options
author | Michael Scherer <misc@zarb.org> | 2015-03-23 18:32:29 +0100 |
---|---|---|
committer | Michael Scherer <misc@zarb.org> | 2015-03-23 18:32:29 +0100 |
commit | 5e82eb85edc36fb978588fceb8e622d76d727afa (patch) | |
tree | 03c5c0ec19e1696d0d34b1fd91913edde7714dee /roles/mediawiki/tasks | |
parent | 556ec4a888023cb771be892c67278170583da5f4 (diff) |
Add a bit more code for deploying mediawiki
Diffstat (limited to 'roles/mediawiki/tasks')
-rw-r--r-- | roles/mediawiki/tasks/main.yml | 23 |
1 files changed, 14 insertions, 9 deletions
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 |