Merge branch 'main' into add-calibre-manager

This commit is contained in:
Daine Wright 2023-12-22 10:12:05 -05:00 committed by GitHub
commit 205c6efccc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
544 changed files with 9740 additions and 3879 deletions

View file

@ -2,13 +2,12 @@
skip_list:
- risky-file-permissions
- role-name
- fqcn-builtins
- name[missing]
- key-order[task]
- name[template]
exclude_paths:
- roles/bertvv.samba
- roles/geerlingguy.docker
- roles/geerlingguy.docker_arm
- roles/geerlingguy.nfs
mock_modules:
- docker_container
- docker_container_info

View file

@ -26,7 +26,7 @@ jobs:
python-version: "3.x"
- name: Install test dependencies
run: pip3 install ansible yamllint==1.27.1 ansible-lint==6.5
run: pip3 install ansible yamllint==1.30.0 ansible-lint==6.14.6
- name: Ansible-lint
run: ansible-lint nas.yml

View file

@ -20,14 +20,19 @@ jobs:
test-deploy:
name: Test deployment
runs-on: ubuntu-latest
defaults:
run:
working-directory: website
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
cache: npm
cache-dependency-path: website/package-lock.json
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Test build website
run: yarn build
run: npm ci
- name: Build website
run: npm run build

View file

@ -1,11 +1,11 @@
---
repos:
- repo: https://github.com/ansible-community/ansible-lint.git
rev: v6.5.0
rev: v6.14.6
hooks:
- id: ansible-lint
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.27.1
rev: v1.30.0
hooks:
- id: yamllint
- repo: https://github.com/igorshubovych/markdownlint-cli

View file

@ -2,7 +2,7 @@
"recommendations": [
"redhat.ansible",
"redhat.vscode-yaml",
"ybaumes.highlight-trailing-white-spaces",
"bungcip.better-toml"
"tamasfe.even-better-toml",
"ybaumes.highlight-trailing-white-spaces"
]
}

View file

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2017-2022 David Stephens
Copyright (c) 2017-2023 David Stephens
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View file

@ -1,5 +1,6 @@
# Ansible NAS
![Available Applications](https://img.shields.io/github/directory-file-count/davestephens/ansible-nas/roles?label=Available%20Applications&style=flat-square)
[![CI](https://github.com/davestephens/ansible-nas/workflows/CI/badge.svg)](https://github.com/davestephens/ansible-nas/actions?query=workflow%3ACI)
[![Integration](https://github.com/davestephens/ansible-nas/workflows/Integration/badge.svg)](https://github.com/davestephens/ansible-nas/actions?query=workflow%3AIntegration)
[![Gitter chat](https://img.shields.io/gitter/room/ansible-nas/chat.svg?logo=gitter&style=flat-square)](https://gitter.im/Ansible-NAS/Chat)
@ -18,7 +19,7 @@ If you have a spare domain name you can configure applications to be accessible
* [Airsonic](https://airsonic.github.io/) - catalog and stream music
* [Bazarr](https://github.com/morpheus65535/bazarr) - companion to Radarr and Sonarr for downloading subtitles
* [Bitwarden_rs](https://github.com/dani-garcia/bitwarden_rs) - Self-Hosting port of password manager
* [Bitwarden](https://github.com/dani-garcia/vaultwarden) - Password Manger (Technically Vaultwarden, a lightweight implementation in Rust)
* [Booksonic](https://booksonic.org/) - The selfhosted audiobook server
* [Calibre-web](https://github.com/janeczku/calibre-web) - Provides a clean interface for browsing, reading and downloading eBooks using an existing Calibre database.
* [Calibre](https://calibre-ebook.com) - Calibre is a powerful and easy to use e-book manager.
@ -27,6 +28,7 @@ If you have a spare domain name you can configure applications to be accessible
* [Cloudflare DDNS](https://hub.docker.com/r/joshuaavalon/cloudflare-ddns/) - automatically update Cloudflare with your IP address
* [CouchPotato](https://couchpota.to/) - for downloading and managing movies
* [Dashy](https://dashy.to/) - A self-hosted startpage for your server. Easy to use visual editor, status checking, widgets, themes and tons more!
* [DDNS Updater](https://github.com/qdm12/ddns-updater) - dynamic dns updater for serveral providers
* [Deluge](https://dev.deluge-torrent.org/) - A lightweight, Free Software, cross-platform BitTorrent client.
* [DokuWiki](https://www.dokuwiki.org/) - A simple to use and highly versatile Open Source wiki software that doesn't require a database.
* [Drone CI](https://drone.io) - A self-service Continuous Integration platform for busy development teams.
@ -53,11 +55,14 @@ If you have a spare domain name you can configure applications to be accessible
* [Komga](https://komga.org/) - a media server for your comics, mangas, BDs and magazines
* [Krusader](https://krusader.org/) - Twin panel file management for your desktop
* [Lidarr](https://github.com/lidarr/Lidarr) - Music collection manager for Usenet and BitTorrent users
* [Loki](https://grafana.com/oss/loki/) - Loki is a horizontally scalable, highly available, multi-tenant log aggregation system inspired by Prometheus.
* [Mealie](https://hay-kot.github.io/mealie/) - A self-hosted recipe manager and meal planner
* [Minecraft Server](https://www.minecraft.net/) - Server edition of the popular building and exploring game
* [MiniDLNA](https://sourceforge.net/projects/minidlna/) - simple media server which is fully compliant with DLNA/UPnP-AV clients
* [Miniflux](https://miniflux.app/) - An RSS news reader
* [Minio](https://min.io/) - MinIO is a high-performance, S3 compatible object store
* [Mosquitto](https://mosquitto.org) - An open source MQTT broker
* [Mumble](https://www.mumble.info) - Open source, low latency, high quality voice chat
* [Mylar](https://github.com/evilhero/mylar) - An automated Comic Book downloader (cbr/cbz) for use with SABnzbd, NZBGet and torrents
* [MyMediaForAlexa](https://www.mymediaalexa.com/) - Lets you stream your music collection to your alexa device
* [n8n](https://n8n.io/) - Nodemation, a node based workflow and automation service like IFTTT.
@ -77,6 +82,7 @@ If you have a spare domain name you can configure applications to be accessible
* [Plex](https://www.plex.tv/) - Plex Media Server
* [Portainer](https://portainer.io/) - for managing Docker and running custom images
* [Prometheus](https://prometheus.io/) - Time series database and monitoring system (via stats role).
* [Promtail](https://grafana.com/docs/loki/latest/clients/promtail/) - Promtail is an agent which ships the contents of local logs to a private Grafana Loki instance
* [Prowlarr](https://github.com/Prowlarr/Prowlarr) - Indexer aggregator for Sonarr, Radarr, Lidarr, etc.
* [pyLoad](https://pyload.net/) - A download manager with a friendly web-interface
* [PyTivo](http://pytivo.org) - An HMO and GoBack server for TiVos.
@ -105,6 +111,12 @@ If you have a spare domain name you can configure applications to be accessible
* [YouTubeDL-Material](https://github.com/Tzahi12345/YoutubeDL-Material) - Self-hosted YouTube downloader built on Material Design
* [ZNC](https://wiki.znc.in/ZNC) - IRC bouncer to stay connected to favourite IRC networks and channels
## Preconfigured Application Stacks
Ansible-NAS application [stacks](https://ansible-nas.io/docs/category/stacks/) are a number of applications deployed together and preconfigured to perform a common goal.
* [Logging](https://ansible-nas.io/docs/applications/stacks/logging/) - application logging capture and search service based on Grafana Loki.
## What This Could Do
Ansible-NAS can run anything that's in a Docker image, which is why Portainer is included. A NAS configuration is a pretty personal thing based on what you download, what media you view, how many photos you take...so it's difficult to please everyone.
@ -113,7 +125,7 @@ That said, if specific functionality you want isn't included and you think other
## What This Doesn't Do
Ansible NAS doesn't set up your disk partitions, primarily because getting it wrong can be incredibly destructive. That aside, configuring partitions is usually a one-time (or very infrequent) event, so there's not much to be gained by automating it. Check out the [docs](https://davestephens.github.io/ansible-nas) for recommended setups.
Ansible NAS doesn't set up your disk partitions, primarily because getting it wrong can be incredibly destructive. That aside, configuring partitions is usually a one-time (or very infrequent) event, so there's not much to be gained by automating it. Check out the [docs](https://ansible-nas.io/docs/) for recommended setups.
## Installation
@ -136,7 +148,7 @@ Read the [migrating from FreeNAS](https://ansible-nas.io/docs/further-configurat
Getting help is easy! You can:
* Read the [docs](https://davestephens.github.io/ansible-nas)
* Read the [docs](https://ansible-nas.io/docs/)
* Start a [discussion](https://github.com/davestephens/ansible-nas/discussions)
* Raise an [issue](https://github.com/davestephens/ansible-nas/issues) if you think you've found a bug
* Chat on [Gitter](https://gitter.im/Ansible-NAS/Chat)

View file

@ -1,32 +0,0 @@
---
# Project information
site_name: 'Ansible-NAS'
site_description: 'Build a fully functional NAS with an Ubuntu box and this playbook'
site_author: 'David Stephens'
site_url: 'https://davestephens.uk/ansible-nas'
# Configuration
theme:
name: 'material'
language: 'en'
palette:
primary: 'indigo'
accent: 'indigo'
font:
text: 'Roboto'
code: 'Roboto Mono'
# Repository
repo_name: 'davestephens/ansible-nas'
repo_url: 'https://github.com/davestephens/ansible-nas'
# Copyright
copyright: 'Copyright © 2017 - 2022 David Stephens'
# Customization
extra:
manifest: 'manifest.webmanifest'
social:
- icon: 'fontawesome/brands/github-alt'
link: 'https://github.com/davestephens'

105
nas.yml
View file

@ -1,5 +1,6 @@
---
- hosts: all
- name: Ansible-NAS
hosts: all
roles:
###
@ -21,10 +22,17 @@
- skip_ansible_lint
- role: geerlingguy.docker
when: ansible_architecture == "x86_64"
tags:
- docker
- skip_ansible_lint
- role: geerlingguy.docker_arm
when: ansible_architecture == "aarch64"
tags:
- docker_arm
- skip_ansible_lint
###
### Ansible-NAS Roles
###
@ -38,6 +46,15 @@
- ansible-nas-docker
- ansible-nas
###
### Stacks
###
- role: logging
tags:
- logging
###
### Applications
###
@ -85,6 +102,10 @@
tags:
- dashy
- role: ddns_updater
tags:
- ddns_updater
- role: deluge
tags:
- deluge
@ -120,12 +141,10 @@
- role: freshrss
tags:
- freshrss
when: (freshrss_enabled | default(False))
- role: get_iplayer
tags:
- get_iplayer
when: (get_iplayer_enabled | default(False))
- role: gitea
tags:
@ -134,32 +153,26 @@
- role: gitlab
tags:
- gitlab
when: (gitlab_enabled | default(False))
- role: glances
tags:
- glances
when: (glances_enabled | default(False))
- role: gotify
tags:
- gotify
when: (gotify_enabled | default(False))
- role: guacamole
tags:
- guacamole
when: (guacamole_enabled | default(False))
- role: healthchecks.io
tags:
- healthchecks.io
when: (healthchecks_enabled | default(False))
- role: heimdall
tags:
- heimdall
when: (heimdall_enabled | default(False))
- role: hello_world
tags:
@ -168,102 +181,94 @@
- 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: loki
tags:
- loki
- 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: minio
tags:
- minio
- role: mosquitto
tags:
- mosquitto
when: (mosquitto_enabled | default(False))
- role: mumble
tags:
- mumble
- 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:
- navidrome
when: (navidrome_enabled | default(False))
- role: netbootxyz
tags:
- netbootxyz
when: (netbootxyz_enabled | default(False))
- role: netdata
tags:
- netdata
when: (netdata_enabled | default(False))
- role: nextcloud
tags:
- nextcloud
when: (nextcloud_enabled | default(False))
- role: nomad
tags:
@ -272,189 +277,155 @@
- role: nzbget
tags:
- nzbget
when: (nzbget_enabled | default(False))
- role: octoprint
tags:
- octoprint
when: (octoprint_enabled | default(False))
- role: ombi
tags:
- ombi
when: (ombi_enabled | default(False))
- role: openhab
tags:
- openhab
when: (openhab_enabled | default(False))
- role: organizr
tags:
- organizr
when: (organizr_enabled | default(False))
- role: overseerr
tags:
- overseerr
when: (overseerr_enabled | default(False))
- role: paperless_ng
tags:
- paperless_ng
when: (paperless_ng_enabled | default(False))
- role: piwigo
tags:
- piwigo
when: (piwigo_enabled | default(False))
- role: plex
tags:
- plex
when: (plex_enabled | default(False))
- role: portainer
tags:
- portainer
when: (portainer_enabled | default(False))
- role: prowlarr
tags:
- prowlarr
when: (prowlarr_enabled | default(False))
- role: promtail
tags:
- promtail
- role: pyload
tags:
- pyload
when: (pyload_enabled | default(False))
- role: pytivo
tags:
- pytivo
when: (pytivo_enabled | default(False))
- role: radarr
tags:
- radarr
when: (radarr_enabled | default(False))
- role: route53_ddns
tags:
- route53_ddns
when: (route53_ddns_enabled | default(False))
- role: rssbridge
tags:
- rssbridge
when: (rssbridge_enabled | default(False))
- role: sabnzbd
tags:
- sabnzbd
when: (sabnzbd_enabled | default(False))
- role: sickchill
tags:
- sickchill
when: (sickchill_enabled | default(False))
- role: sonarr
tags:
- sonarr
when: (sonarr_enabled | default(False))
- role: speedtest-tracker
tags:
- speedtest-tracker
when: (speedtest_tracker_enabled | default(False))
- role: stats
tags:
- stats
when: (stats_enabled | default(False))
- role: syncthing
tags:
- syncthing
when: (syncthing_enabled | default(False))
- role: tautulli
tags:
- tautulli
when: (tautulli_enabled | default(False))
- role: thelounge
tags:
- thelounge
when: (thelounge_enabled | default(False))
- role: tiddlywiki
tags:
- tiddlywiki
when: (tiddlywiki_enabled | default(False))
- role: timemachine
tags:
- timemachine
when: (timemachine_enabled | default(False))
- role: traefik
tags:
- traefik
when: (traefik_enabled | default(False))
- role: transmission
tags:
- transmission
when: (transmission_enabled | default(False))
- role: transmission-with-openvpn
tags:
- transmission_with_openvpn
when: (transmission_with_openvpn_enabled | default(False))
- role: ubooquity
tags:
- ubooquity
when: (ubooquity_enabled | default(False))
- role: utorrent
tags:
- utorrent
when: (utorrent_enabled | default(False))
- role: virtual_desktop
tags:
- virtual_desktop
when: (virtual_desktop_enabled | default(False))
- role: wallabag
tags:
- wallabag
when: (wallabag_enabled | default(False))
- role: watchtower
tags:
- watchtower
when: (watchtower_enabled | default(False))
- role: wireshark
tags:
- wireshark
when: (wireshark_enabled | default(False))
- role: woodpecker-ci
tags:
- woodpecker_ci
when: (woodpecker_ci_enabled | default(False))
- role: youtubedlmaterial
tags:
- youtubedlmaterial
when: (youtubedlmaterial_enabled | default(False))
- role: znc
tags:
- znc
when: (znc_enabled | default(False))

View file

@ -1,19 +1,20 @@
---
- hosts: all
- name: Permission Data
hosts: all
tasks:
- name: Warning!
debug:
msg: "This playbook will repermission ALL existing data in the shares defined in group_vars/all.yml to be owned by the ansible-nas user and group. If this is not what you want, exit now."
- name: Warning!
ansible.builtin.debug:
msg: "This playbook will repermission ALL existing data in the shares defined in group_vars/all.yml to be owned by the ansible-nas user and group. If this is not what you want, exit now."
- name: 20s to change your mind...
pause:
seconds: 20
- name: 20s to change your mind...
ansible.builtin.pause:
seconds: 20
- name: "Permission share data"
file:
path: "{{ item.path }}"
owner: ansible-nas
group: ansible-nas
mode: "u=rwX,g=rwX,o=rX"
recurse: true
loop: "{{ samba_shares }}"
- name: "Permission share data"
ansible.builtin.file:
path: "{{ item.path }}"
owner: ansible-nas
group: ansible-nas
mode: "u=rwX,g=rwX,o=rX"
recurse: true
loop: "{{ samba_shares }}"

View file

@ -1,9 +1,18 @@
---
- name: geerlingguy.docker
version: 6.0.0
roles:
- name: geerlingguy.docker
version: 6.0.0
- name: bertvv.samba
version: v2.7.1
- name: geerlingguy.docker_arm
version: 5.0.0
- name: geerlingguy.nfs
version: 2.0.0
- name: bertvv.samba
version: v2.7.1
- name: geerlingguy.nfs
version: 2.0.0
collections:
- name: ansible.posix
- name: community.docker
- name: community.general

View file

@ -4,7 +4,7 @@
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
airsonic_enabled: false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get container state
docker_container_info:
community.docker.docker_container_info:
name: "{{ airsonic_container_name }}"
register: result
- name: Check Airsonic is running
assert:
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove Airsonic
docker_container:
community.docker.docker_container:
name: "{{ airsonic_container_name }}"
state: absent
register: result
- name: Check Airsonic is stopped
assert:
ansible.builtin.assert:
that:
- not result.changed

View file

@ -2,7 +2,7 @@
- name: Start Airsonic
block:
- name: Create Airsonic Directories
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
@ -10,7 +10,7 @@
- "{{ airsonic_data_directory }}/playlists"
- name: Airsonic Docker Container
docker_container:
community.docker.docker_container:
name: "{{ airsonic_container_name }}"
image: airsonic/airsonic:latest
pull: true
@ -35,7 +35,7 @@
- name: Stop Airsonic
block:
- name: Stop Airsonic
docker_container:
community.docker.docker_container:
name: "{{ airsonic_container_name }}"
state: absent
when: airsonic_enabled is false

View file

@ -1,11 +1,12 @@
---
ansible_nas_user: david
# Where you want Docker to store its container data.
# Where you want to store application data - you'll likely want this backed up or on a ZFS zpool.
docker_home: /mnt/Volume2/docker
# Where you want Docker to store images
docker_image_directory: "{{ docker_home }}/data"
# Keep this on a fast disk, ideally an SSD. It doesn't need to be backed up.
docker_image_directory: "/var/lib/docker"
# Docker storage driver, see https://docs.docker.com/storage/storagedriver/select-storage-driver/#supported-backing-filesystems
# You might want to change this to ZFS, depending on your underlying filesystem.

View file

@ -1,45 +1,45 @@
---
- name: Install python3-pip
apt:
ansible.builtin.apt:
name: python3-pip
state: present
register: result
until: result is succeeded
- name: Remove docker-py python module
pip:
ansible.builtin.pip:
name: docker-py
state: absent
register: result
until: result is succeeded
- name: Install docker python module
pip:
ansible.builtin.pip:
name: docker
state: present
register: result
until: result is succeeded
- name: Create Docker home directory
file:
ansible.builtin.file:
path: "{{ docker_home }}"
mode: 0755
state: directory
- name: Add user account to Docker group
user:
ansible.builtin.user:
name: "{{ ansible_nas_user }}"
groups: docker
append: yes
- name: Generate Docker daemon.json
copy:
ansible.builtin.copy:
dest: /etc/docker/daemon.json
content: "{{ docker_daemon_json | to_nice_json }}"
register: docker_config
- name: Restart Docker # noqa no-handler
service:
ansible.builtin.service:
name: docker
state: restarted
when: docker_config.changed

View file

@ -1,18 +1,18 @@
---
- name: Set login banner
copy:
ansible.builtin.copy:
src: motd.txt
dest: /etc/motd
- name: Update apt-cache
apt:
ansible.builtin.apt:
update_cache: yes
cache_valid_time: 3600
register: result
until: result is succeeded
- name: Upgrade all packages # noqa package-latest
apt:
ansible.builtin.apt:
upgrade: yes
state: latest
when: keep_packages_updated
@ -20,24 +20,30 @@
- skip_ansible_lint
- name: Install some packages
apt:
ansible.builtin.apt:
name: "{{ ansible_nas_extra_packages }}"
state: present
register: result
until: result is succeeded
# - name: Configure smartmontools
- name: Install LazyDocker
ansible.builtin.shell:
cmd: curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash
args:
creates: /usr/local/bin/lazydocker
environment:
DIR: /usr/local/bin
- name: "Set hostname to {{ ansible_nas_hostname }}"
hostname:
ansible.builtin.hostname:
name: "{{ ansible_nas_hostname }}"
- name: "Set timezone to {{ ansible_nas_timezone }}"
timezone:
community.general.timezone:
name: "{{ ansible_nas_timezone }}"
- name: "Permission share directories"
file:
ansible.builtin.file:
path: "{{ item.path }}"
state: directory
owner: ansible-nas

View file

@ -1,11 +1,11 @@
---
- name: Create ansible-nas group
group:
ansible.builtin.group:
name: ansible-nas
state: present
- name: Create ansible-nas user
user:
ansible.builtin.user:
name: ansible-nas
state: present
system: yes

View file

@ -4,7 +4,7 @@
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
bazarr_enabled: false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get container state
docker_container_info:
community.docker.docker_container_info:
name: "{{ bazarr_container_name }}"
register: result
- name: Check Bazarr is running
assert:
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove Bazarr
docker_container:
community.docker.docker_container:
name: "{{ bazarr_container_name }}"
state: absent
register: result
- name: Check Bazarr is stopped
assert:
ansible.builtin.assert:
that:
- not result.changed

View file

@ -2,14 +2,14 @@
- name: Start Bazarr
block:
- name: Create Bazarr Directories
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ bazarr_data_directory }}"
- name: Bazarr
docker_container:
community.docker.docker_container:
name: "{{ bazarr_container_name }}"
image: linuxserver/bazarr
pull: true
@ -37,7 +37,7 @@
- name: Stop Bazarr
block:
- name: Stop Bazarr
docker_container:
community.docker.docker_container:
name: "{{ bazarr_container_name }}"
state: absent
when: bazarr_enabled is false

View file

@ -4,7 +4,7 @@
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
bitwarden_enabled: false

View file

@ -3,21 +3,21 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get container state
docker_container_info:
community.docker.docker_container_info:
name: "{{ bitwarden_container_name }}"
register: result
- name: Get container state
docker_container_info:
community.docker.docker_container_info:
name: "{{ bitwarden_backup_container_name }}"
register: result_backup
- name: Check Bitwarden is running
assert:
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -3,23 +3,23 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove Bitwarden
docker_container:
community.docker.docker_container:
name: "{{ bitwarden_container_name }}"
state: absent
register: result
- name: Try and stop and remove Bitwarden Backup
docker_container:
community.docker.docker_container:
name: "{{ bitwarden_backup_container_name }}"
state: absent
register: result_backup
- name: Check Bitwarden is stopped
assert:
ansible.builtin.assert:
that:
- not result.changed
- not result_backup.changed

View file

@ -2,7 +2,7 @@
- name: Start Bitwarden
block:
- name: Create Bitwarden Directories
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: "0755"
@ -10,9 +10,9 @@
- "{{ bitwarden_data_directory }}"
- name: Bitwarden Docker Container
docker_container:
community.docker.docker_container:
name: "{{ bitwarden_container_name }}"
image: bitwardenrs/server:latest
image: vaultwarden/server:latest
pull: true
ports:
- "{{ bitwarden_port_a }}:80"
@ -45,7 +45,7 @@
restart_policy: unless-stopped
- name: Bitwarden Backup Container
docker_container:
community.docker.docker_container:
name: "{{ bitwarden_backup_container_name }}"
image: bruceforce/bw_backup:latest
pull: true
@ -57,12 +57,12 @@
- name: Stop Bitwarden
block:
- name: Stop Bitwarden
docker_container:
community.docker.docker_container:
name: "{{ bitwarden_container_name }}"
state: absent
- name: Stop Bitwarden Backup
docker_container:
community.docker.docker_container:
name: "{{ bitwarden_backup_container_name }}"
state: absent
when: bitwarden_enabled is false

View file

@ -4,7 +4,7 @@
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
booksonic_enabled: false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get container state
docker_container_info:
community.docker.docker_container_info:
name: "{{ booksonic_container_name }}"
register: result
- name: Check Booksonic is running
assert:
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove Booksonic
docker_container:
community.docker.docker_container:
name: "{{ booksonic_container_name }}"
state: absent
register: result
- name: Check Booksonic is stopped
assert:
ansible.builtin.assert:
that:
- not result.changed

View file

@ -2,7 +2,7 @@
- name: Start Booksonic
block:
- name: Create Booksonic Directories
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: 0755
@ -11,7 +11,7 @@
- "{{ booksonic_data_directory }}/playlists"
- name: Booksonic Docker Container
docker_container:
community.docker.docker_container:
name: "{{ booksonic_container_name }}"
image: linuxserver/booksonic-air:latest
pull: true
@ -40,7 +40,7 @@
- name: Stop Booksonic
block:
- name: Stop Booksonic
docker_container:
community.docker.docker_container:
name: "{{ booksonic_container_name }}"
state: absent
when: booksonic_enabled is false

View file

@ -4,7 +4,7 @@
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
calibre_enabled: false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get container state
docker_container_info:
community.docker.docker_container_info:
name: "{{ calibre_container_name }}"
register: result
- name: Check Calibre is running
assert:
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove Calibre
docker_container:
community.docker.docker_container:
name: "{{ calibre_container_name }}"
state: absent
register: result
- name: Check Calibre is stopped
assert:
ansible.builtin.assert:
that:
- not result.changed

View file

@ -2,7 +2,7 @@
- name: Start Calibre
block:
- name: Create Calibre Directories
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: 0755
@ -10,7 +10,7 @@
- "{{ calibre_data_directory }}/data"
- name: Calibre Docker Container
docker_container:
community.docker.docker_container:
name: "{{ calibre_container_name }}"
image: linuxserver/calibre
pull: true
@ -42,7 +42,7 @@
- name: Stop Calibre
block:
- name: Stop Calibre
docker_container:
community.docker.docker_container:
name: "{{ calibre_container_name }}"
state: absent
when: calibre_enabled is false

View file

@ -4,7 +4,7 @@
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
cloudcmd_enabled: false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get container state
docker_container_info:
community.docker.docker_container_info:
name: "{{ cloudcmd_container_name }}"
register: result
- name: Check Cloudcmd is running
assert:
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove Cloudcmd
docker_container:
community.docker.docker_container:
name: "{{ cloudcmd_container_name }}"
state: absent
register: result
- name: Check Cloudcmd is stopped
assert:
ansible.builtin.assert:
that:
- not result.changed

View file

@ -2,14 +2,14 @@
- name: Start Cloudcmd
block:
- name: Create Cloudcmd Directories
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ cloudcmd_data_directory }}"
- name: Create Cloudcmd Docker Container
docker_container:
community.docker.docker_container:
name: "{{ cloudcmd_container_name }}"
image: coderaiser/cloudcmd
pull: true
@ -36,7 +36,7 @@
- name: Stop Cloudcmd
block:
- name: Stop Cloudcmd
docker_container:
community.docker.docker_container:
name: "{{ cloudcmd_container_name }}"
state: absent
when: cloudcmd_enabled is false

View file

@ -4,7 +4,7 @@
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
cloudflare_ddns_enabled: false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get container state
docker_container_info:
community.docker.docker_container_info:
name: "{{ cloudflare_container_name }}"
register: result
- name: Check Cloudflare DDNS is running
assert:
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove Cloudflare DDNS
docker_container:
community.docker.docker_container:
name: "{{ cloudflare_container_name }}"
state: absent
register: result
- name: Check Cloudflare DDNS is stopped
assert:
ansible.builtin.assert:
that:
- not result.changed

View file

@ -2,23 +2,23 @@
- name: Start Cloudflare DDNS
block:
- name: Check for deprecated API key
fail:
ansible.builtin.fail:
msg: "Using a Cloudflare global API key is no longer supported. Please unset cloudflare_api_key and set cloudflare_token"
when: cloudflare_api_key is defined
- name: Create cloudflare Dynamic DNS Directories
file:
ansible.builtin.file:
path: "{{ cloudflare_data_directory }}"
state: directory
- name: Template Cloudflare Dynamic DNS config.yml with scoped token
template:
ansible.builtin.template:
src: config.yml
dest: "{{ cloudflare_data_directory }}/config.yml"
register: template_files_result
- name: Cloudflare Dynamic DNS Container
docker_container:
community.docker.docker_container:
name: "{{ cloudflare_container_name }}"
image: joshava/cloudflare-ddns:latest
pull: true
@ -32,7 +32,7 @@
- name: Stop Cloudflare DDNS
block:
- name: Stop Cloudflare DDNS
docker_container:
community.docker.docker_container:
name: "{{ cloudflare_container_name }}"
state: absent
when: cloudflare_ddns_enabled is false

View file

@ -4,7 +4,7 @@
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
code_server_enabled: false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get container state
docker_container_info:
community.docker.docker_container_info:
name: "{{ code_server_container_name }}"
register: result
- name: Check Code Server is running
assert:
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove Code Server
docker_container:
community.docker.docker_container:
name: "{{ code_server_container_name }}"
state: absent
register: result
- name: Check Code Server is stopped
assert:
ansible.builtin.assert:
that:
- not result.changed

View file

@ -2,7 +2,7 @@
- name: Start Code Server
block:
- name: Code Server Docker Container
docker_container:
community.docker.docker_container:
name: "{{ code_server_container_name }}"
image: linuxserver/code-server
pull: true
@ -30,7 +30,7 @@
- name: Stop Code Server
block:
- name: Stop Code Server
docker_container:
community.docker.docker_container:
name: "{{ code_server_container_name }}"
state: absent
when: code_server_enabled is false

View file

@ -4,7 +4,7 @@
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
couchpotato_enabled: false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get container state
docker_container_info:
community.docker.docker_container_info:
name: "{{ couchpotato_container_name }}"
register: result
- name: Check Couchpotato is running
assert:
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove Couchpotato
docker_container:
community.docker.docker_container:
name: "{{ couchpotato_container_name }}"
state: absent
register: result
- name: Check Couchpotato is stopped
assert:
ansible.builtin.assert:
that:
- not result.changed

View file

@ -2,7 +2,7 @@
- name: Start Couchpotato
block:
- name: Create Couchpotato Directories
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
# mode: 0755
@ -10,7 +10,7 @@
- "{{ docker_home }}/couchpotato/config"
- name: Couchpotato Docker Container
docker_container:
community.docker.docker_container:
name: "{{ couchpotato_container_name }}"
image: linuxserver/couchpotato
pull: true
@ -39,7 +39,7 @@
- name: Stop Couchpotato
block:
- name: Stop Couchpotato
docker_container:
community.docker.docker_container:
name: "{{ couchpotato_container_name }}"
state: absent
when: couchpotato_enabled is false

View file

@ -4,7 +4,7 @@
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
dashy_enabled: false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get container state
docker_container_info:
community.docker.docker_container_info:
name: "{{ dashy_container_name }}"
register: result
- name: Check Dashy is running
assert:
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove Dashy
docker_container:
community.docker.docker_container:
name: "{{ dashy_container_name }}"
state: absent
register: result
- name: Check Dashy is stopped
assert:
ansible.builtin.assert:
that:
- not result.changed

View file

@ -2,7 +2,7 @@
- name: Start Dashy
block:
- name: Dashy Docker Container
docker_container:
community.docker.docker_container:
name: "{{ dashy_container_name }}"
image: lissy93/dashy:latest
pull: true
@ -22,7 +22,7 @@
- name: Stop Dashy
block:
- name: Stop Dashy
docker_container:
community.docker.docker_container:
name: "{{ dashy_container_name }}"
state: absent
when: dashy_enabled is false

View file

@ -0,0 +1,40 @@
---
ddns_updater_enabled: false
ddns_updater_available_externally: "false"
# directories
ddns_updater_data_directory: "{{ docker_home }}/ddns_updater"
# network
ddns_updater_port: 8202
ddns_updater_hostname: "ddns-updater"
# docker
ddns_updater_container_name: ddns_updater
# specs
ddns_updater_memory: 1g
# gotify
# ddns_updater_gotify_token: "token"
# gotify_url: "https://gotify.{{ ansible_nas_domain }}"
# DDNS Updater Config
# Period of IP address check
ddns_updater_period: 5m
# Duration to cooldown between updates for each record. This is useful to avoid being rate limited or banned.
ddns_updater_cooldown_period: 5m
# Timeout for all HTTP requests
ddns_updater_http_timeout: 10s
# ddns_updater_config describes the content of the config.json used to configure the updater.
# see https://github.com/qdm12/ddns-updater#configuration for more info
#
# ddns_updater_config:
# settings:
# - provider: namecheap
# domain: example.com
# host: "@"
# password: e5322165c1d74692bfa6d807100c0310

View file

@ -0,0 +1,54 @@
---
- name: Start DDNS Updater
block:
- name: Create DDNS Updater Directories
ansible.builtin.file:
path: "{{ ddns_updater_data_directory }}"
state: directory
- name: Check config is defined
ansible.builtin.fail:
msg: "Please configure DDNS Updater by setting ddns_updater_config in your inventory nas.yml."
when: ddns_updater_config is not defined
- name: Generate config.json
ansible.builtin.copy:
content: "{{ ddns_updater_config | to_nice_json }}"
dest: "{{ ddns_updater_data_directory }}/config.json"
register: ddns_updater_config
- name: DDNS Updater Container
community.docker.docker_container:
name: "{{ ddns_updater_container_name }}"
image: qmcgaw/ddns-updater:latest
pull: true
ports:
- "{{ ddns_updater_port }}:8000"
volumes:
- "{{ ddns_updater_data_directory }}:/updater/data:rw"
env:
TZ: "{{ ansible_nas_timezone }}"
GOTIFY_TOKEN: "{{ ddns_updater_gotify_token | default('') }}"
GOTIFY_URL: "{{ gotify_url | default('') }}"
PERIOD: "{{ ddns_updater_period }}"
UPDATE_COOLDOWN_PERIOD: "{{ ddns_updater_cooldown_period }}"
HTTP_TIMEOUT: "{{ ddns_updater_http_timeout }}"
restart_policy: unless-stopped
restart: "{{ ddns_updater_config is changed }}"
memory: "{{ ddns_updater_memory }}"
labels:
traefik.enable: "{{ ddns_updater_available_externally }}"
traefik.http.routers.airsonic.rule: "Host(`{{ ddns_updater_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.airsonic.tls.certresolver: "letsencrypt"
traefik.http.routers.airsonic.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.airsonic.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.airsonic.loadbalancer.server.port: "8000"
when: ddns_updater_enabled is true
- name: Stop DDNS Updater
block:
- name: Stop DDNS Updater
community.docker.docker_container:
name: "{{ ddns_updater_container_name }}"
state: absent
when: ddns_updater_enabled is false

View file

@ -4,7 +4,7 @@
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
deluge_enabled: false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get container state
docker_container_info:
community.docker.docker_container_info:
name: "{{ deluge_container_name }}"
register: result
- name: Check Deluge is running
assert:
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove Deluge
docker_container:
community.docker.docker_container:
name: "{{ deluge_container_name }}"
state: absent
register: result
- name: Check Deluge is stopped
assert:
ansible.builtin.assert:
that:
- not result.changed

View file

@ -2,7 +2,7 @@
- name: Start Deluge
block:
- name: Create Deluge Directories
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
@ -10,13 +10,13 @@
- "{{ deluge_download_directory }}"
- name: Deluge Docker Container
docker_container:
community.docker.docker_container:
name: deluge
image: linuxserver/deluge
pull: true
volumes:
- "{{ deluge_config_directory }}:/config:rw"
- "{{ deluge_download_directory }}:/root/Downloads:rw"
- "{{ deluge_download_directory }}:/downloads:rw"
ports:
- "{{ deluge_port }}:8112"
env:
@ -37,7 +37,7 @@
- name: Stop Deluge
block:
- name: Stop Deluge
docker_container:
community.docker.docker_container:
name: "{{ deluge_container_name }}"
state: absent
when: deluge_enabled is false

View file

@ -4,7 +4,7 @@
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
dokuwiki_enabled: false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get container state
docker_container_info:
community.docker.docker_container_info:
name: "{{ dokuwiki_container_name }}"
register: result
- name: Check Dokuwiki is running
assert:
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove Dokuwiki
docker_container:
community.docker.docker_container:
name: "{{ dokuwiki_container_name }}"
state: absent
register: result
- name: Check Dokuwiki is stopped
assert:
ansible.builtin.assert:
that:
- not result.changed

View file

@ -2,14 +2,14 @@
- name: Start Dokuwiki
block:
- name: Create DokuWiki Directories
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ dokuwiki_data_directory }}/data"
- name: DokuWiki Docker Container
docker_container:
community.docker.docker_container:
name: "{{ dokuwiki_container_name }}"
image: linuxserver/dokuwiki:latest
pull: true
@ -35,7 +35,7 @@
- name: Stop Dokuwiki
block:
- name: Stop Dokuwiki
docker_container:
community.docker.docker_container:
name: "{{ dokuwiki_container_name }}"
state: absent
when: dokuwiki_enabled is false

View file

@ -0,0 +1,8 @@
---
- name: Restart gitea
community.docker.docker_container:
name: gitea
image: gitea/gitea:latest
state: started
restart: true
listen: "restart gitea"

View file

@ -8,3 +8,6 @@ provisioner:
drone_ci_gitea_client_secret: asdfasd12341234
gitea_port_http: 3001
ansible_nas_hostname: ansible-nas-ci
gitea_data_directory: "/tmp"
playbooks:
prepare: prepare.yml

View file

@ -0,0 +1,20 @@
---
- name: Prepare
hosts: all
tasks:
- name: Install docker python module
ansible.builtin.pip:
name: docker
- name: Create a dummy gitea config directory
ansible.builtin.file:
path: "{{ item }}"
state: directory
recurse: yes
with_items:
- "{{ gitea_data_directory }}/gitea/gitea/conf"
- name: Create a dummy gitea config file
ansible.builtin.file:
path: "{{ gitea_data_directory }}/gitea/gitea/conf/app.ini"
state: touch

View file

@ -4,7 +4,7 @@
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
drone_ci_enabled: false

View file

@ -3,22 +3,22 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get container state
docker_container_info:
community.docker.docker_container_info:
name: "{{ drone_ci_container_name }}"
register: result
- name: Get container state
docker_container_info:
community.docker.docker_container_info:
name: "{{ drone_ci_runner_container_name }}"
register: result_runner
- name: Check Drone CI is running
assert:
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -3,23 +3,23 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove Drone CI
docker_container:
community.docker.docker_container:
name: "{{ drone_ci_container_name }}"
state: absent
register: result
- name: Try and stop and remove Drone CI runner
docker_container:
community.docker.docker_container:
name: "{{ drone_ci_runner_container_name }}"
state: absent
register: result_runner
- name: Check Drone CI is stopped
assert:
ansible.builtin.assert:
that:
- not result.changed
- not result_runner.changed

View file

@ -2,24 +2,24 @@
- name: Start Drone-CI
block:
- name: Check for Gitea installation
fail:
ansible.builtin.fail:
msg: "Drone-CI requires Gitea enabled and running for authentication, please set that up first."
when: gitea_enabled is false
- name: Check for Gitea config
fail:
ansible.builtin.fail:
msg: "Missing Gitea Oauth2 config! Read https://docs.drone.io/server/provider/gitea/ and set drone_ci_gitea_client_id and drone_ci_gitea_client_secret."
when: drone_ci_gitea_client_id == "notset"
- name: Create Drone-CI Directories
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ drone_ci_data_directory }}"
- name: Create Drone-CI container
docker_container:
community.docker.docker_container:
name: "{{ drone_ci_container_name }}"
image: drone/drone:2
pull: true
@ -47,7 +47,7 @@
traefik.http.services.drone_ci.loadbalancer.server.port: "80"
- name: Create Drone-CI Runner container
docker_container:
community.docker.docker_container:
name: "{{ drone_ci_runner_container_name }}"
image: drone/drone-runner-docker:1
pull: true
@ -65,7 +65,7 @@
memory: "{{ drone_ci_agent_memory }}"
- name: Add webhook allowed hosts to Gitea
blockinfile:
ansible.builtin.blockinfile:
path: "{{ gitea_data_directory }}/gitea/gitea/conf/app.ini"
block: |
[webhook]
@ -77,12 +77,12 @@
- name: Stop Drone-CI
block:
- name: Stop Drone-CI
docker_container:
community.docker.docker_container:
name: "{{ drone_ci_container_name }}"
state: absent
- name: Stop Drone-CI Runner
docker_container:
community.docker.docker_container:
name: "{{ drone_ci_runner_container_name }}"
state: absent
when: drone_ci_enabled is false

View file

@ -4,7 +4,7 @@
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
duplicacy_enabled: false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get container state
docker_container_info:
community.docker.docker_container_info:
name: "{{ duplicacy_container_name }}"
register: result
- name: Check Duplicacy is running
assert:
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove Duplicacy
docker_container:
community.docker.docker_container:
name: "{{ duplicacy_container_name }}"
state: absent
register: result
- name: Check Duplicacy is stopped
assert:
ansible.builtin.assert:
that:
- not result.changed

View file

@ -2,7 +2,7 @@
- name: Start Duplicacy
block:
- name: Create Duplicacy Directories
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
@ -11,7 +11,7 @@
- "{{ duplicacy_cache_directory }}"
- name: Duplicacy Docker Container
docker_container:
community.docker.docker_container:
name: "{{ duplicacy_container_name }}"
image: saspus/duplicacy-web:mini
hostname: "{{ duplicacy_hostname }}"
@ -42,7 +42,7 @@
- name: Stop Duplicacy
block:
- name: Stop Duplicacy
docker_container:
community.docker.docker_container:
name: "{{ duplicacy_container_name }}"
state: absent
when: duplicacy_enabled is false

View file

@ -2,14 +2,14 @@
- name: Start Duplicati
block:
- name: Create Duplicati Directory
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ duplicati_data_directory }}"
- name: Dupicati Docker Container
docker_container:
community.docker.docker_container:
name: "{{ duplicati_container_name }}"
image: linuxserver/duplicati
pull: true
@ -38,7 +38,7 @@
- name: Stop Duplicati
block:
- name: Stop Duplicati
docker_container:
community.docker.docker_container:
name: "{{ duplicati_container_name }}"
state: absent
when: duplicati_enabled is false

View file

@ -4,7 +4,7 @@
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
emby_enabled: false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get container state
docker_container_info:
community.docker.docker_container_info:
name: "{{ emby_container_name }}"
register: result
- name: Check Emby is running
assert:
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove Emby
docker_container:
community.docker.docker_container:
name: "{{ emby_container_name }}"
state: absent
register: result
- name: Check Emby is stopped
assert:
ansible.builtin.assert:
that:
- not result.changed

View file

@ -2,14 +2,14 @@
- name: Start Emby
block:
- name: Create Emby Directories
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ emby_config_directory }}"
- name: Emby Docker Container
docker_container:
community.docker.docker_container:
name: "{{ emby_container_name }}"
image: emby/embyserver
pull: true
@ -38,7 +38,7 @@
- name: Stop Emby
block:
- name: Stop Emby
docker_container:
community.docker.docker_container:
name: "{{ emby_container_name }}"
state: absent
when: emby_enabled is false

View file

@ -4,7 +4,7 @@
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
esphome_enabled: false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get container state
docker_container_info:
community.docker.docker_container_info:
name: "{{ esphome_container_name }}"
register: result
- name: Check EspHome is running
assert:
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -3,16 +3,16 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove EspHome
docker_container:
community.docker.docker_container:
name: "{{ esphome_container_name }}"
state: absent
register: result
- name: Check EspHome is stopped
assert:
ansible.builtin.assert:
that:
- not result.changed

View file

@ -2,14 +2,14 @@
- name: Start EspHome
block:
- name: Create EspHome Directories
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ esphome_data_directory }}/data"
- name: EspHome Docker Container
docker_container:
community.docker.docker_container:
name: "{{ esphome_container_name }}"
image: esphome/esphome:latest
pull: true
@ -36,7 +36,7 @@
- name: Stop EspHome
block:
- name: Stop EspHome
docker_container:
community.docker.docker_container:
name: "{{ esphome_container_name }}"
state: absent
when: esphome_enabled is false

View file

@ -4,7 +4,7 @@
become: true
tasks:
- name: "Include {{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }} role"
include_role:
ansible.builtin.include_role:
name: "{{ lookup('env', 'MOLECULE_PROJECT_DIRECTORY') | basename }}"
vars:
firefly_enabled: false

View file

@ -3,21 +3,21 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Get container state
docker_container_info:
community.docker.docker_container_info:
name: "{{ firefly_container_name }}"
register: result
- name: Get container state
docker_container_info:
community.docker.docker_container_info:
name: "{{ firefly_mysql_container_name }}"
register: result_mysql
- name: Check Firefly is running
assert:
ansible.builtin.assert:
that:
- result.container['State']['Status'] == "running"
- result.container['State']['Restarting'] == false

View file

@ -3,23 +3,23 @@
hosts: all
gather_facts: false
tasks:
- include_vars:
- ansible.builtin.include_vars:
file: ../../defaults/main.yml
- name: Try and stop and remove Firefly
docker_container:
community.docker.docker_container:
name: "{{ firefly_container_name }}"
state: absent
register: result
- name: Try and stop and remove Firefly MySql
docker_container:
community.docker.docker_container:
name: "{{ firefly_mysql_container_name }}"
state: absent
register: result_mysql
- name: Check Firefly is stopped
assert:
ansible.builtin.assert:
that:
- not result.changed
- not result_mysql.changed

View file

@ -2,7 +2,7 @@
- name: Start Firefly
block:
- name: Create Firefly III Directories
file:
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
@ -11,7 +11,7 @@
- "{{ firefly_data_directory }}/export"
- name: Create MySQL container for Firefly
docker_container:
community.docker.docker_container:
name: "{{ firefly_mysql_container_name }}"
image: mariadb:10.9
pull: true
@ -26,11 +26,11 @@
memory: "{{ firefly_mysql_memory }}"
- name: Wait for MySQL to init
pause:
ansible.builtin.pause:
seconds: 30
- name: Create Firefly III container
docker_container:
community.docker.docker_container:
name: "{{ firefly_container_name }}"
image: fireflyiii/core:latest
pull: true
@ -42,6 +42,8 @@
ports:
- "{{ firefly_port }}:8080"
env:
APP_URL: "https://{{ firefly_hostname }}.{{ ansible_nas_domain }}"
TRUSTED_PROXIES: "**"
APP_ENV: "local"
APP_KEY: "S0m3R@nd0mString0f32Ch@rsEx@ct1y"
DB_CONNECTION: "mysql"
@ -64,12 +66,12 @@
- name: Stop Firefly
block:
- name: Stop Firefly
docker_container:
community.docker.docker_container:
name: "{{ firefly_container_name }}"
state: absent
- name: Stop Firefly MySQL
docker_container:
community.docker.docker_container:
name: "{{ firefly_mysql_container_name }}"
state: absent
when: firefly_enabled is false

View file

@ -10,5 +10,10 @@ freshrss_extensions_directory: "{{ docker_home }}/freshrss"
freshrss_port: "8089"
freshrss_hostname: "freshrss"
# docker
freshrss_container_name: freshrss
freshrss_image_name: "freshrss/freshrss"
freshrss_image_version: latest
# specs
freshrss_memory: 1g

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
freshrss_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:
freshrss_enabled: false

View file

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

View file

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

View file

@ -1,32 +1,42 @@
---
- name: Create FreshRSS Directories
file:
path: "{{ item }}"
state: directory
# mode: 0755
with_items:
- "{{ freshrss_data_directory }}/data"
- "{{ freshrss_extensions_directory }}/extensions"
- name: Start FreshRSS
block:
- name: Create FreshRSS Directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
with_items:
- "{{ freshrss_data_directory }}/data"
- "{{ freshrss_extensions_directory }}/extensions"
- name: FreshRSS Docker Container
docker_container:
name: freshrss
image: freshrss/freshrss
pull: true
volumes:
- "{{ freshrss_data_directory }}/data:/var/www/FreshRSS/data:rw"
- "{{ freshrss_extensions_directory }}/extensions:/var/www/FreshRSS/extensions:rw"
ports:
- "{{ freshrss_port }}:80"
env:
TZ: "{{ ansible_nas_timezone }}"
CRON_MIN: "1,31"
restart_policy: unless-stopped
memory: "{{ freshrss_memory }}"
labels:
traefik.enable: "{{ freshrss_available_externally | string }}"
traefik.http.routers.freshrss.rule: "Host(`{{ freshrss_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.freshrss.tls.certresolver: "letsencrypt"
traefik.http.routers.freshrss.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.freshrss.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.freshrss.loadbalancer.server.port: "80"
- name: FreshRSS Docker Container
community.docker.docker_container:
name: "{{ freshrss_container_name }}"
image: "{{ freshrss_image_name }}:{{ freshrss_image_version }}"
pull: true
volumes:
- "{{ freshrss_data_directory }}/data:/var/www/FreshRSS/data:rw"
- "{{ freshrss_extensions_directory }}/extensions:/var/www/FreshRSS/extensions:rw"
ports:
- "{{ freshrss_port }}:80"
env:
TZ: "{{ ansible_nas_timezone }}"
CRON_MIN: "1,31"
restart_policy: unless-stopped
memory: "{{ freshrss_memory }}"
labels:
traefik.enable: "{{ freshrss_available_externally | string }}"
traefik.http.routers.freshrss.rule: "Host(`{{ freshrss_hostname }}.{{ ansible_nas_domain }}`)"
traefik.http.routers.freshrss.tls.certresolver: "letsencrypt"
traefik.http.routers.freshrss.tls.domains[0].main: "{{ ansible_nas_domain }}"
traefik.http.routers.freshrss.tls.domains[0].sans: "*.{{ ansible_nas_domain }}"
traefik.http.services.freshrss.loadbalancer.server.port: "80"
when: freshrss_enabled is true
- name: Stop FreshRSS
block:
- name: Stop FreshRSS
community.docker.docker_container:
name: "{{ freshrss_container_name }}"
state: absent
when: freshrss_enabled is false

View file

@ -8,5 +8,10 @@ get_iplayer_download_directory: "{{ tv_root }}/iplayer_downloads"
# network
get_iplayer_port: "8182"
# docker
get_iplayer_container_name: "get_iplayer"
get_iplayer_image_name: "kolonuk/get_iplayer"
get_iplayer_image_version: "latest"
# specs
get_iplayer_memory: "1g"

View file

@ -0,0 +1,6 @@
---
provisioner:
inventory:
group_vars:
all:
get_iplayer_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:
get_iplayer_enabled: false

View file

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

View file

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

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