diff --git a/ansible/roles/setup_hosted_services/defaults/main.yml b/ansible/roles/setup_hosted_services/defaults/main.yml index 64855c3..c0d2b87 100644 --- a/ansible/roles/setup_hosted_services/defaults/main.yml +++ b/ansible/roles/setup_hosted_services/defaults/main.yml @@ -11,6 +11,8 @@ services: volumes: ["overseerr_config"] - name: nextcloud volumes: ["nextcloud_data"] + - name: dashboards + volumes: [] docker_networks: - nextcloud_net @@ -20,3 +22,7 @@ aws_s3: aws_access_key: "nyNMQ3fRMSV0bA1xw5uV" region: "us-east-1" bucket: "backups" + +dashy: + config_directory: /etc/config/dashy + config_file: dashy-config.yml \ No newline at end of file diff --git a/ansible/roles/setup_hosted_services/files/dashboards/dashy-config.yml b/ansible/roles/setup_hosted_services/files/dashboards/dashy-config.yml new file mode 100644 index 0000000..bfb50dc --- /dev/null +++ b/ansible/roles/setup_hosted_services/files/dashboards/dashy-config.yml @@ -0,0 +1,104 @@ +# https://github.com/Lissy93/dashy/blob/master/docs/showcase.md +# Details about config. +# https://github.com/Lissy93/dashy/blob/master/docs/configuring.md +# Widgets: https://github.com/Lissy93/dashy/blob/master/docs/widgets.md +--- +pageInfo: + title: Home Lab +sections: + - name: Dashboards + widgets: + - type: gl-disk-space + options: + hostname: http://qnap:8083 + - type: crypto-watch-list + options: + currency: GBP + sortBy: marketCap + assets: + - bitcoin + - ethereum + - monero + - cosmos + - polkadot + - dogecoin + items: + - title: Dash Dot + icon: hl-dashdot + url: "http://qnap:3010" + - title: Uptime Kuma + icon: hl-uptime-kuma + url: "http://qnap:3001" + - title: Tautulli + icon: hl-tautulli + url: "http://qnap:8182" + - title: Glances + icon: hl-glances + url: "http://qnap:8083" + - name: Media Stack + items: + - title: Plex + icon: hl-plex + url: "http://qnap:32400" + statusCheck: false + - title: Sonarr + icon: hl-sonarr + url: "http://qnap:8989" + - title: Radarr + icon: hl-radarr + url: "http://qnap:7878" + - title: Overseerr + icon: hl-overseerr + url: "http://qnap:5055" + - title: Jackett + icon: hl-jackett + url: "http://qnap:9117" + statusCheckUrl: "http://qnap:9117/health" + - title: Qbittorrent + icon: hl-qbittorrent + url: "http://qnap:15000" + - name: Tools + items: + - title: Photoprism + description: Manager photos + icon: hl-photoprism + url: "http://qnap:2342" + - title: Olivetin + description: Run pre-defined shell commands + icon: hl-olivetin + url: "http://qnap:1337" + - title: Linkding + description: Manager photos + icon: hl-linkding + url: "http://qnap:9090" + - title: Nextcloud + icon: hl-nextcloud + url: "http://qnap:8081" + - title: Mealie + icon: hl-mealie + url: "https://mealie.cianhatton.ie" + - title: Gitea + icon: hl-gitea + url: "https://git.cianhatton.ie" + - name: System Admin + items: + - title: Portainer + description: Manage docker apps using Portainer + icon: hl-portainer + url: "http://qnap:9000" + - title: Webmin + icon: hl-webmin + url: "http://qnap:10000" + - title: Adminer + description: Manage MariaDB + icon: hl-adminer + url: "http://qnap:3307" + - title: Nginx Proxy Manager + description: Manage reverse proxies + icon: hl-nginx + url: "http://qnap:8181" +appConfig: + statusCheck: true + showSplashScreen: false + theme: dracula + language: en diff --git a/ansible/roles/setup_hosted_services/files/dashboards/docker-compose.yml b/ansible/roles/setup_hosted_services/files/dashboards/docker-compose.yml new file mode 100644 index 0000000..1bce3ca --- /dev/null +++ b/ansible/roles/setup_hosted_services/files/dashboards/docker-compose.yml @@ -0,0 +1,55 @@ +version: '3.5' +services: + dash-dot: + labels: + ie.cianhatton.backup.enabled: "true" + container_name: dashdot + image: mauricenino/dashdot:latest + restart: unless-stopped + privileged: true + ports: + - '3010:3001' + volumes: + - /:/mnt/host:ro + + dashy: + labels: + ie.cianhatton.backup.enabled: "true" + + container_name: dashy + image: lissy93/dashy + volumes: + - /etc/config/dashy/dashy-config.yml:/app/public/conf.yml + + ports: + - 4000:80 + + environment: + - NODE_ENV=production + - UID=1000 + - GID=1000 + + # Specify restart policy + restart: unless-stopped + + # Configure healthchecks + healthcheck: + test: ['CMD', 'node', '/app/services/healthcheck'] + interval: 1m30s + timeout: 10s + retries: 3 + start_period: 40s + + extra_hosts: + - "qnap:192.168.178.42" + + glances: + image: nicolargo/glances:latest-alpine + restart: always + pid: host + ports: + - "8083:61208" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + environment: + - "GLANCES_OPT=-w" diff --git a/ansible/roles/setup_hosted_services/tasks/main.yml b/ansible/roles/setup_hosted_services/tasks/main.yml index 665be9a..0f29c4e 100644 --- a/ansible/roles/setup_hosted_services/tasks/main.yml +++ b/ansible/roles/setup_hosted_services/tasks/main.yml @@ -11,6 +11,17 @@ dest: "{{docker_compose_directory}}/{{item.name}}/docker-compose.yml" with_items: "{{services}}" +- name: Dashy | Create a directory if it does not exist + ansible.builtin.file: + path: "{{dashy.config_directory}}" + state: directory + mode: '0755' + +- name: Dashy | Copy config file + copy: + src: "dashboards/dashy-config.yml" + dest: "{{dashy.config_directory}}/{{dashy.config_file}}" + - name: Install python dependencies (requests) ansible.builtin.pip: name: requests diff --git a/ansible/roles/setup_portainer/tasks/main.yml b/ansible/roles/setup_portainer/tasks/main.yml index 89af82b..2cdf049 100644 --- a/ansible/roles/setup_portainer/tasks/main.yml +++ b/ansible/roles/setup_portainer/tasks/main.yml @@ -1,14 +1,14 @@ -- name: Create a directory if it does not exist +- name: Portainer | Create directory if it does not exist ansible.builtin.file: path: "{{docker_compose_directory}}" state: directory mode: '0755' -- name: Copy Portainer Docker Compose File +- name: Portainer | Copy docker compose file copy: src: docker-compose.yml dest: "{{docker_compose_directory}}/docker-compose.yml" -- name: Create and Portainer +- name: Portainer | Docker compose up community.docker.docker_compose: project_src: "{{docker_compose_directory}}"