ansible-nas/roles/dashy/tasks/main.yml
2022-09-07 23:06:52 +01:00

28 lines
1,012 B
YAML

---
- name: Start Dashy
block:
- name: Dashy Docker Container
docker_container:
name: "{{ dashy_container_name }}"
image: lissy93/dashy:latest
pull: true
ports:
- "{{ dashy_port }}:80"
restart_policy: unless-stopped
memory: "{{ dashy_memory }}"
labels:
traefik.enable: "{{ dashy_available_externally | string }}"
traefik.http.routers.dashy.rule: "Host(`{{ dashy_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.dashy.tls.certresolver: "letsencrypt"
traefik.http.routers.dashy.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.dashy.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.dashy.loadbalancer.server.port: "80"
when: dashy_enabled is true
- name: Stop Dashy
block:
- name: Stop Dashy
docker_container:
name: "{{ dashy_container_name }}"
state: absent
when: dashy_enabled is false