mirror of
https://github.com/davestephens/ansible-nas
synced 2025-01-12 19:48:47 +00:00
More apps start/stop
This commit is contained in:
parent
8a44a389c2
commit
90a4eacad6
17 changed files with 356 additions and 254 deletions
7
nas.yml
7
nas.yml
|
@ -80,37 +80,30 @@
|
||||||
- role: dashy
|
- role: dashy
|
||||||
tags:
|
tags:
|
||||||
- dashy
|
- dashy
|
||||||
when: (dashy_enabled | default(False))
|
|
||||||
|
|
||||||
- role: deluge
|
- role: deluge
|
||||||
tags:
|
tags:
|
||||||
- deluge
|
- deluge
|
||||||
when: (deluge_enabled | default(False))
|
|
||||||
|
|
||||||
- role: dokuwiki
|
- role: dokuwiki
|
||||||
tags:
|
tags:
|
||||||
- dokuwiki
|
- dokuwiki
|
||||||
when: (dokuwiki_enabled | default(False))
|
|
||||||
|
|
||||||
- role: duplicacy
|
- role: duplicacy
|
||||||
tags:
|
tags:
|
||||||
- duplicacy
|
- duplicacy
|
||||||
when: (duplicacy_enabled | default(False))
|
|
||||||
|
|
||||||
- role: duplicati
|
- role: duplicati
|
||||||
tags:
|
tags:
|
||||||
- duplicati
|
- duplicati
|
||||||
when: (duplicati_enabled | default(False))
|
|
||||||
|
|
||||||
- role: emby
|
- role: emby
|
||||||
tags:
|
tags:
|
||||||
- emby
|
- emby
|
||||||
when: (emby_enabled | default(False))
|
|
||||||
|
|
||||||
- role: esphome
|
- role: esphome
|
||||||
tags:
|
tags:
|
||||||
- esphome
|
- esphome
|
||||||
when: (esphome_enabled | default(False))
|
|
||||||
|
|
||||||
- role: firefly
|
- role: firefly
|
||||||
tags:
|
tags:
|
||||||
|
|
|
@ -8,3 +8,6 @@ dashy_hostname: "dashy"
|
||||||
|
|
||||||
# specs
|
# specs
|
||||||
dashy_memory: 2g
|
dashy_memory: 2g
|
||||||
|
|
||||||
|
# docker
|
||||||
|
dashy_container_name: dashy
|
||||||
|
|
|
@ -1,17 +1,28 @@
|
||||||
---
|
---
|
||||||
- name: Dashy Docker Container
|
- name: Start Dashy
|
||||||
docker_container:
|
block:
|
||||||
name: dashy
|
- name: Dashy Docker Container
|
||||||
image: lissy93/dashy:latest
|
docker_container:
|
||||||
pull: true
|
name: "{{ dashy_container_name }}"
|
||||||
ports:
|
image: lissy93/dashy:latest
|
||||||
- "{{ dashy_port }}:80"
|
pull: true
|
||||||
restart_policy: unless-stopped
|
ports:
|
||||||
memory: "{{ dashy_memory }}"
|
- "{{ dashy_port }}:80"
|
||||||
labels:
|
restart_policy: unless-stopped
|
||||||
traefik.enable: "{{ dashy_available_externally | string }}"
|
memory: "{{ dashy_memory }}"
|
||||||
traefik.http.routers.dashy.rule: "Host(`{{ dashy_hostname }}.{{ ansible_nas_domain }}`)"
|
labels:
|
||||||
traefik.http.routers.dashy.tls.certresolver: "letsencrypt"
|
traefik.enable: "{{ dashy_available_externally | string }}"
|
||||||
traefik.http.routers.dashy.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
traefik.http.routers.dashy.rule: "Host(`{{ dashy_hostname }}.{{ ansible_nas_domain }}`)"
|
||||||
traefik.http.routers.dashy.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
traefik.http.routers.dashy.tls.certresolver: "letsencrypt"
|
||||||
traefik.http.services.dashy.loadbalancer.server.port: "80"
|
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
|
||||||
|
|
|
@ -22,3 +22,5 @@ deluge_timezone: "{{ ansible_nas_timezone }}"
|
||||||
|
|
||||||
# specs
|
# specs
|
||||||
deluge_memory: 1g
|
deluge_memory: 1g
|
||||||
|
|
||||||
|
deluge_container_name: deluge
|
||||||
|
|
|
@ -1,33 +1,43 @@
|
||||||
---
|
---
|
||||||
- name: Create Deluge Directories
|
- name: Start Deluge
|
||||||
file:
|
block:
|
||||||
path: "{{ item }}"
|
- name: Create Deluge Directories
|
||||||
state: directory
|
file:
|
||||||
# mode: 0755
|
path: "{{ item }}"
|
||||||
with_items:
|
state: directory
|
||||||
- "{{ deluge_config_directory }}"
|
with_items:
|
||||||
- "{{ deluge_download_directory }}"
|
- "{{ deluge_config_directory }}"
|
||||||
|
- "{{ deluge_download_directory }}"
|
||||||
|
|
||||||
- name: Deluge Docker Container
|
- name: Deluge Docker Container
|
||||||
docker_container:
|
docker_container:
|
||||||
name: deluge
|
name: deluge
|
||||||
image: linuxserver/deluge
|
image: linuxserver/deluge
|
||||||
pull: true
|
pull: true
|
||||||
volumes:
|
volumes:
|
||||||
- "{{ deluge_config_directory }}:/config:rw"
|
- "{{ deluge_config_directory }}:/config:rw"
|
||||||
- "{{ deluge_download_directory }}:/root/Downloads:rw"
|
- "{{ deluge_download_directory }}:/root/Downloads:rw"
|
||||||
ports:
|
ports:
|
||||||
- "{{ deluge_port }}:8112"
|
- "{{ deluge_port }}:8112"
|
||||||
env:
|
env:
|
||||||
TZ: "{{ deluge_timezone }}"
|
TZ: "{{ deluge_timezone }}"
|
||||||
PUID: "{{ deluge_user_id }}"
|
PUID: "{{ deluge_user_id }}"
|
||||||
PGID: "{{ deluge_group_id }}"
|
PGID: "{{ deluge_group_id }}"
|
||||||
restart_policy: unless-stopped
|
restart_policy: unless-stopped
|
||||||
memory: "{{ deluge_memory }}"
|
memory: "{{ deluge_memory }}"
|
||||||
labels:
|
labels:
|
||||||
traefik.enable: "{{ deluge_available_externally | string }}"
|
traefik.enable: "{{ deluge_available_externally | string }}"
|
||||||
traefik.http.routers.deluge.rule: "Host(`{{ deluge_hostname }}.{{ ansible_nas_domain }}`)"
|
traefik.http.routers.deluge.rule: "Host(`{{ deluge_hostname }}.{{ ansible_nas_domain }}`)"
|
||||||
traefik.http.routers.deluge.tls.certresolver: "letsencrypt"
|
traefik.http.routers.deluge.tls.certresolver: "letsencrypt"
|
||||||
traefik.http.routers.deluge.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
traefik.http.routers.deluge.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
||||||
traefik.http.routers.deluge.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
traefik.http.routers.deluge.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
||||||
traefik.http.services.deluge.loadbalancer.server.port: "8112"
|
traefik.http.services.deluge.loadbalancer.server.port: "8112"
|
||||||
|
when: when deluge_enabled is true
|
||||||
|
|
||||||
|
- name: Stop Deluge
|
||||||
|
block:
|
||||||
|
- name: Stop Deluge
|
||||||
|
docker_container:
|
||||||
|
name: "{{ deluge_container_name }}"
|
||||||
|
state: absent
|
||||||
|
when: deluge_enabled is false
|
||||||
|
|
|
@ -15,3 +15,6 @@ dokuwiki_port: "8085"
|
||||||
|
|
||||||
# specs
|
# specs
|
||||||
dokuwiki_memory: 1g
|
dokuwiki_memory: 1g
|
||||||
|
|
||||||
|
# docker
|
||||||
|
docuwiki_container_name: docuwiki
|
||||||
|
|
|
@ -1,30 +1,41 @@
|
||||||
---
|
---
|
||||||
- name: Create DokuWiki Directories
|
- name: Start Docuwiki
|
||||||
file:
|
block:
|
||||||
path: "{{ item }}"
|
- name: Create DokuWiki Directories
|
||||||
state: directory
|
file:
|
||||||
with_items:
|
path: "{{ item }}"
|
||||||
- "{{ dokuwiki_data_directory }}/data"
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- "{{ dokuwiki_data_directory }}/data"
|
||||||
|
|
||||||
- name: DokuWiki Docker Container
|
- name: DokuWiki Docker Container
|
||||||
docker_container:
|
docker_container:
|
||||||
name: dokuwiki
|
name: "{{ docuwiki_container_name }}"
|
||||||
image: linuxserver/dokuwiki:latest
|
image: linuxserver/dokuwiki:latest
|
||||||
pull: true
|
pull: true
|
||||||
volumes:
|
volumes:
|
||||||
- "{{ dokuwiki_data_directory }}:/config/dokuwiki/data:rw"
|
- "{{ dokuwiki_data_directory }}:/config/dokuwiki/data:rw"
|
||||||
ports:
|
ports:
|
||||||
- "{{ dokuwiki_port }}:80"
|
- "{{ dokuwiki_port }}:80"
|
||||||
env:
|
env:
|
||||||
TZ: "{{ ansible_nas_timezone }}"
|
TZ: "{{ ansible_nas_timezone }}"
|
||||||
PUID: "{{ dokuwiki_user_id }}"
|
PUID: "{{ dokuwiki_user_id }}"
|
||||||
PGID: "{{ dokuwiki_group_id }}"
|
PGID: "{{ dokuwiki_group_id }}"
|
||||||
restart_policy: unless-stopped
|
restart_policy: unless-stopped
|
||||||
memory: "{{ dokuwiki_memory }}"
|
memory: "{{ dokuwiki_memory }}"
|
||||||
labels:
|
labels:
|
||||||
traefik.enable: "{{ dokuwiki_available_externally | string }}"
|
traefik.enable: "{{ dokuwiki_available_externally | string }}"
|
||||||
traefik.http.routers.dokuwiki.rule: "Host(`{{ dokuwiki_hostname }}.{{ ansible_nas_domain }}`)"
|
traefik.http.routers.dokuwiki.rule: "Host(`{{ dokuwiki_hostname }}.{{ ansible_nas_domain }}`)"
|
||||||
traefik.http.routers.dokuwiki.tls.certresolver: "letsencrypt"
|
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].main: "{{ ansible_nas_domain }}"
|
||||||
traefik.http.routers.dokuwiki.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
traefik.http.routers.dokuwiki.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
||||||
traefik.http.services.dokuwiki.loadbalancer.server.port: "80"
|
traefik.http.services.dokuwiki.loadbalancer.server.port: "80"
|
||||||
|
when: docuwiki_enabled is true
|
||||||
|
|
||||||
|
- name: Stop Docuwiki
|
||||||
|
block:
|
||||||
|
- name: Stop Docuwiki
|
||||||
|
docker_container:
|
||||||
|
name: "{{ docuwiki_container_name }}"
|
||||||
|
state: absent
|
||||||
|
when: docuwiki_enabled is false
|
||||||
|
|
|
@ -22,3 +22,6 @@ duplicacy_port: "3875"
|
||||||
duplicacy_hostname: "duplicacy"
|
duplicacy_hostname: "duplicacy"
|
||||||
|
|
||||||
duplicacy_memory: 1g
|
duplicacy_memory: 1g
|
||||||
|
|
||||||
|
# docker
|
||||||
|
duplicacy_container_name: duplicacy
|
||||||
|
|
|
@ -1,37 +1,48 @@
|
||||||
---
|
---
|
||||||
- name: Create Duplicacy Directories
|
- name: Start Duplicacy
|
||||||
file:
|
block:
|
||||||
path: "{{ item }}"
|
- name: Create Duplicacy Directories
|
||||||
state: directory
|
file:
|
||||||
with_items:
|
path: "{{ item }}"
|
||||||
- "{{ duplicacy_config_directory }}"
|
state: directory
|
||||||
- "{{ duplicacy_logs_directory }}"
|
with_items:
|
||||||
- "{{ duplicacy_cache_directory }}"
|
- "{{ duplicacy_config_directory }}"
|
||||||
|
- "{{ duplicacy_logs_directory }}"
|
||||||
|
- "{{ duplicacy_cache_directory }}"
|
||||||
|
|
||||||
- name: Duplicacy Docker Container
|
- name: Duplicacy Docker Container
|
||||||
docker_container:
|
docker_container:
|
||||||
name: duplicacy
|
name: "{{ duplicacy_container_name }}"
|
||||||
image: saspus/duplicacy-web:mini
|
image: saspus/duplicacy-web:mini
|
||||||
hostname: "{{ duplicacy_hostname }}"
|
hostname: "{{ duplicacy_hostname }}"
|
||||||
pull: true
|
pull: true
|
||||||
ports:
|
ports:
|
||||||
- "{{ duplicacy_port }}:3875"
|
- "{{ duplicacy_port }}:3875"
|
||||||
volumes:
|
volumes:
|
||||||
- "{{ duplicacy_config_directory }}:/config:rw"
|
- "{{ duplicacy_config_directory }}:/config:rw"
|
||||||
- "{{ duplicacy_logs_directory }}:/logs:rw"
|
- "{{ duplicacy_logs_directory }}:/logs:rw"
|
||||||
- "{{ duplicacy_cache_directory }}:/cache:rw"
|
- "{{ duplicacy_cache_directory }}:/cache:rw"
|
||||||
- "{{ samba_shares_root }}:/backuproot:{{ duplicacy_data_permissions }}"
|
- "{{ samba_shares_root }}:/backuproot:{{ duplicacy_data_permissions }}"
|
||||||
env:
|
env:
|
||||||
DUPLICACY_WEB_VERSION: "{{ duplicacy_web_version }}"
|
DUPLICACY_WEB_VERSION: "{{ duplicacy_web_version }}"
|
||||||
TZ: "{{ ansible_nas_timezone }}"
|
TZ: "{{ ansible_nas_timezone }}"
|
||||||
USR_ID: "{{ duplicacy_user_id }}"
|
USR_ID: "{{ duplicacy_user_id }}"
|
||||||
GRP_ID: "{{ duplicacy_group_id }}"
|
GRP_ID: "{{ duplicacy_group_id }}"
|
||||||
restart_policy: unless-stopped
|
restart_policy: unless-stopped
|
||||||
memory: "{{ duplicacy_memory }}"
|
memory: "{{ duplicacy_memory }}"
|
||||||
labels:
|
labels:
|
||||||
traefik.enable: "{{ duplicacy_available_externally | string }}"
|
traefik.enable: "{{ duplicacy_available_externally | string }}"
|
||||||
traefik.http.routers.duplicacy.rule: "Host(`{{ duplicacy_hostname }}.{{ ansible_nas_domain }}`)"
|
traefik.http.routers.duplicacy.rule: "Host(`{{ duplicacy_hostname }}.{{ ansible_nas_domain }}`)"
|
||||||
traefik.http.routers.duplicacy.tls.certresolver: "letsencrypt"
|
traefik.http.routers.duplicacy.tls.certresolver: "letsencrypt"
|
||||||
traefik.http.routers.duplicacy.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
traefik.http.routers.duplicacy.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
||||||
traefik.http.routers.duplicacy.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
traefik.http.routers.duplicacy.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
||||||
traefik.http.services.duplicacy.loadbalancer.server.port: "3875"
|
traefik.http.services.duplicacy.loadbalancer.server.port: "3875"
|
||||||
|
when: duplicacy_enabled is true
|
||||||
|
|
||||||
|
- name: Stop Duplicacy
|
||||||
|
block:
|
||||||
|
- name: Stop Duplicacy
|
||||||
|
docker_container:
|
||||||
|
name: "{{ duplicacy_container_name }}"
|
||||||
|
state: absent
|
||||||
|
when: duplicacy_enabled is false
|
||||||
|
|
|
@ -17,3 +17,6 @@ duplicati_port: "8200"
|
||||||
duplicati_hostname: "duplicati"
|
duplicati_hostname: "duplicati"
|
||||||
|
|
||||||
duplicati_memory: 1g
|
duplicati_memory: 1g
|
||||||
|
|
||||||
|
# docker
|
||||||
|
duplicati_container_name: duplicati
|
||||||
|
|
|
@ -1,33 +1,44 @@
|
||||||
---
|
---
|
||||||
- name: Create Duplicati Directory
|
- name: Start Duplicati
|
||||||
file:
|
block:
|
||||||
path: "{{ item }}"
|
- name: Create Duplicati Directory
|
||||||
state: directory
|
file:
|
||||||
with_items:
|
path: "{{ item }}"
|
||||||
- "{{ duplicati_data_directory }}"
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- "{{ duplicati_data_directory }}"
|
||||||
|
|
||||||
- name: Dupicati Docker Container
|
- name: Dupicati Docker Container
|
||||||
docker_container:
|
docker_container:
|
||||||
name: duplicati
|
name: "{{ duplicati_container_name }}"
|
||||||
image: linuxserver/duplicati
|
image: linuxserver/duplicati
|
||||||
pull: true
|
pull: true
|
||||||
ports:
|
ports:
|
||||||
- "{{ duplicati_port }}:8200"
|
- "{{ duplicati_port }}:8200"
|
||||||
volumes:
|
volumes:
|
||||||
- "{{ duplicati_data_directory }}:/config:rw"
|
- "{{ duplicati_data_directory }}:/config:rw"
|
||||||
- "{{ samba_shares_root }}:/source/shares:{{ duplicati_data_permissions }}"
|
- "{{ samba_shares_root }}:/source/shares:{{ duplicati_data_permissions }}"
|
||||||
- "{{ docker_home }}:/source/docker:{{ duplicati_data_permissions }}"
|
- "{{ docker_home }}:/source/docker:{{ duplicati_data_permissions }}"
|
||||||
- "/etc/timezone:/etc/timezone:ro"
|
- "/etc/timezone:/etc/timezone:ro"
|
||||||
env:
|
env:
|
||||||
TZ: "{{ ansible_nas_timezone }}"
|
TZ: "{{ ansible_nas_timezone }}"
|
||||||
PUID: "{{ duplicati_user_id }}"
|
PUID: "{{ duplicati_user_id }}"
|
||||||
PGID: "{{ duplicati_group_id }}"
|
PGID: "{{ duplicati_group_id }}"
|
||||||
restart_policy: unless-stopped
|
restart_policy: unless-stopped
|
||||||
memory: "{{ duplicati_memory }}"
|
memory: "{{ duplicati_memory }}"
|
||||||
labels:
|
labels:
|
||||||
traefik.enable: "{{ duplicati_available_externally | string }}"
|
traefik.enable: "{{ duplicati_available_externally | string }}"
|
||||||
traefik.http.routers.duplicati.rule: "Host(`{{ duplicati_hostname }}.{{ ansible_nas_domain }}`)"
|
traefik.http.routers.duplicati.rule: "Host(`{{ duplicati_hostname }}.{{ ansible_nas_domain }}`)"
|
||||||
traefik.http.routers.duplicati.tls.certresolver: "letsencrypt"
|
traefik.http.routers.duplicati.tls.certresolver: "letsencrypt"
|
||||||
traefik.http.routers.duplicati.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
traefik.http.routers.duplicati.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
||||||
traefik.http.routers.duplicati.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
traefik.http.routers.duplicati.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
||||||
traefik.http.services.duplicati.loadbalancer.server.port: "8200"
|
traefik.http.services.duplicati.loadbalancer.server.port: "8200"
|
||||||
|
when: duplicati_enabled is true
|
||||||
|
|
||||||
|
- name: Stop Duplicati
|
||||||
|
block:
|
||||||
|
- name: Stop Duplicati
|
||||||
|
docker_container:
|
||||||
|
name: "{{ duplicati_container_name }}"
|
||||||
|
state: absent
|
||||||
|
when: duplicati_enabled is false
|
||||||
|
|
|
@ -23,3 +23,6 @@ emby_hostname: "emby"
|
||||||
|
|
||||||
# specs
|
# specs
|
||||||
emby_memory: 1g
|
emby_memory: 1g
|
||||||
|
|
||||||
|
# docker
|
||||||
|
emby_container_name: emby
|
||||||
|
|
|
@ -1,33 +1,44 @@
|
||||||
---
|
---
|
||||||
- name: Create Emby Directories
|
- name: Start Emby
|
||||||
file:
|
block:
|
||||||
path: "{{ item }}"
|
- name: Create Emby Directories
|
||||||
state: directory
|
file:
|
||||||
with_items:
|
path: "{{ item }}"
|
||||||
- "{{ emby_config_directory }}"
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- "{{ emby_config_directory }}"
|
||||||
|
|
||||||
- name: Emby Docker Container
|
- name: Emby Docker Container
|
||||||
docker_container:
|
docker_container:
|
||||||
name: emby
|
name: "{{ emby_container_name }}"
|
||||||
image: emby/embyserver
|
image: emby/embyserver
|
||||||
pull: true
|
pull: true
|
||||||
volumes:
|
volumes:
|
||||||
- "{{ emby_config_directory }}:/config:rw"
|
- "{{ emby_config_directory }}:/config:rw"
|
||||||
- "{{ emby_movies_directory }}:/movies:{{ emby_movies_permissions }}"
|
- "{{ emby_movies_directory }}:/movies:{{ emby_movies_permissions }}"
|
||||||
- "{{ emby_tv_directory }}:/tv:{{ emby_tv_permissions }}"
|
- "{{ emby_tv_directory }}:/tv:{{ emby_tv_permissions }}"
|
||||||
ports:
|
ports:
|
||||||
- "{{ emby_port_http }}:8096"
|
- "{{ emby_port_http }}:8096"
|
||||||
- "{{ emby_port_https }}:8920"
|
- "{{ emby_port_https }}:8920"
|
||||||
env:
|
env:
|
||||||
TZ: "{{ ansible_nas_timezone }}"
|
TZ: "{{ ansible_nas_timezone }}"
|
||||||
PUID: "{{ emby_user_id }}"
|
PUID: "{{ emby_user_id }}"
|
||||||
PGID: "{{ emby_group_id }}"
|
PGID: "{{ emby_group_id }}"
|
||||||
restart_policy: unless-stopped
|
restart_policy: unless-stopped
|
||||||
memory: "{{ emby_memory }}"
|
memory: "{{ emby_memory }}"
|
||||||
labels:
|
labels:
|
||||||
traefik.enable: "{{ emby_available_externally | string }}"
|
traefik.enable: "{{ emby_available_externally | string }}"
|
||||||
traefik.http.routers.emby.rule: "Host(`{{ emby_hostname }}.{{ ansible_nas_domain }}`)"
|
traefik.http.routers.emby.rule: "Host(`{{ emby_hostname }}.{{ ansible_nas_domain }}`)"
|
||||||
traefik.http.routers.emby.tls.certresolver: "letsencrypt"
|
traefik.http.routers.emby.tls.certresolver: "letsencrypt"
|
||||||
traefik.http.routers.emby.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
traefik.http.routers.emby.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
||||||
traefik.http.routers.emby.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
traefik.http.routers.emby.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
||||||
traefik.http.services.emby.loadbalancer.server.port: "8096"
|
traefik.http.services.emby.loadbalancer.server.port: "8096"
|
||||||
|
when: emby_enabled is true
|
||||||
|
|
||||||
|
- name: Stop Emby
|
||||||
|
block:
|
||||||
|
- name: Stop Emby
|
||||||
|
docker_container:
|
||||||
|
name: "{{ emby_container_name }}"
|
||||||
|
state: absent
|
||||||
|
when: emby_enabled is false
|
||||||
|
|
|
@ -15,3 +15,6 @@ esphome_port: "6052"
|
||||||
|
|
||||||
# specs
|
# specs
|
||||||
esphome_memory: 1g
|
esphome_memory: 1g
|
||||||
|
|
||||||
|
# docker
|
||||||
|
esphome_container_name: esphome
|
||||||
|
|
|
@ -1,31 +1,42 @@
|
||||||
---
|
---
|
||||||
- name: Create EspHome Directories
|
- name: Start EspHome
|
||||||
file:
|
block:
|
||||||
path: "{{ item }}"
|
- name: Create EspHome Directories
|
||||||
state: directory
|
file:
|
||||||
with_items:
|
path: "{{ item }}"
|
||||||
- "{{ esphome_data_directory }}/data"
|
state: directory
|
||||||
|
with_items:
|
||||||
|
- "{{ esphome_data_directory }}/data"
|
||||||
|
|
||||||
- name: EspHome Docker Container
|
- name: EspHome Docker Container
|
||||||
docker_container:
|
docker_container:
|
||||||
name: esphome
|
name: "{{ esphome_container_name }}"
|
||||||
image: esphome/esphome:latest
|
image: esphome/esphome:latest
|
||||||
pull: true
|
pull: true
|
||||||
volumes:
|
volumes:
|
||||||
- "{{ esphome_data_directory }}:/config:rw"
|
- "{{ esphome_data_directory }}:/config:rw"
|
||||||
- "/etc/localtime:/etc/localtime:ro"
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
ports:
|
ports:
|
||||||
- "{{ esphome_port }}:6052"
|
- "{{ esphome_port }}:6052"
|
||||||
env:
|
env:
|
||||||
TZ: "{{ ansible_nas_timezone }}"
|
TZ: "{{ ansible_nas_timezone }}"
|
||||||
PUID: "{{ esphome_user_id }}"
|
PUID: "{{ esphome_user_id }}"
|
||||||
PGID: "{{ esphome_group_id }}"
|
PGID: "{{ esphome_group_id }}"
|
||||||
restart_policy: unless-stopped
|
restart_policy: unless-stopped
|
||||||
memory: "{{ esphome_memory }}"
|
memory: "{{ esphome_memory }}"
|
||||||
labels:
|
labels:
|
||||||
traefik.enable: "{{ esphome_available_externally | string }}"
|
traefik.enable: "{{ esphome_available_externally | string }}"
|
||||||
traefik.http.routers.esphome.rule: "Host(`{{ esphome_hostname }}.{{ ansible_nas_domain }}`)"
|
traefik.http.routers.esphome.rule: "Host(`{{ esphome_hostname }}.{{ ansible_nas_domain }}`)"
|
||||||
traefik.http.routers.esphome.tls.certresolver: "letsencrypt"
|
traefik.http.routers.esphome.tls.certresolver: "letsencrypt"
|
||||||
traefik.http.routers.esphome.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
traefik.http.routers.esphome.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
||||||
traefik.http.routers.esphome.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
traefik.http.routers.esphome.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
||||||
traefik.http.services.esphome.loadbalancer.server.port: "80"
|
traefik.http.services.esphome.loadbalancer.server.port: "80"
|
||||||
|
when: esphome_enabled is true
|
||||||
|
|
||||||
|
- name: Stop EspHome
|
||||||
|
block:
|
||||||
|
- name: Stop EspHome
|
||||||
|
docker_container:
|
||||||
|
name: "{{ esphome_container_name }}"
|
||||||
|
state: absent
|
||||||
|
when: esphome_enabled is false
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
heimdall_enabled: true
|
heimdall_enabled: false
|
||||||
heimdall_available_externally: false
|
heimdall_available_externally: false
|
||||||
|
|
||||||
# directories
|
# directories
|
||||||
|
@ -17,3 +17,5 @@ heimdall_group_id: "1310"
|
||||||
|
|
||||||
# specs
|
# specs
|
||||||
heimdall_memory: 1g
|
heimdall_memory: 1g
|
||||||
|
|
||||||
|
heimdall_container_name: heimdall
|
||||||
|
|
|
@ -1,49 +1,60 @@
|
||||||
---
|
---
|
||||||
- name: Create Heimdall group
|
- name: Start Heimdall
|
||||||
group:
|
block:
|
||||||
name: heimdall
|
- name: Create Heimdall group
|
||||||
gid: "{{ heimdall_group_id }}"
|
group:
|
||||||
state: present
|
name: heimdall
|
||||||
|
gid: "{{ heimdall_group_id }}"
|
||||||
|
state: present
|
||||||
|
|
||||||
- name: Create Heimdall user
|
- name: Create Heimdall user
|
||||||
user:
|
user:
|
||||||
name: heimdall
|
name: heimdall
|
||||||
uid: "{{ heimdall_user_id }}"
|
uid: "{{ heimdall_user_id }}"
|
||||||
state: present
|
state: present
|
||||||
system: yes
|
system: yes
|
||||||
update_password: on_create
|
update_password: on_create
|
||||||
create_home: no
|
create_home: no
|
||||||
group: heimdall
|
group: heimdall
|
||||||
|
|
||||||
- name: Create Heimdall Directories
|
- name: Create Heimdall Directories
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: heimdall
|
owner: heimdall
|
||||||
group: heimdall
|
group: heimdall
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ heimdall_data_directory }}"
|
- "{{ heimdall_data_directory }}"
|
||||||
|
|
||||||
- name: Create Heimdall container
|
- name: Create Heimdall container
|
||||||
docker_container:
|
docker_container:
|
||||||
name: heimdall
|
name: "{{ heimdall_container_name }}"
|
||||||
image: "{{ heimdall_docker_image }}"
|
image: "{{ heimdall_docker_image }}"
|
||||||
pull: true
|
pull: true
|
||||||
volumes:
|
volumes:
|
||||||
- "{{ heimdall_data_directory }}:/config:rw"
|
- "{{ heimdall_data_directory }}:/config:rw"
|
||||||
env:
|
env:
|
||||||
PUID: "{{ heimdall_user_id }}"
|
PUID: "{{ heimdall_user_id }}"
|
||||||
PGID: "{{ heimdall_group_id }}"
|
PGID: "{{ heimdall_group_id }}"
|
||||||
TZ: "{{ ansible_nas_timezone }}"
|
TZ: "{{ ansible_nas_timezone }}"
|
||||||
ports:
|
ports:
|
||||||
- "{{ heimdall_port_http }}:80"
|
- "{{ heimdall_port_http }}:80"
|
||||||
- "{{ heimdall_port_https }}:443"
|
- "{{ heimdall_port_https }}:443"
|
||||||
restart_policy: unless-stopped
|
restart_policy: unless-stopped
|
||||||
memory: "{{ heimdall_memory }}"
|
memory: "{{ heimdall_memory }}"
|
||||||
labels:
|
labels:
|
||||||
traefik.enable: "{{ heimdall_available_externally | string }}"
|
traefik.enable: "{{ heimdall_available_externally | string }}"
|
||||||
traefik.http.routers.heimdall.rule: "Host(`{{ heimdall_hostname }}.{{ ansible_nas_domain }}`)"
|
traefik.http.routers.heimdall.rule: "Host(`{{ heimdall_hostname }}.{{ ansible_nas_domain }}`)"
|
||||||
traefik.http.routers.heimdall.tls.certresolver: "letsencrypt"
|
traefik.http.routers.heimdall.tls.certresolver: "letsencrypt"
|
||||||
traefik.http.routers.heimdall.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
traefik.http.routers.heimdall.tls.domains[0].main: "{{ ansible_nas_domain }}"
|
||||||
traefik.http.routers.heimdall.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
traefik.http.routers.heimdall.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
|
||||||
traefik.http.services.heimdall.loadbalancer.server.port: "80"
|
traefik.http.services.heimdall.loadbalancer.server.port: "80"
|
||||||
|
when: heimdall_enabled is true
|
||||||
|
|
||||||
|
- name: Stop Heimdall
|
||||||
|
block:
|
||||||
|
- name: Stop Heimdall
|
||||||
|
docker_container:
|
||||||
|
name: "{{ heimdall_container_name }}"
|
||||||
|
state: absent
|
||||||
|
when: heimdall_enabled is false
|
||||||
|
|
Loading…
Reference in a new issue