servers/roles/dokuwiki/tasks/main.yml
Timotej Lazar c2c1fdbe40 Add alpine role
Base packages and SSH config, and QEMU guest agent for VMs.
2024-05-19 14:21:22 +02:00

57 lines
1.3 KiB
YAML

- name: Set dokuwiki version
set_fact:
dokuwiki_version: 2024-02-06a
- name: Set up nginx
import_tasks: nginx.yml
- name: Set up PHP
import_tasks: php.yml
- name: Install packages
package:
name: php-openssl,php-session,php-xml
- name: Get current dokuwiki version if any
lineinfile:
path: /srv/http/doku.fri.uni-lj.si/VERSION
search_string: '{{ dokuwiki_version }}'
state: absent
check_mode: true
changed_when: false
register: current_version
- name: Install or upgrade dokuwiki
when: 'current_version.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/doku.fri.uni-lj.si/
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/doku.fri.uni-lj.si.conf
src: doku.fri.uni-lj.si.conf.j2
notify: reload nginx