Add dokuwiki role
For an Alpine Linux VM.
This commit is contained in:
parent
4420846817
commit
02f778604c
9 changed files with 246 additions and 1 deletions
69
roles/dokuwiki/tasks/main.yml
Normal file
69
roles/dokuwiki/tasks/main.yml
Normal file
|
@ -0,0 +1,69 @@
|
|||
- name: Set dokuwiki version
|
||||
set_fact:
|
||||
dokuwiki_version: 2023-04-04a
|
||||
|
||||
- name: Enable community package repo
|
||||
lineinfile:
|
||||
path: /etc/apk/repositories
|
||||
regexp: '^# *(http.*/v[^/]*/community)'
|
||||
line: '\1'
|
||||
backrefs: yes
|
||||
register: result
|
||||
|
||||
- name: Update package cache
|
||||
package:
|
||||
update_cache: true
|
||||
when: result.changed
|
||||
|
||||
- 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
|
Loading…
Add table
Add a link
Reference in a new issue