Skip to content

Commit

Permalink
Set Dashy as default Ansible-NAS dashboard. Fix Dashy config persiste…
Browse files Browse the repository at this point in the history
…nce (fixes #540)
  • Loading branch information
davestephens committed Jan 2, 2024
1 parent df1d932 commit 09ddc6a
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 2 deletions.
2 changes: 1 addition & 1 deletion inventories/sample/group_vars/nas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ ansible_nas_hostname: ansible-nas
ansible_nas_timezone: Etc/UTC

## Enable some applications
heimdall_enabled: true
dashy_enabled: true
portainer_enabled: true
5 changes: 4 additions & 1 deletion roles/dashy/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
dashy_enabled: false
dashy_available_externally: false

# directories
dashy_data_directory: "{{ docker_home }}/dashy"

# network
dashy_port: "8082"
dashy_hostname: "dashy"

# specs
dashy_memory: 2g
dashy_memory: 1g

# docker
dashy_container_name: dashy
46 changes: 46 additions & 0 deletions roles/dashy/files/conf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
# Page meta info, like heading, footer text and nav links
pageInfo:
title: Dashy
description: Welcome to your new Ansible-NAS dashboard!
navLinks:
- title: Ansible-NAS
path: https://ansible-nas.io
- title: Documentation
path: https://dashy.to/docs

# Optional app settings and configuration
appConfig:
theme: colorful

# Main content - An array of sections, each containing an array of items
sections:
- name: Getting Started
icon: fas fa-rocket
items:
- title: Dashy Live
description: Development a project management links for Dashy
icon: https://i.ibb.co/qWWpD0v/astro-dab-128.png
url: https://live.dashy.to/
target: newtab
- title: GitHub
description: Source Code, Issues and Pull Requests
url: https://github.com/lissy93/dashy
icon: favicon
- title: Docs
description: Configuring & Usage Documentation
provider: Dashy.to
icon: far fa-book
url: https://dashy.to/docs
- title: Showcase
description: See how others are using Dashy
url: https://github.com/Lissy93/dashy/blob/master/docs/showcase.md
icon: far fa-grin-hearts
- title: Config Guide
description: See full list of configuration options
url: https://github.com/Lissy93/dashy/blob/master/docs/configuring.md
icon: fas fa-wrench
- title: Support
description: Get help with Dashy, raise a bug, or get in contact
url: https://github.com/Lissy93/dashy/blob/master/.github/SUPPORT.md
icon: far fa-hands-helping
14 changes: 14 additions & 0 deletions roles/dashy/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
---
- name: Start Dashy
block:
- name: Create Dashy Directory
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ dashy_data_directory }}"

- name: Copy base config
ansible.builtin.copy:
src: conf.yml
dest: "{{ dashy_data_directory }}/conf.yml"

- name: Dashy Docker Container
community.docker.docker_container:
name: "{{ dashy_container_name }}"
Expand All @@ -10,6 +22,8 @@
- "{{ dashy_port }}:80"
restart_policy: unless-stopped
memory: "{{ dashy_memory }}"
volumes:
- "{{ dashy_data_directory }}/conf.yml:/app/public/conf.yml:rw"
labels:
traefik.enable: "{{ dashy_available_externally | string }}"
traefik.http.routers.dashy.rule: "Host(`{{ dashy_hostname }}.{{ ansible_nas_domain }}`)"
Expand Down

0 comments on commit 09ddc6a

Please sign in to comment.