Add dokuwiki setup

This commit is contained in:
Stefan Haun 2022-06-25 20:31:20 +02:00
parent 4d69229f90
commit 71968b7c14

44
tau.yml
View file

@ -8,6 +8,10 @@
docker_registry_port: 5000 # this is the reg standard port
docker_registry_domain: "docker.n39.eu"
dokuwiki_domain: "wiki.netz39.de"
dokuwiki_port: 9005
dokuwiki_image: "docker.io/bitnami/dokuwiki:20200729"
roles:
- role: docker_setup
- role: apache
@ -35,6 +39,8 @@
deploy_challenge_hook: "/bin/systemctl restart apache2"
- name: "{{ docker_registry_domain }}"
deploy_challenge_hook: "/bin/systemctl restart apache2"
- name: "{{ dokuwiki_domain }}"
deploy_challenge_hook: "/bin/systemctl restart apache2"
- name: Setup proxy site testredmine.netz39.de
include_role:
@ -105,3 +111,41 @@
vars:
site_name: "{{ docker_registry_domain }}"
proxy_port: "{{ docker_registry_port }}"
- name: Check if Dokuwiki data dir exists
ansible.builtin.stat:
path: "/srv/docker/dokuwiki"
register: dokuwiki_dir
- name: Fail if Dokuwiki data dir does not exist
ansible.builtin.fail:
msg: "Dokuwiki data dir is missing, please restore from the backup!"
when: not dokuwiki_dir.stat.exists
- name: Set correct user for Dokuwiki data
ansible.builtin.file:
path: "/srv/docker/dokuwiki"
owner: "1001" # According to container config
recurse: yes
- name: Setup Dokuwiki Container
docker_container:
name: dokuwiki
image: "{{ dokuwiki_image }}"
pull: true
state: started
restart_policy: unless-stopped
detach: yes
ports:
- 127.0.0.1:{{ dokuwiki_port }}:{{ 8080 }}
# env: No env here, because we copy the data
# and the container will never be created from scratch.
volumes:
- "/srv/docker/dokuwiki:/bitnami/dokuwiki:rw"
- name: Setup proxy site for Dokuwiki
include_role:
name: setup-http-site-proxy
vars:
site_name: "{{ dokuwiki_domain }}"
proxy_port: "{{ dokuwiki_port }}"