Another set: heimdall to overseer

This commit is contained in:
Anarion 2023-03-09 21:47:42 +01:00
parent 463ea6f5cf
commit e253f0a5d0
No known key found for this signature in database
GPG key ID: 6C9E149718A7D4EB
210 changed files with 3504 additions and 838 deletions

17
nas.yml
View file

@ -148,7 +148,6 @@
- role: heimdall
tags:
- heimdall
when: (heimdall_enabled | default(False))
- role: hello_world
tags:
@ -157,82 +156,66 @@
- role: homeassistant
tags:
- homeassistant
when: (homeassistant_enabled | default(False))
- role: homebridge
tags:
- homebridge
when: (homebridge_enabled | default(False))
- role: jackett
tags:
- jackett
when: (jackett_enabled | default(False))
- role: jellyfin
tags:
- jellyfin
when: (jellyfin_enabled | default(False))
- role: joomla
tags:
- joomla
when: (joomla_enabled | default(False))
- role: komga
tags:
- komga
when: (komga_enabled | default(False))
- role: krusader
tags:
- krusader
when: (krusader_enabled | default(False))
- role: lidarr
tags:
- lidarr
when: (lidarr_enabled | default(False))
- role: mealie
tags:
- mealie
when: (mealie_enabled | default(False))
- role: minecraft-server
tags:
- minecraft-server
when: (minecraft_server_enabled | default(False))
- role: minidlna
tags:
- minidlna
when: (minidlna_enabled | default(False))
- role: miniflux
tags:
- miniflux
when: (miniflux_enabled | default(False))
- role: mosquitto
tags:
- mosquitto
when: (mosquitto_enabled | default(False))
- role: mylar
tags:
- mylar
when: (mylar_enabled | default(False))
- role: mymediaforalexa
tags:
- mymediaforalexa
when: (mymediaforalexa_enabled | default(False))
- role: n8n
tags:
- n8n
when: (n8n_enabled | default(False))
- role: navidrome
tags:

View file

@ -0,0 +1,15 @@
# Heimdall
Homepage: <https://heimdall.site/>
Heimdall Application Dashboard is a dashboard for all your web applications. It doesn't need to be limited to applications though, you can add links to anything you like
## Usage
Set `heimdall_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
The Heimdall web interface can be found at <http://ansible_nas_host_or_ip:10080>.
## Specific Configuration
Heimdall defaults to port 10080 - some browsers block this port. Override `heimdall_port_http` to move it somewhere else.

View file

@ -9,5 +9,10 @@ homeassistant_data_directory: "{{ docker_home }}/homeassistant"
homeassistant_port: "8123"
homeassistant_hostname: "homeassistant"
# docker
homeassistant_container_name: "homeassistant"
homeassistant_image_name: "homeassistant/home-assistant"
homeassistant_image_version: latest
# specs
homeassistant_memory: 1g

View file

@ -0,0 +1,13 @@
# Home Assistant
Homepage: <https://www.home-assistant.io/>
Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts.
## Usage
Set `homeassistant_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
If you want to access Home Assistant externally, don't forget to set `homeassistant_available_externally: true` in your `inventories/<your_inventory>/nas.yml` file.
The Home Assistant web interface can be found at <http://ansible_nas_host_or_ip:8123>.

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
homeassistant_enabled: true

View file

@ -0,0 +1,10 @@
---
- name: Stop
hosts: all
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
homeassistant_enabled: false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get homeassistant container state
community.docker.docker_container:
name: "{{ homeassistant_container_name }}"
register: result
- name: Check if homeassistant containers are running
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove homeassistant
community.docker.docker_container:
name: "{{ homeassistant_container_name }}"
state: absent
register: result
- name: Check if homeassistant is stopped
ansible.builtin.assert:
that:
- not result.changed

View file

@ -1,27 +1,39 @@
---
- name: Create Home Assistant Directories
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ homeassistant_data_directory }}/config"
- name: Start Homeassistant
block:
- name: Create Home Assistant Directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ homeassistant_data_directory }}/config"
- name: Home Assistant Docker Container
docker_container:
name: homeassistant
image: homeassistant/home-assistant
pull: true
volumes:
- "{{ homeassistant_data_directory }}/config:/config:rw"
network_mode: host
restart_policy: unless-stopped
env:
TZ: "{{ ansible_nas_timezone }}"
labels:
traefik.enable: "{{ homeassistant_available_externally | string }}"
traefik.http.routers.homeassistant.rule: "Host(`{{ homeassistant_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.homeassistant.tls.certresolver: "letsencrypt"
traefik.http.routers.homeassistant.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.homeassistant.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.homeassistant.loadbalancer.server.port: "8123"
memory: "{{ homeassistant_memory }}"
- name: Home Assistant Docker Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ homeassistant_container_name }}"
image: "{{ homeassistant_image_name }}:{{ homeassistant_image_version }}"
pull: true
volumes:
- "{{ homeassistant_data_directory }}/config:/config:rw"
network_mode: host
restart_policy: unless-stopped
env:
TZ: "{{ ansible_nas_timezone }}"
labels:
traefik.enable: "{{ homeassistant_available_externally | string }}"
traefik.http.routers.homeassistant.rule: "Host(`{{ homeassistant_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.homeassistant.tls.certresolver: "letsencrypt"
traefik.http.routers.homeassistant.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.homeassistant.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.homeassistant.loadbalancer.server.port: "8123"
memory: "{{ homeassistant_memory }}"
when: homeassistant_enabled is true
- name: Stop homeassistant
block:
- name: Stop homeassistant
community.docker.docker_container:
name: "{{ homeassistant_container_name }}"
state: absent
when: homeassistant_enabled is false

View file

@ -14,5 +14,10 @@ homebridge_group_id: "0"
homebridge_hostname: "homebridge"
homebridge_port: "8087"
# docker
homebridge_container_name: "homebridge"
homebridge_image_name: "oznu/homebridge"
homebridge_image_version: "latest"
# specs
homebridge_memory: "1g"

View file

@ -0,0 +1,11 @@
# Homebridge
Homepage: <https://github.com/nfarina/homebridge>
Homebridge is a lightweight NodeJS server you can run on your home network that emulates the iOS HomeKit API. It supports Plugins, which are community-contributed modules that provide a basic bridge from HomeKit to various 3rd-party APIs provided by manufacturers of "smart home" devices.
## Usage
Set `homebridge_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
The Homebridge web interface can be found at <http://ansible_nas_host_or_ip:8087>. The default username and password is 'admin' - change this after your first login!

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
homebridge_enabled: true

View file

@ -0,0 +1,10 @@
---
- name: Stop
hosts: all
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
homebridge_enabled: false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get homebridge container state
community.docker.docker_container:
name: "{{ homebridge_container_name }}"
register: result
- name: Check if homebridge containers are running
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove homebridge
community.docker.docker_container:
name: "{{ homebridge_container_name }}"
state: absent
register: result
- name: Check if homebridge is stopped
ansible.builtin.assert:
that:
- not result.changed

View file

@ -1,32 +1,44 @@
---
- name: Create Homebridge Directories
file:
path: "{{ item }}"
state: directory
# mode: 0755
with_items:
- "{{ homebridge_config_directory }}"
- name: Start Homebridge
block:
- name: Create Homebridge Directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
# mode: 0755
with_items:
- "{{ homebridge_config_directory }}"
- name: Create Homebridge Docker Container
docker_container:
name: homebridge
image: oznu/homebridge
pull: true
volumes:
- "{{ homebridge_config_directory }}:/homebridge"
network_mode: "host"
env:
TZ: "{{ ansible_nas_timezone }}"
PGID: "{{ homebridge_group_id }}"
PUID: "{{ homebridge_user_id }}"
HOMEBRIDGE_CONFIG_UI: "1"
HOMEBRIDGE_CONFIG_UI_PORT: "{{ homebridge_port }}"
restart_policy: unless-stopped
memory: "{{ homebridge_memory }}"
labels:
traefik.enable: "{{ homebridge_available_externally | string }}"
traefik.http.routers.homebridge.rule: "Host(`{{ homebridge_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.homebridge.tls.certresolver: "letsencrypt"
traefik.http.routers.homebridge.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.homebridge.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.homebridge.loadbalancer.server.port: "8087"
- name: Create Homebridge Docker Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ homebridge_container_name }}"
image: "{{ homebridge_image_name }}:{{ homebridge_image_version }}"
pull: true
volumes:
- "{{ homebridge_config_directory }}:/homebridge"
network_mode: "host"
env:
TZ: "{{ ansible_nas_timezone }}"
PGID: "{{ homebridge_group_id }}"
PUID: "{{ homebridge_user_id }}"
HOMEBRIDGE_CONFIG_UI: "1"
HOMEBRIDGE_CONFIG_UI_PORT: "{{ homebridge_port }}"
restart_policy: unless-stopped
memory: "{{ homebridge_memory }}"
labels:
traefik.enable: "{{ homebridge_available_externally | string }}"
traefik.http.routers.homebridge.rule: "Host(`{{ homebridge_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.homebridge.tls.certresolver: "letsencrypt"
traefik.http.routers.homebridge.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.homebridge.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.homebridge.loadbalancer.server.port: "8087"
when: homebridge_enabled is true
- name: Stop Homebridge
block:
- name: Stop Homebridge
community.docker.docker_container:
name: "{{ homebridge_container_name }}"
state: absent
when: homebridge_enabled is false

View file

@ -11,5 +11,10 @@ jackett_torrents_root: "{{ torrents_root }}"
jackett_hostname: "jackett"
jackett_port: "9117"
# docker
jackett_container_name: "jackett"
jackett_image_name: "linuxserver/jackett"
jackett_image_version: "latest"
# specs
jackett_memory: "1g"

View file

@ -0,0 +1,11 @@
# Jackett
Homepage: <https://github.com/Jackett/Jackett>
Jackett works as a proxy server: it translates queries from apps (Sonarr, Radarr, SickRage, CouchPotato, Mylar, DuckieTV, qBittorrent, Nefarious etc) into tracker-site-specific http queries, parses the html response, then sends results back to the requesting software. This allows for getting recent uploads (like RSS) and performing searches. Jackett is a single repository of maintained indexer scraping & translation logic - removing the burden from other apps.
## Usage
Set `jackett_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
The Jackett web interface can be found at <http://ansible_nas_host_or_ip:9117>.

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
jackett_enabled: true

View file

@ -0,0 +1,10 @@
---
- name: Stop
hosts: all
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
jackett_enabled: false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get jackett container state
community.docker.docker_container:
name: "{{ jackett_container_name }}"
register: result
- name: Check if jackett containers are running
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove jackett
community.docker.docker_container:
name: "{{ jackett_container_name }}"
state: absent
register: result
- name: Check if jackett is stopped
ansible.builtin.assert:
that:
- not result.changed

View file

@ -1,29 +1,41 @@
---
- name: Create jackett Directories
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ jackett_data_directory }}"
- name: Start Jackett
block:
- name: Create Jackett Directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ jackett_data_directory }}"
- name: Jackett Docker Container
docker_container:
name: jackett
image: linuxserver/jackett
volumes:
- "{{ jackett_data_directory }}:/config:rw"
- "/etc/localtime:/etc/localtime:ro"
- "{{ jackett_torrents_root }}:/downloads"
ports:
- "{{ jackett_port }}:9117"
env:
TZ: "{{ ansible_nas_timezone }}"
restart_policy: unless-stopped
memory: "{{ jackett_memory }}"
labels:
traefik.enable: "{{ jackett_available_externally | string }}"
traefik.http.routers.jackett.rule: "Host(`{{ jackett_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.jackett.tls.certresolver: "letsencrypt"
traefik.http.routers.jackett.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.jackett.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.jackett.loadbalancer.server.port: "9117"
- name: Jackett Docker Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ jackett_container_name }}"
image: "{{ jackett_image_name }}:{{ jackett_image_version }}"
volumes:
- "{{ jackett_data_directory }}:/config:rw"
- "/etc/localtime:/etc/localtime:ro"
- "{{ jackett_torrents_root }}:/downloads"
ports:
- "{{ jackett_port }}:9117"
env:
TZ: "{{ ansible_nas_timezone }}"
restart_policy: unless-stopped
memory: "{{ jackett_memory }}"
labels:
traefik.enable: "{{ jackett_available_externally | string }}"
traefik.http.routers.jackett.rule: "Host(`{{ jackett_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.jackett.tls.certresolver: "letsencrypt"
traefik.http.routers.jackett.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.jackett.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.jackett.loadbalancer.server.port: "9117"
when: jackett_enabled is true
- name: Stop Jackett
block:
- name: Stop Jackett
community.docker.docker_container:
name: "{{ jackett_container_name }}"
state: absent
when: jackett_enabled is false

View file

@ -29,5 +29,10 @@ jellyfin_hostname: "jellyfin"
jellyfin_port_http: "8896"
jellyfin_port_https: "8928"
# docker
jellyfin_container_name: "jellyfin"
jellyfin_image_name: "linuxserver/jellyfin"
jellyfin_image_version: "latest"
# specs
jellyfin_memory: "1g"

View file

@ -0,0 +1,65 @@
# Jellyfin
Homepage: <https://jellyfin.org/>
Jellyfin is a Free Software Media System that puts you in control of managing and streaming your media. It is an alternative to the proprietary Emby and Plex, to provide media from a dedicated server to end-user devices via multiple apps. Jellyfin is descended from Emby's 3.5.2 release and ported to the .NET Core framework to enable full cross-platform support. There are no strings attached, no premium licenses or features, and no hidden agendas: just a team who want to build something better and work together to achieve it. We welcome anyone who is interested in joining us in our quest!
Note that [Plex](https://www.plex.tv/), also included in Ansible-NAS, has a very
similar functionality.
## Usage
Set `jellyfin_enabled: true` in your `inventories/<your_inventory>/nas.yml` file. There are further
parameters you can edit such as `movies_root`, `tv_root` or `music_root` lower down
## Specific Configuration
The jellyfin web interface can be found at port 8896 (http) or 8928 (https, if
configured) of your NAS.
By default, Ansible-NAS gives jellyfin read/write access to the folders where your
movies, TV shows and music are stored. To change this to read-only, edit the following
lines in `all.yml`:
```yaml
jellyfin_movies_permissions: "rw"
jellyfin_tv_permissions: "rw"
jellyfin_books_permissions: "rw"
jellyfin_audiobooks_permissions: "rw"
jellyfin_music_permissions: "rw"
```
so that they end in `ro` instead of `rw`. Note that jellyfin will not be able to
delete files then, which might be exactly what you want. However, you will not
have the option to store cover art in the related folders. Always leave the
configuration directory read/write
## Naming movies and TV shows
jellyfin is very fussy about how movies and TV shows must be named to enable
automatic downloads of cover art and metadata. In short, movie files should
follow how movies are listed in the [IMDb](https://www.imdb.com/), including the
year of publication:
```raw
movies/Bride of Frankenstein (1935).mp4
```
Note the spaces. You should probably remove colons and other special characters
TV shows require a folder structure with the name of the series - again if
possible with the year of publication - followed by sub-folders for the
individual seasons. For example, the first episode of the first season of
the original "Doctor Who" could be stored as:
```raw
tv/Doctor Who (1963)/Season 1/Doctor Who - s01e01.mp4
```
The [TVDB](https://www.thetvdb.com/) is one source for the exact names of TV
shows.
Unfortunately, there are number of special cases, especially related to split
movies and older series. See the [movie
naming](https://github.com/MediaBrowser/Wiki/wiki/Movie%20naming) and [TV
naming](https://github.com/MediaBrowser/Wiki/wiki/TV-naming) guides for further
information.

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
jellyfin_enabled: true

View file

@ -0,0 +1,10 @@
---
- name: Stop
hosts: all
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
jellyfin_enabled: false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get jellyfin container state
community.docker.docker_container:
name: "{{ jellyfin_container_name }}"
register: result
- name: Check if jellyfin containers are running
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove jellyfin
community.docker.docker_container:
name: "{{ jellyfin_container_name }}"
state: absent
register: result
- name: Check if jellyfin is stopped
ansible.builtin.assert:
that:
- not result.changed

View file

@ -1,37 +1,49 @@
---
- name: Create Jellyfin Directories
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ jellyfin_config_directory }}"
- name: Start jellyfin
block:
- name: Create Jellyfin Directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ jellyfin_config_directory }}"
- name: Jellyfin Docker Container
docker_container:
name: jellyfin
image: linuxserver/jellyfin
pull: true
volumes:
- "{{ jellyfin_config_directory }}:/config:rw"
- "{{ jellyfin_movies_directory }}:/movies:{{ jellyfin_movies_permissions }}"
- "{{ jellyfin_music_directory }}:/music:{{ jellyfin_music_permissions }}"
- "{{ jellyfin_photos_directory }}:/photos:{{ jellyfin_photos_permissions }}"
- "{{ jellyfin_tv_directory }}:/tv:{{ jellyfin_tv_permissions }}"
- "{{ jellyfin_books_directory }}:/books:{{ jellyfin_books_permissions }}"
- "{{ jellyfin_audiobooks_directory }}:/audiobooks:{{ jellyfin_audiobooks_permissions }}"
ports:
- "{{ jellyfin_port_http }}:8096"
- "{{ jellyfin_port_https }}:8920"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ jellyfin_user_id }}"
PGID: "{{ jellyfin_group_id }}"
restart_policy: unless-stopped
memory: "{{ jellyfin_memory }}"
labels:
traefik.enable: "{{ jellyfin_available_externally | string }}"
traefik.http.routers.jellyfin.rule: "Host(`{{ jellyfin_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.jellyfin.tls.certresolver: "letsencrypt"
traefik.http.routers.jellyfin.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.jellyfin.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.jellyfin.loadbalancer.server.port: "8096"
- name: Jellyfin Docker Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ jellyfin_container_name }}"
image: "{{ jellyfin_image_name }}:{{ jellyfin_image_version }}"
pull: true
volumes:
- "{{ jellyfin_config_directory }}:/config:rw"
- "{{ jellyfin_movies_directory }}:/movies:{{ jellyfin_movies_permissions }}"
- "{{ jellyfin_music_directory }}:/music:{{ jellyfin_music_permissions }}"
- "{{ jellyfin_photos_directory }}:/photos:{{ jellyfin_photos_permissions }}"
- "{{ jellyfin_tv_directory }}:/tv:{{ jellyfin_tv_permissions }}"
- "{{ jellyfin_books_directory }}:/books:{{ jellyfin_books_permissions }}"
- "{{ jellyfin_audiobooks_directory }}:/audiobooks:{{ jellyfin_audiobooks_permissions }}"
ports:
- "{{ jellyfin_port_http }}:8096"
- "{{ jellyfin_port_https }}:8920"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ jellyfin_user_id }}"
PGID: "{{ jellyfin_group_id }}"
restart_policy: unless-stopped
memory: "{{ jellyfin_memory }}"
labels:
traefik.enable: "{{ jellyfin_available_externally | string }}"
traefik.http.routers.jellyfin.rule: "Host(`{{ jellyfin_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.jellyfin.tls.certresolver: "letsencrypt"
traefik.http.routers.jellyfin.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.jellyfin.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.jellyfin.loadbalancer.server.port: "8096"
when: jellyfin_enabled is true
- name: Stop jellyfin
block:
- name: Stop jellyfin
community.docker.docker_container:
name: "{{ jellyfin_container_name }}"
state: absent
when: jellyfin_enabled is false

View file

@ -10,6 +10,16 @@ joomla_data_directory: "{{ docker_home }}/joomla"
# network
joomla_port: "8181"
joomla_hostname: "joomla"
joomla_network_name: "joomla"
# docker
joomla_container_name: "joomla"
joomla_image_name: "joomla"
joomla_image_version: "latest"
joomla_db_container_name: "joomla-db"
joomla_db_image_name: "mysql"
joomla_db_image_version: "5.7"
# specs
joomla_memory: 1g
joomla_db_memory: 1g

View file

@ -0,0 +1,23 @@
# Joomla
Homepage: <https://www.joomla.org/>
Joomla! is an award-winning content management system (CMS), which enables you to build web sites and powerful online applications.
## Usage
Set `joomla_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
If you want to access Joomla externally, set `joomla_available_externally: true` in your `inventories/<your_inventory>/nas.yml` file.
The Joomla web interface can be found at <http://ansible_nas_host_or_ip:8181>.
## Specific Configuration
- Set `joomla_database_password` in your `all.yml` before installing Joomla.
- On first run you'll need to enter database details:
- Host: `mysql`
- Database: `joomla`
- Username: `root`
- Password: whatever you set for `joomla_database_password`.

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
joomla_enabled: true

View file

@ -0,0 +1,10 @@
---
- name: Stop
hosts: all
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
joomla_enabled: false

View file

@ -0,0 +1,26 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get joomla container state
community.docker.docker_container:
name: "{{ joomla_container_name }}"
register: result
- name: Get joomla db container state
community.docker.docker_container:
name: "{{ joomla_db_container_name }}"
register: result_db
- name: Check if joomla containers are running
ansible.builtin.assert:
that:
- result_db.container['State']['Status'] == "running"
- result_db.container['State']['Restarting'] == false
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -0,0 +1,26 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove joomla
community.docker.docker_container:
name: "{{ joomla_container_name }}"
state: absent
register: result
- name: Try and stop and remove joomla db
community.docker.docker_container:
name: "{{ joomla_db_container_name }}"
state: absent
register: result_db
- name: Check if joomla is stopped
ansible.builtin.assert:
that:
- not result.changed
- not result_db.changed

View file

@ -1,47 +1,72 @@
---
- name: Create Joomla Directories
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ joomla_data_directory }}"
- "{{ joomla_data_directory }}/db"
- name: Start Joomla
block:
- name: Create Joomla Directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ joomla_data_directory }}"
- "{{ joomla_data_directory }}/db"
- name: MySQL Docker Container for Joomla
docker_container:
name: joomla_mysql
image: mysql:5.7
pull: true
volumes:
- "{{ joomla_data_directory }}/db:/var/lib/mysql"
env:
MYSQL_DATABASE: "joomla"
MYSQL_USER: "joomla"
MYSQL_ROOT_PASSWORD: "{{ joomla_database_password }}"
restart_policy: unless-stopped
memory: 1g
- name: Create Joomla network
community.docker.docker_network:
name: "{{ joomla_network_name }}"
- name: Joomla Docker Container
docker_container:
name: joomla
image: joomla
pull: true
volumes:
- "{{ joomla_data_directory }}:/var/www/html:rw"
ports:
- "{{ joomla_port }}:80"
links:
- "joomla_mysql:mysql"
env:
JOOMLA_DB_HOST: "mysql"
JOOMLA_DB_USER: "root"
JOOMLA_DB_PASSWORD: "{{ joomla_database_password }}"
restart_policy: unless-stopped
memory: "{{ joomla_memory }}"
labels:
traefik.enable: "{{ joomla_available_externally | string }}"
traefik.http.routers.joomla.rule: "Host(`{{ joomla_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.joomla.tls.certresolver: "letsencrypt"
traefik.http.routers.joomla.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.joomla.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.joomla.loadbalancer.server.port: "80"
- name: MySQL Docker Container for Joomla
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ joomla_db_container_name }}"
image: "{{ joomla_db_image_name }}:{{ joomla_db_image_version }}"
pull: true
networks:
- name: "{{ joomla_network_name }}"
network_mode: "{{ joomla_network_name }}"
volumes:
- "{{ joomla_data_directory }}/db:/var/lib/mysql"
env:
MYSQL_DATABASE: "joomla"
MYSQL_USER: "joomla"
MYSQL_ROOT_PASSWORD: "{{ joomla_database_password }}"
restart_policy: unless-stopped
memory: "{{ joomla_db_memory }}"
- name: Joomla Docker Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ joomla_container_name }}"
image: "{{ joomla_image_name }}:{{ joomla_image_version }}"
pull: true
networks:
- name: "{{ joomla_network_name }}"
network_mode: "{{ joomla_network_name }}"
volumes:
- "{{ joomla_data_directory }}:/var/www/html:rw"
ports:
- "{{ joomla_port }}:80"
env:
JOOMLA_DB_HOST: "{{ joomla_db_container_name }}"
JOOMLA_DB_USER: "root"
JOOMLA_DB_PASSWORD: "{{ joomla_database_password }}"
restart_policy: unless-stopped
memory: "{{ joomla_memory }}"
labels:
traefik.enable: "{{ joomla_available_externally | string }}"
traefik.http.routers.joomla.rule: "Host(`{{ joomla_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.joomla.tls.certresolver: "letsencrypt"
traefik.http.routers.joomla.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.joomla.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.joomla.loadbalancer.server.port: "80"
when: joomla_enabled is true
- name: Stop Joomla
block:
- name: Stop Joomla
community.docker.docker_container:
name: "{{ joomla_container_name }}"
state: absent
- name: Stop Joomla DB
community.docker.docker_container:
name: "{{ joomla_db_container_name }}"
state: absent
when: joomla_enabled is false

View file

@ -16,5 +16,10 @@ komga_group_id: "1000"
komga_hostname: "komga"
komga_port_http: "8088"
# docker
komga_container_name: "komga"
komga_image_name: "gotson/komga"
komga_image_version: "latest"
# specs
komga_memory: "1g"

13
roles/komga/docs/komga.md Normal file
View file

@ -0,0 +1,13 @@
# Komga
Homepage: <https://komga.org/>
Docker Image: <https://hub.docker.com/r/gotson/komga>
Komga is a media server for your comics, mangas, BDs and magazines.
## Usage
Set `komga_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
Access the webui at <http://ansible_nas_host_or_ip:8088> by default.

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
komga_enabled: true

View file

@ -0,0 +1,10 @@
---
- name: Stop
hosts: all
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
komga_enabled: false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
include_vars:
file: ../../defaults/main.yml
- name: Get komga container state
docker_container_info:
name: "{{ komga_container_name }}"
register: result
- name: Check if komga docker container is running
assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove komga
docker_container:
name: "{{ komga_container_name }}"
state: absent
register: result
- name: Check if komga container is stopped
assert:
that:
- not result.changed

View file

@ -1,36 +1,48 @@
---
- name: Create Komga Directories
file:
path: "{{ item }}"
state: directory
# mode: 0755
with_items:
- "{{ komga_data_directory }}"
- "{{ komga_data_directory }}/config"
- name: Start Komga
block:
- name: Create Komga Directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
# mode: 0755
with_items:
- "{{ komga_data_directory }}"
- "{{ komga_data_directory }}/config"
- name: Komga Docker Container
docker_container:
name: komga
image: gotson/komga
pull: true
volumes:
- "{{ komga_comics_directory }}:/comics:ro"
- "{{ komga_books_directory }}:/books:ro"
- "{{ komga_data_directory }}:/data:rw"
- "{{ komga_data_directory }}/config:/config:rw"
network_mode: "bridge"
ports:
- "{{ komga_port_http }}:8080"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ komga_user_id }}"
PGID: "{{ komga_group_id }}"
restart_policy: unless-stopped
memory: "{{ komga_memory }}"
labels:
traefik.enable: "{{ komga_available_externally | string }}"
traefik.http.routers.komga.rule: "Host(`{{ komga_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.komga.tls.certresolver: "letsencrypt"
traefik.http.routers.komga.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.komga.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.komga.loadbalancer.server.port: "8080"
- name: Komga Docker Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ komga_container_name }}"
image: "{{ komga_image_name }}:{{ komga_image_version }}"
pull: true
volumes:
- "{{ komga_comics_directory }}:/comics:ro"
- "{{ komga_books_directory }}:/books:ro"
- "{{ komga_data_directory }}:/data:rw"
- "{{ komga_data_directory }}/config:/config:rw"
network_mode: "bridge"
ports:
- "{{ komga_port_http }}:8080"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ komga_user_id }}"
PGID: "{{ komga_group_id }}"
restart_policy: unless-stopped
memory: "{{ komga_memory }}"
labels:
traefik.enable: "{{ komga_available_externally | string }}"
traefik.http.routers.komga.rule: "Host(`{{ komga_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.komga.tls.certresolver: "letsencrypt"
traefik.http.routers.komga.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.komga.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.komga.loadbalancer.server.port: "8080"
when: komga_enabled is true
- name: Stop Komga
block:
- name: Stop Komga
community.docker.docker_container:
name: "{{ komga_container_name }}"
state: absent
when: komga_enabled is false

View file

@ -18,5 +18,10 @@ krusader_port_http: "5800"
krusader_port_vnc: "5900"
krusader_hostname: "krusader"
# docker
krusader_container_name: "krusader"
krusader_image_name: "djaydev/krusader"
krusader_image_version: "latest"
# specs
krusader_memory: 1g

View file

@ -0,0 +1,13 @@
# Krusader
Homepage: <https://krusader.org/>
Docker Container: [Krusader](https://hub.docker.com/r/djaydev/krusader)
Krusader provides twin panel file management for your ansible-nas via browser and VNC.
## Usage
Set `krusader_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
The Krusader web interface can be found at <http://ansible_nas_host_or_ip:5800>.

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
krusader_enabled: true

View file

@ -0,0 +1,10 @@
---
- name: Stop
hosts: all
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
krusader_enabled: false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
include_vars:
file: ../../defaults/main.yml
- name: Get krusader container state
docker_container_info:
name: "{{ krusader_container_name }}"
register: result
- name: Check if krusader docker container is running
assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove krusader
docker_container:
name: "{{ krusader_container_name }}"
state: absent
register: result
- name: Check if krusader container is stopped
assert:
that:
- not result.changed

View file

@ -1,34 +1,46 @@
---
- name: Krusader Directory
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ krusader_config_directory }}/krusader"
- name: Start Krusader
block:
- name: Krusader Directory
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ krusader_config_directory }}/krusader"
- name: Krusader Docker Container
docker_container:
name: krusader
image: djaydev/krusader:latest
pull: true
volumes:
- "{{ krusader_config_directory }}:/config:rw"
- "{{ krusader_browse_directory }}:/mnt/fs"
ports:
- "{{ krusader_port_http }}:5800"
- "{{ krusader_port_vnc }}:5900"
env:
USER_ID: "{{ krusader_user_id }}"
GROUP_ID: "{{ krusader_group_id }}"
SECURE_CONNECTION: "{{ krusader_secure_connection }}"
TZ: "{{ ansible_nas_timezone }}"
VNC_PASSWORD: "{{ krusader_vnc_password }}"
restart_policy: unless-stopped
memory: "{{ krusader_memory }}"
labels:
traefik.enable: "{{ krusader_available_externally }}"
traefik.http.routers.krusader.rule: "Host(`{{ krusader_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.krusader.tls.certresolver: "letsencrypt"
traefik.http.routers.krusader.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.krusader.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.krusader.loadbalancer.server.port: "5800"
- name: Krusader Docker Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ krusader_container_name }}"
image: "{{ krusader_image_name }}:{{ krusader_image_version }}"
pull: true
volumes:
- "{{ krusader_config_directory }}:/config:rw"
- "{{ krusader_browse_directory }}:/mnt/fs"
ports:
- "{{ krusader_port_http }}:5800"
- "{{ krusader_port_vnc }}:5900"
env:
USER_ID: "{{ krusader_user_id }}"
GROUP_ID: "{{ krusader_group_id }}"
SECURE_CONNECTION: "{{ krusader_secure_connection }}"
TZ: "{{ ansible_nas_timezone }}"
VNC_PASSWORD: "{{ krusader_vnc_password }}"
restart_policy: unless-stopped
memory: "{{ krusader_memory }}"
labels:
traefik.enable: "{{ krusader_available_externally }}"
traefik.http.routers.krusader.rule: "Host(`{{ krusader_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.krusader.tls.certresolver: "letsencrypt"
traefik.http.routers.krusader.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.krusader.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.krusader.loadbalancer.server.port: "5800"
when: krusader_enabled is true
- name: Stop Krusader
block:
- name: Stop Krusader
community.docker.docker_container:
name: "{{ krusader_container_name }}"
state: absent
when: krusader_enabled is false

View file

@ -15,5 +15,10 @@ lidarr_group_id: "0"
lidarr_port: "8686"
lidarr_hostname: "lidarr"
# docker
lidarr_container_name: "lidarr"
lidarr_image_name: "linuxserver/lidarr"
lidarr_image_version: "latest"
# specs
lidarr_memory: 1g

View file

@ -0,0 +1,9 @@
# Lidarr
Homepage: <https://lidarr.audio/>
Lidarr is a music collection manager for Usenet and BitTorrent users. It can monitor multiple RSS feeds for new tracks from your favorite artists and will grab, sort and rename them. It can also be configured to automatically upgrade the quality of files already downloaded when a better quality format becomes available.
## Usage
Set `lidarr_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
lidarr_enabled: true

View file

@ -0,0 +1,10 @@
---
- name: Stop
hosts: all
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
lidarr_enabled: false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get lidarr container state
community.docker.docker_container:
name: "{{ lidarr_container_name }}"
register: result
- name: Check if lidarr containers are running
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove lidarr
community.docker.docker_container:
name: "{{ lidarr_container_name }}"
state: absent
register: result
- name: Check if lidarr is stopped
ansible.builtin.assert:
that:
- not result.changed

View file

@ -1,30 +1,42 @@
---
- name: Create Lidarr Directory
file:
path: "{{ lidarr_data_directory }}"
state: directory
- name: Start Lidarr
block:
- name: Create Lidarr Directory
ansible.builtin.file:
path: "{{ lidarr_data_directory }}"
state: directory
- name: Lidarr Docker Container
docker_container:
name: lidarr
image: linuxserver/lidarr
pull: true
volumes:
- "{{ lidarr_music_directory }}:/music:rw"
- "{{ lidarr_downloads_directory }}:/downloads:rw"
- "{{ lidarr_data_directory }}:/config:rw"
ports:
- "{{ lidarr_port }}:8686"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ lidarr_user_id }}"
PGID: "{{ lidarr_group_id }}"
restart_policy: unless-stopped
memory: "{{ lidarr_memory }}"
labels:
traefik.enable: "{{ lidarr_available_externally | string }}"
traefik.http.routers.lidarr.rule: "Host(`{{ lidarr_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.lidarr.tls.certresolver: "letsencrypt"
traefik.http.routers.lidarr.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.lidarr.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.lidarr.loadbalancer.server.port: "8686"
- name: Lidarr Docker Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ lidarr_container_name }}"
image: "{{ lidarr_image_name }}:{{ lidarr_image_version }}"
pull: true
volumes:
- "{{ lidarr_music_directory }}:/music:rw"
- "{{ lidarr_downloads_directory }}:/downloads:rw"
- "{{ lidarr_data_directory }}:/config:rw"
ports:
- "{{ lidarr_port }}:8686"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ lidarr_user_id }}"
PGID: "{{ lidarr_group_id }}"
restart_policy: unless-stopped
memory: "{{ lidarr_memory }}"
labels:
traefik.enable: "{{ lidarr_available_externally | string }}"
traefik.http.routers.lidarr.rule: "Host(`{{ lidarr_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.lidarr.tls.certresolver: "letsencrypt"
traefik.http.routers.lidarr.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.lidarr.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.lidarr.loadbalancer.server.port: "8686"
when: lidarr_enabled is true
- name: Stop Lidarr
block:
- name: Stop Lidarr
community.docker.docker_container:
name: "{{ lidarr_container_name }}"
state: absent
when: lidarr_enabled is false

View file

@ -13,5 +13,10 @@ mealie_group_id: "1000"
mealie_hostname: "mealie"
mealie_port: "9925"
# docker
mealie_container_name: "mealie"
mealie_image_name: "hkotel/mealie"
mealie_image_version: "latest"
# specs
mealie_memory: 1g

View file

@ -0,0 +1,11 @@
# Mealie
Homepage: <https://docs.mealie.io/>
A self-hosted recipe manager and meal planner with a RestAPI backend and a reactive frontend application built in Vue for a pleasant user experience for the whole family.
## Usage
Set `mealie_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
The Mealie web interface can be found at <http://ansible_nas_host_or_ip:9925>.

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
mealie_enabled: true

View file

@ -0,0 +1,10 @@
---
- name: Stop
hosts: all
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
mealie_enabled: false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get mealie container state
community.docker.docker_container:
name: "{{ mealie_container_name }}"
register: result
- name: Check if mealie containers are running
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove mealie
community.docker.docker_container:
name: "{{ mealie_container_name }}"
state: absent
register: result
- name: Check if mealie is stopped
ansible.builtin.assert:
that:
- not result.changed

View file

@ -1,37 +1,50 @@
---
- name: Create Mealie Directories
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ mealie_data_directory }}/data"
- name: Start Mealie
block:
- name: Create Mealie Directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ mealie_data_directory }}/data"
- name: Mealie Docker Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ mealie_container_name }}"
image: "{{ mealie_image_name }}:{{ mealie_image_version }}"
pull: true
volumes:
- "{{ mealie_data_directory }}:/app/data:rw"
ports:
- "{{ mealie_port }}:80"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ mealie_user_id }}"
PGID: "{{ mealie_group_id }}"
RECIPE_PUBLIC: "true"
RECIPE_SHOW_NUTRITION: "true"
RECIPE_SHOW_ASSETS: "true"
RECIPE_LANDSCAPE_VIEW: "true"
RECIPE_DISABLE_COMMENTS: "false"
RECIPE_DISABLE_AMOUNT: "false"
BASE_URL: "{{ ansible_nas_domain }}:{{ mealie_port }}"
restart_policy: unless-stopped
memory: "{{ mealie_memory }}"
labels:
traefik.enable: "{{ mealie_available_externally | string }}"
traefik.http.routers.mealie.rule: "Host(`{{ mealie_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.mealie.tls.certresolver: "letsencrypt"
traefik.http.routers.mealie.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.mealie.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.mealie.loadbalancer.server.port: "80"
when: mealie_enabled is true
- name: Stop Mealie
block:
- name: Stop Mealie
community.docker.docker_container:
name: "{{ mealie_container_name }}"
state: absent
when: mealie_enabled is false
- name: Mealie Docker Container
docker_container:
name: mealie
image: hkotel/mealie:latest
pull: true
volumes:
- "{{ mealie_data_directory }}:/app/data:rw"
ports:
- "{{ mealie_port }}:80"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ mealie_user_id }}"
PGID: "{{ mealie_group_id }}"
RECIPE_PUBLIC: "true"
RECIPE_SHOW_NUTRITION: "true"
RECIPE_SHOW_ASSETS: "true"
RECIPE_LANDSCAPE_VIEW: "true"
RECIPE_DISABLE_COMMENTS: "false"
RECIPE_DISABLE_AMOUNT: "false"
BASE_URL: "{{ ansible_nas_domain }}:{{ mealie_port }}"
restart_policy: unless-stopped
memory: "{{ mealie_memory }}"
labels:
traefik.enable: "{{ mealie_available_externally | string }}"
traefik.http.routers.mealie.rule: "Host(`{{ mealie_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.mealie.tls.certresolver: "letsencrypt"
traefik.http.routers.mealie.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.mealie.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.mealie.loadbalancer.server.port: "80"

View file

@ -6,3 +6,8 @@ minecraft_server_data_directory: "{{ docker_home }}/minecraft_server"
# network
minecraft_server_port: "25565"
# docker
minecraft_server_container_name: "minecraft-server"
minecraft_server_image_name: "itzg/minecraft-server"
minecraft_server_image_version: "latest"

View file

@ -0,0 +1,13 @@
# Minecraft Server
Homepage: <https://www.minecraft.net/>
The server version of the game Minecraft, running in a container. "Prepare for an adventure of limitless possibilities as you build, mine, battle mobs, and explore the ever-changing Minecraft landscape."
## Usage
Set `minecraft_server_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
The Ansible NAS host or ip address should then be usable as a server within the Minecraft multiplayer game menu.
The image `itzg/minecraft-server` has [documentation](https://github.com/itzg/docker-minecraft-server/blob/master/README.md) with further details on how to manage the Minecraft server instance.

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
minecraft_server_enabled: true

View file

@ -0,0 +1,10 @@
---
- name: Stop
hosts: all
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
minecraft_server_enabled: false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get minecraft_server container state
community.docker.docker_container:
name: "{{ minecraft_server_container_name }}"
register: result
- name: Check if minecraft_server containers are running
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove minecraft_server
community.docker.docker_container:
name: "{{ minecraft_server_container_name }}"
state: absent
register: result
- name: Check if minecraft_server is stopped
ansible.builtin.assert:
that:
- not result.changed

View file

@ -1,20 +1,32 @@
---
- name: Create Minecraft Server Directories
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ minecraft_server_data_directory }}"
- name: Start Minecraft Server
block:
- name: Create Minecraft Server Directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ minecraft_server_data_directory }}"
- name: Minecraft Server Docker Container
docker_container:
name: minecraft-server
image: itzg/minecraft-server:latest
pull: true
volumes:
- "{{ minecraft_server_data_directory }}:/data:rw"
ports:
- "{{ minecraft_server_port }}:25565"
env:
EULA: "TRUE"
restart_policy: unless-stopped
- name: Minecraft Server Docker Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ minecraft_server_container_name }}"
image: "{{ minecraft_server_image_name }}:{{ minecraft_server_image_version }}"
pull: true
volumes:
- "{{ minecraft_server_data_directory }}:/data:rw"
ports:
- "{{ minecraft_server_port }}:25565"
env:
EULA: "TRUE"
restart_policy: unless-stopped
when: minecraft_server_enabled is true
- name: Stop Minecraft Server
block:
- name: Stop Minecraft Server
community.docker.docker_container:
name: "{{ minecraft_server_container_name }}"
state: absent
when: minecraft_server_enabled is false

View file

@ -11,5 +11,10 @@ minidlna_media_directory2: "{{ tv_root }}"
minidlna_friendly_name: "{{ ansible_nas_hostname }}"
minidlna_port: "8201"
# docker
minidlna_container_name: "minidnla"
minidlna_image_name: "vladgh/minidlna"
minidlna_image_version: "latest"
# specs
minidlna_memory: "1g"

View file

@ -0,0 +1,11 @@
# MiniDLNA
Homepage: <https://sourceforge.net/projects/minidlna/>
MiniDLNA is server software with the aim of being fully compliant with DLNA/UPnP clients. The MiniDNLA daemon serves media files (music, pictures, and video) to clients on a network. Example clients include applications such as Totem and Kodi, and devices such as portable media players, Smartphones, Televisions, and gaming systems (such as PS3 and Xbox 360).
## Usage
Set `minidlna_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
The very basic MiniDLNA web interface can be found at <http://ansible_nas_host_or_ip:8201>.

View file

@ -0,0 +1,7 @@
---
provisioner:
inventory:
group_vars:
all:
minidlna_enabled: true
ansible_nas_hostname: ansible-nas

View file

@ -0,0 +1,10 @@
---
- name: Stop
hosts: all
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
minidlna_enabled: false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get minidlna container state
community.docker.docker_container:
name: "{{ minidlna_container_name }}"
register: result
- name: Check if minidlna containers are running
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove minidlna
community.docker.docker_container:
name: "{{ minidlna_container_name }}"
state: absent
register: result
- name: Check if minidlna is stopped
ansible.builtin.assert:
that:
- not result.changed

View file

@ -1,17 +1,29 @@
---
- name: MiniDLNA Docker Container
docker_container:
name: minidlna
image: vladgh/minidlna
pull: true
volumes:
- "{{ minidlna_media_directory1 }}:/media1:rw"
- "{{ minidlna_media_directory2 }}:/media2:rw"
env:
MINIDLNA_MEDIA_DIR1: "/media1"
MINIDLNA_MEDIA_DIR2: "/media2"
MINIDLNA_FRIENDLY_NAME: "{{ minidlna_friendly_name }}"
MINIDLNA_PORT: "{{ minidlna_port }}"
restart_policy: unless-stopped
network_mode: host
memory: "{{ minidlna_memory }}"
- name: Start MiniDLNA
block:
- name: MiniDLNA Docker Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ minidlna_container_name }}"
image: "{{ minidlna_image_name }}:{{ minidlna_image_version }}"
pull: true
volumes:
- "{{ minidlna_media_directory1 }}:/media1:rw"
- "{{ minidlna_media_directory2 }}:/media2:rw"
env:
MINIDLNA_MEDIA_DIR1: "/media1"
MINIDLNA_MEDIA_DIR2: "/media2"
MINIDLNA_FRIENDLY_NAME: "{{ minidlna_friendly_name }}"
MINIDLNA_PORT: "{{ minidlna_port }}"
restart_policy: unless-stopped
network_mode: host
memory: "{{ minidlna_memory }}"
when: minidlna_enabled is true
- name: Stop MiniDLNA
block:
- name: Stop MiniDLNA
community.docker.docker_container:
name: "{{ minidlna_container_name }}"
state: absent
when: minidlna_enabled is false

View file

@ -14,6 +14,14 @@ miniflux_admin_password: supersecure
miniflux_hostname: "miniflux"
miniflux_port: "8070"
# docker
miniflux_container_name: "miniflux"
miniflux_image_name: "miniflux/miniflux"
miniflux_image_version: "latest"
miniflux_db_container_name: "miniflux-postgres"
miniflux_db_image_name: "postgres"
miniflux_db_image_version: "11.1"
# specs
miniflux_memory: "1g"
miniflux_postgres_memory: "1g"

View file

@ -0,0 +1,15 @@
# Miniflux
Homepage: <https://miniflux.app/>
Miniflux is a minimalist and opinionated feed reader.
## Usage
Set `miniflux_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
The Miniflux web interface can be found at <http://ansible_nas_host_or_ip:8070>, the default username is `admin` and password `supersecure`.
## Specific Configuration
An admin user will be created with the username and password of `miniflux_admin_username` and `miniflux_admin_password` respectively. These can be found in the Miniflux section within `all.yml.dist`.

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
miniflux_enabled: true

View file

@ -0,0 +1,10 @@
---
- name: Stop
hosts: all
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
miniflux_enabled: false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get miniflux container state
community.docker.docker_container:
name: "{{ miniflux_container_name }}"
register: result
- name: Check if miniflux containers are running
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove miniflux
community.docker.docker_container:
name: "{{ miniflux_container_name }}"
state: absent
register: result
- name: Check if miniflux is stopped
ansible.builtin.assert:
that:
- not result.changed

View file

@ -1,45 +1,58 @@
---
- name: Create Miniflux Directories
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ miniflux_data_directory }}/postgres"
- name: Start Miniflux
block:
- name: Create Miniflux Directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ miniflux_data_directory }}/postgres"
- name: Create Postgres for Miniflux
docker_container:
name: miniflux-postgres
image: postgres:11.1
pull: true
volumes:
- "{{ miniflux_data_directory }}/postgres:/var/lib/postgresql/data:rw"
env:
POSTGRES_USER: "miniflux"
POSTGRES_PASSWORD: "supersecure"
restart_policy: unless-stopped
memory: "{{ miniflux_postgres_memory }}"
- name: Create Postgres for Miniflux
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ miniflux_db_container_name }}"
image: "{{ miniflux_db_image_name }}:{{ miniflux_db_image_version }}"
pull: true
volumes:
- "{{ miniflux_data_directory }}/postgres:/var/lib/postgresql/data:rw"
env:
POSTGRES_USER: "miniflux"
POSTGRES_PASSWORD: "supersecure"
restart_policy: unless-stopped
memory: "{{ miniflux_postgres_memory }}"
- name: Create Miniflux Docker Container
docker_container:
name: miniflux
image: miniflux/miniflux:latest
pull: true
links:
- miniflux-postgres:db
ports:
- "{{ miniflux_port }}:8080"
env:
DATABASE_URL: "postgres://miniflux:supersecure@db/miniflux?sslmode=disable"
RUN_MIGRATIONS: "1"
CREATE_ADMIN: "1"
ADMIN_USERNAME: "{{ miniflux_admin_username }}"
ADMIN_PASSWORD: "{{ miniflux_admin_password }}"
restart_policy: unless-stopped
memory: "{{ miniflux_memory }}"
labels:
traefik.enable: "{{ miniflux_available_externally | string }}"
traefik.http.routers.miniflux.rule: "Host(`{{ miniflux_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.miniflux.tls.certresolver: "letsencrypt"
traefik.http.routers.miniflux.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.miniflux.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.miniflux.loadbalancer.server.port: "8080"
- name: Create Miniflux Docker Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ miniflux_container_name }}"
image: "{{ miniflux_image_name }}:{{ miniflux_image_version }}"
pull: true
links:
- miniflux-postgres:db
ports:
- "{{ miniflux_port }}:8080"
env:
DATABASE_URL: "postgres://miniflux:supersecure@db/miniflux?sslmode=disable"
RUN_MIGRATIONS: "1"
CREATE_ADMIN: "1"
ADMIN_USERNAME: "{{ miniflux_admin_username }}"
ADMIN_PASSWORD: "{{ miniflux_admin_password }}"
restart_policy: unless-stopped
memory: "{{ miniflux_memory }}"
labels:
traefik.enable: "{{ miniflux_available_externally | string }}"
traefik.http.routers.miniflux.rule: "Host(`{{ miniflux_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.miniflux.tls.certresolver: "letsencrypt"
traefik.http.routers.miniflux.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.miniflux.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.miniflux.loadbalancer.server.port: "8080"
when: miniflux_enabled is true
- name: Stop Miniflux
block:
- name: Stop Miniflux
community.docker.docker_container:
name: "{{ miniflux_container_name }}"
state: absent
when: miniflux_enabled is false

View file

@ -12,5 +12,10 @@ mosquitto_group_id: "0"
mosquitto_port_a: "1883"
mosquitto_port_b: "9001"
# docker
mosquitto_container_name: "mosquitto"
mosquitto_image_name: "eclipse-mosquitto"
mosquitto_image_version: "latest"
# specs
mosquitto_memory: 1g

View file

@ -0,0 +1,9 @@
# Mosquitto
Homepage: <https://mosquitto.org>
Mosquitto is a lightweight open source MQTT message broker.
## Usage
Set `mosquitto_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.

View file

@ -0,0 +1,16 @@
---
provisioner:
inventory:
group_vars:
all:
mosquitto_enabled: true
mosquitto_data_directory: "/tmp/mosquitto"
platforms:
- name: instance
image: geerlingguy/docker-ubuntu2204-ansible:latest
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /var/run/docker.sock:/var/run/docker.sock
- /tmp:/tmp:rw
privileged: true
pre_build_image: true

View file

@ -0,0 +1,10 @@
---
- name: Stop
hosts: all
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
mosquitto_enabled: false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get mosquitto container state
community.docker.docker_container:
name: "{{ mosquitto_container_name }}"
register: result
- name: Check if mosquitto containers are running
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove mosquitto
community.docker.docker_container:
name: "{{ mosquitto_container_name }}"
state: absent
register: result
- name: Check if mosquitto is stopped
ansible.builtin.assert:
that:
- not result.changed

View file

@ -1,31 +1,43 @@
---
- name: Create Mosquitto Directories
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ mosquitto_data_directory }}/config"
- "{{ mosquitto_data_directory }}/data"
- "{{ mosquitto_data_directory }}/log"
- name: Start Mosquitto
block:
- name: Create Mosquitto Directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ mosquitto_data_directory }}/config"
- "{{ mosquitto_data_directory }}/data"
- "{{ mosquitto_data_directory }}/log"
- name: Template mosquitto.conf
copy:
src: mosquitto.conf
dest: "{{ mosquitto_data_directory }}/config/mosquitto.conf"
register: mosquitto_conf
- name: Template mosquitto.conf
ansible.builtin.copy:
src: mosquitto.conf
dest: "{{ mosquitto_data_directory }}/config/mosquitto.conf"
register: mosquitto_conf
- name: Create Mosquitto container
docker_container:
name: mosquitto
image: eclipse-mosquitto:latest
pull: true
volumes:
- "{{ mosquitto_data_directory }}/config/mosquitto.conf:/mosquitto/config/mosquitto.conf:rw"
- "{{ mosquitto_data_directory }}/data:/mosquitto/data:rw"
- "{{ mosquitto_data_directory }}/log:/mosquitto/log:rw"
ports:
- "{{ mosquitto_port_a }}:1883"
- "{{ mosquitto_port_b }}:9001"
restart_policy: unless-stopped
restart: "{{ mosquitto_conf is changed }}"
memory: 1g
- name: Create Mosquitto container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ mosquitto_container_name }}"
image: "{{ mosquitto_image_name }}:{{ mosquitto_image_version }}"
pull: true
volumes:
- "{{ mosquitto_data_directory }}/config/mosquitto.conf:/mosquitto/config/mosquitto.conf:rw"
- "{{ mosquitto_data_directory }}/data:/mosquitto/data:rw"
- "{{ mosquitto_data_directory }}/log:/mosquitto/log:rw"
ports:
- "{{ mosquitto_port_a }}:1883"
- "{{ mosquitto_port_b }}:9001"
restart_policy: unless-stopped
restart: "{{ mosquitto_conf is changed }}"
memory: 1g
when: mosquitto_enabled is true
- name: Stop Mosquitto
block:
- name: Stop Mosquitto
community.docker.docker_container:
name: "{{ mosquitto_container_name }}"
state: absent
when: mosquitto_enabled is false

View file

@ -16,5 +16,10 @@ mylar_group_id: "0"
mylar_hostname: "mylar"
mylar_port_http: "8585"
# docker
mylar_container_name: "mylar"
mylar_image_name: "linuxserver/mylar"
mylar_image_version: "latest"
# specs
mylar_memory: "1g"

15
roles/mylar/docs/mylar.md Normal file
View file

@ -0,0 +1,15 @@
# Mylar
Homepage: <https://github.com/evilhero/mylar>
Docker Container: <https://hub.docker.com/r/linuxserver/mylar>
An automated Comic Book downloader (cbr/cbz) for use with SABnzbd, NZBGet and torrents
## Usage
Set `mylar_enabled: true` in your `inventories/<your_inventory>/nas.yml` file.
If you want to access Mylar externally, don't forget to set `mylar_available_externally: true` in your `inventories/<your_inventory>/nas.yml` file.
The Mylar web interface can be found at <http://ansible_nas_host_or_ip:5858>.

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
mylar_enabled: true

View file

@ -0,0 +1,10 @@
---
- name: Stop
hosts: all
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
mylar_enabled: false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get mylar container state
community.docker.docker_container:
name: "{{ mylar_container_name }}"
register: result
- name: Check if mylar containers are running
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -0,0 +1,19 @@
---
- name: Verify
hosts: all
gather_facts: false
tasks:
- name: Include vars
ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove mylar
community.docker.docker_container:
name: "{{ mylar_container_name }}"
state: absent
register: result
- name: Check if mylar is stopped
ansible.builtin.assert:
that:
- not result.changed

View file

@ -1,34 +1,46 @@
---
- name: Create Mylar Directories
file:
path: "{{ item }}"
state: directory
# mode: 0755
with_items:
- "{{ mylar_data_directory }}/config"
- name: Start Mylar
block:
- name: Create Mylar Directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
# mode: 0755
with_items:
- "{{ mylar_data_directory }}/config"
- name: Mylar Docker Container
docker_container:
name: mylar
image: linuxserver/mylar
pull: true
volumes:
- "{{ mylar_comics_directory }}:/comics:rw"
- "{{ mylar_downloads_directory }}:/downloads:rw"
- "{{ mylar_data_directory }}/config:/config:rw"
network_mode: "bridge"
ports:
- "{{ mylar_port_http }}:8090"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ mylar_user_id }}"
PGID: "{{ mylar_group_id }}"
restart_policy: unless-stopped
memory: "{{ mylar_memory }}"
labels:
traefik.enable: "{{ mylar_available_externally | string }}"
traefik.http.routers.mylar.rule: "Host(`{{ mylar_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.mylar.tls.certresolver: "letsencrypt"
traefik.http.routers.mylar.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.mylar.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.mylar.loadbalancer.server.port: "8090"
- name: Mylar Docker Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ mylar_container_name }}"
image: "{{ mylar_image_name }}:{{ mylar_image_version }}"
pull: true
volumes:
- "{{ mylar_comics_directory }}:/comics:rw"
- "{{ mylar_downloads_directory }}:/downloads:rw"
- "{{ mylar_data_directory }}/config:/config:rw"
network_mode: "bridge"
ports:
- "{{ mylar_port_http }}:8090"
env:
TZ: "{{ ansible_nas_timezone }}"
PUID: "{{ mylar_user_id }}"
PGID: "{{ mylar_group_id }}"
restart_policy: unless-stopped
memory: "{{ mylar_memory }}"
labels:
traefik.enable: "{{ mylar_available_externally | string }}"
traefik.http.routers.mylar.rule: "Host(`{{ mylar_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.mylar.tls.certresolver: "letsencrypt"
traefik.http.routers.mylar.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.mylar.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.mylar.loadbalancer.server.port: "8090"
when: mylar_enabled is true
- name: Stop Mylar
block:
- name: Stop Mylar
community.docker.docker_container:
name: "{{ mylar_container_name }}"
state: absent
when: mylar_enabled is false

Some files were not shown because too many files have changed in this diff Show more