blob: 2a9f1da758f99d2a200157cf09ab5658d082f57e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
---
- yum: name={{ item }} state=installed
with_items:
- php-fpm
- php-mysql
- 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
- mediawiki-{{ version }}.tar.gz.sig
register: result
# TODO verify the signature when downloaded
- set_fact: wiki_dir=/var/www/mediawiki/
- file: state=directory name={{ wiki_dir }}{{ item.path }} owner={{ item.owner }}
with_items:
- { path: "/", owner: "root" }
- { path: "/cache", owner: "apache" }
- { path: "/images", owner: "apache" }
- set_fact: image_dir={{ wiki_dir }}/images
- set_fact: code_dir={{ wiki_dir }}/mediawiki-{{ version }}
- 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
|