servers/roles/dokuwiki/tasks/main.yml

50 lines
1.2 KiB
YAML

- name: Set up PHP
import_tasks: php.yml
- name: Install packages
package:
name: php-openssl,php-session,php-xml
- name: Check if dokuwiki should be upgraded
lineinfile:
path: /srv/http/dokuwiki/VERSION
search_string: '{{ dokuwiki_version }}'
state: absent
check_mode: true
changed_when: false
register: is_current
- name: Install or upgrade dokuwiki
when: 'is_current.found|default(0) == 0'
block:
- name: Download dokuwiki tarball
get_url:
url: 'https://download.dokuwiki.org/src/dokuwiki/dokuwiki-{{ dokuwiki_version }}.tgz'
dest: /var/tmp/
- name: Unpack tarball
command: 'tar xvf dokuwiki-{{ dokuwiki_version }}.tgz'
args:
chdir: /var/tmp
- name: Copy dokuwiki files
copy:
dest: /srv/http/dokuwiki/
src: '/var/tmp/dokuwiki-{{ dokuwiki_version }}/'
remote_src: true
owner: nginx
group: nginx
- name: Copy user style overrides
copy:
dest: /srv/http/doku.fri.uni-lj.si/conf/
src: userstyle.css
owner: nginx
group: nginx
- name: Create nginx site
template:
dest: /etc/nginx/http.d/dokuwiki.conf
src: dokuwiki.conf.j2
notify: reload nginx