rice/docker-host/setup/tasks/kanboard.yml

64 lines
1.5 KiB
YAML
Raw Normal View History

# Sets up an instance of Kanboard from top to bottom
---
- hosts: leftcoastlab
become: yes
vars:
PRE: kanboard
DATA_VOLUME: "{{PRE}}-data-volume"
PLUGINS_VOLUME: "{{PRE}}-plugins-volume"
SSL_VOLUME: "{{PRE}}-ssl-volume"
tasks:
- name: Include Vars
include_vars:
dir: ../vars
- name: Ensure Data volume exists
community.docker.docker_volume:
name: "{{DATA_VOLUME}}"
- name: Ensure Plugins Volume exists
community.docker.docker_volume:
name: "{{PLUGINS_VOLUME}}"
- name: Ensure SSL Volume exists
community.docker.docker_volume:
name: "{{SSL_VOLUME}}"
- name: Ensure Docker service is active
community.docker.docker_container:
name: kanboard
image: kanboard/kanboard:latest
pull: yes
restart_policy: always
recreate: yes
ports:
- "{{ KANBOARD_PORT }}:80"
- "{{ KANBOARD_PORT_SSL }}:443"
volumes:
- "{{DATA_VOLUME}}:/var/www/app/data"
- "{{PLUGINS_VOLUME}}:/var/www/app/plugins"
- "{{SSL_VOLUME}}:/etc/nginx/ssl"
- name: Create Nginx Config for service
template:
dest: /etc/nginx/sites-available/todo.lablad
src: ../templates/proxy.conf.j2
notify:
- restart-nginx
vars:
SERVER_NAME: todo.lablad
PORT: KANBOARD_PORT
- name: Restart Nginx
service:
name: nginx
state: restarted