ansible-nas/roles/dokuwiki/tasks/main.yml

42 lines
1.4 KiB
YAML
Raw Normal View History

2021-02-28 17:29:08 +00:00
---
2022-09-12 22:26:39 +00:00
- name: Start Dokuwiki
2022-09-07 21:37:47 +00:00
block:
- name: Create DokuWiki Directories
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ dokuwiki_data_directory }}/data"
2021-02-28 17:29:08 +00:00
2022-09-07 21:37:47 +00:00
- name: DokuWiki Docker Container
docker_container:
2022-09-12 22:26:39 +00:00
name: "{{ dokuwiki_container_name }}"
2022-09-07 21:37:47 +00:00
image: linuxserver/dokuwiki:latest
pull: true
volumes:
- "{{ dokuwiki_data_directory }}:/config/dokuwiki/data:rw"
ports:
- "{{ dokuwiki_port }}:80"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ dokuwiki_user_id }}"
PGID: "{{ dokuwiki_group_id }}"
restart_policy: unless-stopped
memory: "{{ dokuwiki_memory }}"
labels:
traefik.enable: "{{ dokuwiki_available_externally | string }}"
traefik.http.routers.dokuwiki.rule: "Host(`{{ dokuwiki_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.dokuwiki.tls.certresolver: "letsencrypt"
traefik.http.routers.dokuwiki.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.dokuwiki.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.dokuwiki.loadbalancer.server.port: "80"
2022-09-12 22:26:39 +00:00
when: dokuwiki_enabled is true
2022-09-07 21:37:47 +00:00
2022-09-12 22:26:39 +00:00
- name: Stop Dokuwiki
2022-09-07 21:37:47 +00:00
block:
2022-09-12 22:26:39 +00:00
- name: Stop Dokuwiki
2022-09-07 21:37:47 +00:00
docker_container:
2022-09-12 22:26:39 +00:00
name: "{{ dokuwiki_container_name }}"
2022-09-07 21:37:47 +00:00
state: absent
2022-09-12 22:26:39 +00:00
when: dokuwiki_enabled is false