Commit 52eeb6c8 authored by Nick Busey's avatar Nick Busey

Closes #81 - Templating service files

parent 12ccd9bf
Pipeline #47920125 passed with stages
in 32 seconds
......@@ -44,6 +44,7 @@ If you have the latest version of Vagrant and Virtual Box setup you can demo thi
## Available Software
* [Aironic](https://airsonic.github.io/) - Airsonic is a free, web-based media streamer, providing ubiquitous access to your music.
* [Bitwarden](https://bitwarden.com/) - Password and secrets manager via [bitwarden-rs](https://github.com/dani-garcia/bitwarden_rs)
* [BookStack](https://www.bookstackapp.com/) - Simple & Free Wiki Software
* [BulletNotes](https://gitlab.com/NickBusey/BulletNotes.git) - Note taking application
......
# airsonic
[Airsonic](https://airsonic.github.io/) is a free, web-based media streamer, providing ubiquitous access to your music.
## Access
It is available at [https://airsonic.{{ domain }}/](https://airsonic.{{ domain }}/) or [http://airsonic.{{ domain }}/](http://airsonic.{{ domain }}/)
{% if enable_tor %}
It is also available via Tor at [http://airsonic.{{ tor_domain }}/](http://airsonic.{{ tor_domain }}/)
{% endif %}
......@@ -10,6 +10,7 @@ enable_tor: False
https_only: false
enable_apple_health_influx: False
enable_airsonic: False
enable_bitwarden: False
enable_bookstack: False
enable_bulletnotes: False
......@@ -52,7 +53,9 @@ enable_xfinityusageinfluxdb: False
enabled_services:
tinc: "{{ enable_tinc }}"
tor: "{{ enable_tor }}"
apple_health_influx: "{{ enable_apple_health_influx }}"
airsonic: "{{ enable_airsonic }}"
bitwarden: "{{ enable_bitwarden }}"
bookstack: "{{ enable_bookstack }}"
bulletnotes: "{{ enable_bulletnotes }}"
......@@ -140,6 +143,7 @@ ldap_org_name: My Family
# Service List
services:
- airsonic
- bitwarden
- bookstack
- bulletnotes
......
......@@ -20,6 +20,7 @@ pages:
- Tor Onion Services: setup/tor.md
- VPN Setup: setup/vpn.md
- Included Software:
- Airsonic: software/airsonic.md
- Apple Health: software/applehealth.md
- Bitwarden: software/bitwarden.md
- BulletNotes: software/bulletnotes.md
......
---
- name: Make airsonic directory.
file:
path: "/var/homelabos/airsonic"
state: directory
- name: Copy airsonic docker-compose.yml file into place.
template:
src: docker-compose.airsonic.yml.j2
dest: /var/homelabos/airsonic/docker-compose.airsonic.yml
vars:
tor_domain: "{{ tor_http_domain_file.stdout if tor_http_domain is defined else '' }}"
- name: Configure airsonic systemd service.
template: src=service.j2 dest=/etc/systemd/system/airsonic.service
- name: Start airsonic
systemd:
name: airsonic
enabled: "yes"
daemon-reload: "yes"
state: started
...
---
version: '3'
networks:
traefik_network:
external:
name: homelabos_traefik
services:
# Password Manager
airsonic_web:
image: airsonic/airsonic
restart: unless-stopped
networks:
- traefik_network
volumes:
- /var/homelabos/airsonic/data:/airsonic/data
- /mnt/nas/Music:/airsonic/music
- /var/homelabos/airsonic/playlists:/airsonic/playlists
- /var/homelabos/airsonic/podcasts:/airsonic/podcasts
labels:
- "traefik.enable=true"
- "traefik.docker.network=homelabos_traefik"
- "traefik.http.frontend.rule=Host:airsonic.{{ domain }}"
- "traefik.http.protocol=http"
- "traefik.http.port=4040"
- "traefik.http.frontend.headers.customFrameOptionsValue=ALLOW-FROM http://{{ domain }}"
- "traefik.http.frontend.headers.customFrameOptionsValue=ALLOW-FROM https://{{ domain }}"
- "traefik.tor.frontend.rule=Host:airsonic.{{ tor_domain }}"
- "traefik.tor.protocol=http"
- "traefik.tor.port=4040"
......@@ -12,7 +12,7 @@
tor_domain: "{{ tor_http_domain_file.stdout if tor_http_domain is defined else '' }}"
- name: Configure bitwarden systemd service.
template: src=bitwarden.service dest=/etc/systemd/system/bitwarden.service
template: src=service.j2 dest=/etc/systemd/system/bitwarden.service
- name: Start bitwarden
systemd:
......
[Unit]
Description=HomelabOS bitwarden Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStart=/usr/bin/docker-compose -f /var/homelabos/bitwarden/docker-compose.bitwarden.yml -p bitwarden up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/bitwarden/docker-compose.bitwarden.yml -p bitwarden stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -12,7 +12,7 @@
tor_domain: "{{ tor_http_domain_file.stdout if tor_http_domain is defined else '' }}"
- name: Configure bookstack systemd service.
template: src=bookstack.service dest=/etc/systemd/system/bookstack.service
template: src=service.j2 dest=/etc/systemd/system/bookstack.service
- name: Start bookstack
systemd:
......
[Unit]
Description=HomelabOS bookstack Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/bookstack/docker-compose.bookstack.yml -p bookstack down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/bookstack/docker-compose.bookstack.yml -p bookstack up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/bookstack/docker-compose.bookstack.yml -p bookstack stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -12,7 +12,7 @@
tor_domain: "{{ tor_http_domain_file.stdout if tor_http_domain is defined else '' }}"
- name: Configure bulletnotes systemd service.
template: src=bulletnotes.service dest=/etc/systemd/system/bulletnotes.service
template: src=service.j2 dest=/etc/systemd/system/bulletnotes.service
- name: Start bulletnotes
systemd:
......
[Unit]
Description=HomelabOS bulletnotes Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/bulletnotes/docker-compose.bulletnotes.yml -p bulletnotes down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/bulletnotes/docker-compose.bulletnotes.yml -p bulletnotes up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/bulletnotes/docker-compose.bulletnotes.yml -p bulletnotes stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -16,7 +16,7 @@
tor_domain: "{{ tor_http_domain_file.stdout if tor_http_domain is defined else '' }}"
- name: Configure dasher systemd service.
template: src=dasher.service dest=/etc/systemd/system/dasher.service
template: src=service.j2 dest=/etc/systemd/system/dasher.service
- name: Start dasher
systemd:
......
[Unit]
Description=HomelabOS dasher Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/dasher/docker-compose.dasher.yml -p dasher down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/dasher/docker-compose.dasher.yml -p dasher up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/dasher/docker-compose.dasher.yml -p dasher stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -68,7 +68,7 @@
tor_domain: "{{ tor_http_domain_file.stdout if tor_http_domain is defined else '' }}"
- name: Configure HomelabOS systemd service.
template: src=docs.service dest=/etc/systemd/system/docs.service
template: src=service.j2 dest=/etc/systemd/system/docs.service
- name: Start HomelabOS Docs
systemd:
......
[Unit]
Description=HomelabOS Documentation Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStart=/usr/bin/docker-compose -f /var/homelabos/docs/docker-compose.docs.yml -p docs up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/docs/docker-compose.docs.yml -p docs stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -12,7 +12,7 @@
tor_domain: "{{ tor_http_domain_file.stdout if tor_http_domain is defined else '' }}"
- name: Configure emby systemd service.
template: src=emby.service dest=/etc/systemd/system/emby.service
template: src=service.j2 dest=/etc/systemd/system/emby.service
- name: Start emby
systemd:
......
......@@ -12,7 +12,7 @@
tor_domain: "{{ tor_http_domain_file.stdout if tor_http_domain is defined else '' }}"
- name: Configure firefly_iii systemd service.
template: src=firefly_iii.service dest=/etc/systemd/system/firefly_iii.service
template: src=service.j2 dest=/etc/systemd/system/firefly_iii.service
- name: Start firefly_iii
systemd:
......
[Unit]
Description=HomelabOS firefly_iii Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStart=/usr/bin/docker-compose -f /var/homelabos/firefly_iii/docker-compose.firefly_iii.yml -p firefly_iii up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/firefly_iii/docker-compose.firefly_iii.yml -p firefly_iii stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -12,7 +12,7 @@
tor_domain: "{{ tor_http_domain_file.stdout if tor_http_domain is defined else '' }}"
- name: Configure gitea systemd service.
template: src=gitea.service dest=/etc/systemd/system/gitea.service
template: src=service.j2 dest=/etc/systemd/system/gitea.service
- name: Start gitea
systemd:
......
[Unit]
Description=HomelabOS gitea Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/gitea/docker-compose.gitea.yml -p gitea down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/gitea/docker-compose.gitea.yml -p gitea up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/gitea/docker-compose.gitea.yml -p gitea stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -27,7 +27,7 @@
- grafana.dash.homelab.json
- name: Configure grafana systemd service.
template: src=grafana.service dest=/etc/systemd/system/grafana.service
template: src=service.j2 dest=/etc/systemd/system/grafana.service
- name: Start grafana
systemd:
......
[Unit]
Description=HomelabOS grafana Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/grafana/docker-compose.grafana.yml -p grafana down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/grafana/docker-compose.grafana.yml -p grafana up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/grafana/docker-compose.grafana.yml -p grafana stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -12,7 +12,7 @@
tor_domain: "{{ tor_http_domain_file.stdout if tor_http_domain is defined else '' }}"
- name: Configure homeassistant systemd service.
template: src=homeassistant.service dest=/etc/systemd/system/homeassistant.service
template: src=service.j2 dest=/etc/systemd/system/homeassistant.service
- name: Start homeassistant
systemd:
......
[Unit]
Description=HomelabOS homeassistant Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/homeassistant/docker-compose.homeassistant.yml -p homeassistant down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/homeassistant/docker-compose.homeassistant.yml -p homeassistant up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/homeassistant/docker-compose.homeassistant.yml -p homeassistant stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -12,7 +12,7 @@
tor_domain: "{{ tor_http_domain_file.stdout if tor_http_domain is defined else '' }}"
- name: Configure homedash systemd service.
template: src=homedash.service dest=/etc/systemd/system/homedash.service
template: src=service.j2 dest=/etc/systemd/system/homedash.service
- name: Start homedash
systemd:
......
[Unit]
Description=HomelabOS homedash Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/homedash/docker-compose.homedash.yml -p homedash down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/homedash/docker-compose.homedash.yml -p homedash up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/homedash/docker-compose.homedash.yml -p homedash stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
[Unit]
Description=HomelabOS {{ service_item }} Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStart=/usr/bin/docker-compose -f /var/homelabos/{{ service_item }}/docker-compose.{{ service_item }}.yml -p {{ service_item }} up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/{{ service_item }}/docker-compose.{{ service_item }}.yml -p {{ service_item }} stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -46,6 +46,7 @@ enable_docs: {{enable_docs}}
# You can enable/disable services individually by changing False to True and vice versa.
enable_apple_health_influx: {{enable_apple_health_influx}}
enable_airsonic: {{enable_airsonic}}
enable_bitwarden: {{enable_bitwarden}}
enable_bookstack: {{enable_bookstack}}
enable_bulletnotes: {{enable_bulletnotes}}
......
......@@ -12,7 +12,7 @@
tor_domain: "{{ tor_http_domain_file.stdout if tor_http_domain is defined else '' }}"
- name: Configure inventario systemd service.
template: src=inventario.service dest=/etc/systemd/system/inventario.service
template: src=service.j2 dest=/etc/systemd/system/inventario.service
- name: Start inventario
systemd:
......
[Unit]
Description=HomelabOS inventario Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/inventario/docker-compose.inventario.yml -p inventario down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/inventario/docker-compose.inventario.yml -p inventario up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/inventario/docker-compose.inventario.yml -p inventario stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -12,7 +12,7 @@
tor_domain: "{{ tor_http_domain_file.stdout if tor_http_domain is defined else '' }}"
- name: Configure jackett systemd service.
template: src=jackett.service dest=/etc/systemd/system/jackett.service
template: src=service.j2 dest=/etc/systemd/system/jackett.service
- name: Start jackett
systemd:
......
[Unit]
Description=HomelabOS jackett Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/jackett/docker-compose.jackett.yml -p jackett down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/jackett/docker-compose.jackett.yml -p jackett up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/jackett/docker-compose.jackett.yml -p jackett stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -12,7 +12,7 @@
tor_domain: "{{ tor_http_domain_file.stdout if tor_http_domain is defined else '' }}"
- name: Configure jellyfin systemd service.
template: src=jellyfin.service dest=/etc/systemd/system/jellyfin.service
template: src=service.j2 dest=/etc/systemd/system/jellyfin.service
- name: Start jellyfin
systemd:
......
[Unit]
Description=HomelabOS jellyfin Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/jellyfin/docker-compose.jellyfin.yml -p jellyfin down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/jellyfin/docker-compose.jellyfin.yml -p jellyfin up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/jellyfin/docker-compose.jellyfin.yml -p jellyfin stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -12,7 +12,7 @@
tor_domain: "{{ tor_http_domain_file.stdout if tor_http_domain is defined else '' }}"
- name: Configure kibitzr systemd service.
template: src=kibitzr.service dest=/etc/systemd/system/kibitzr.service
template: src=service.j2 dest=/etc/systemd/system/kibitzr.service
- name: Start kibitzr
systemd:
......
[Unit]
Description=HomelabOS kibitzr Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/kibitzr/docker-compose.kibitzr.yml -p kibitzr down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/kibitzr/docker-compose.kibitzr.yml -p kibitzr up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/kibitzr/docker-compose.kibitzr.yml -p kibitzr stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -12,7 +12,7 @@
tor_domain: "{{ tor_http_domain_file.stdout if tor_http_domain is defined else '' }}"
- name: Configure mashio systemd service.
template: src=mashio.service dest=/etc/systemd/system/mashio.service
template: src=service.j2 dest=/etc/systemd/system/mashio.service
- name: Start mashio
systemd:
......
[Unit]
Description=HomelabOS mashio Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/mashio/docker-compose.mashio.yml -p mashio down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/mashio/docker-compose.mashio.yml -p mashio up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/mashio/docker-compose.mashio.yml -p mashio stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -12,7 +12,7 @@
tor_domain: "{{ tor_http_domain_file.stdout if tor_http_domain is defined else '' }}"
- name: Configure matomo systemd service.
template: src=matomo.service dest=/etc/systemd/system/matomo.service
template: src=service.j2 dest=/etc/systemd/system/matomo.service
- name: Start matomo
systemd:
......
[Unit]
Description=HomelabOS matomo Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/matomo/docker-compose.matomo.yml -p matomo down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/matomo/docker-compose.matomo.yml -p matomo up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/matomo/docker-compose.matomo.yml -p matomo stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -12,7 +12,7 @@
tor_domain: "{{ tor_http_domain_file.stdout if tor_http_domain is defined else '' }}"
- name: Configure miniflux systemd service.
template: src=miniflux.service dest=/etc/systemd/system/miniflux.service
template: src=service.j2 dest=/etc/systemd/system/miniflux.service
- name: Start miniflux
systemd:
......
[Unit]
Description=HomelabOS miniflux Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/miniflux/docker-compose.miniflux.yml -p miniflux down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/miniflux/docker-compose.miniflux.yml -p miniflux up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/miniflux/docker-compose.miniflux.yml -p miniflux stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -12,7 +12,7 @@
tor_domain: "{{ tor_http_domain_file.stdout if tor_http_domain is defined else '' }}"
- name: Configure minio systemd service.
template: src=minio.service dest=/etc/systemd/system/minio.service
template: src=service.j2 dest=/etc/systemd/system/minio.service
- name: Start minio
systemd:
......
[Unit]
Description=HomelabOS minio Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/minio/docker-compose.minio.yml -p minio down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/minio/docker-compose.minio.yml -p minio up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/minio/docker-compose.minio.yml -p minio stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -17,7 +17,7 @@
dest: /var/homelabos/monicahq/monicahq.env
- name: Configure monicahq systemd service.
template: src=monicahq.service dest=/etc/systemd/system/monicahq.service
template: src=service.j2 dest=/etc/systemd/system/monicahq.service
- name: Start monicahq
systemd:
......
[Unit]
Description=HomelabOS monicahq Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/monicahq/docker-compose.monicahq.yml -p monicahq down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/monicahq/docker-compose.monicahq.yml -p monicahq up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/monicahq/docker-compose.monicahq.yml -p monicahq stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file
......@@ -12,7 +12,7 @@
tor_domain: "{{ tor_http_domain_file.stdout if tor_http_domain is defined else '' }}"
- name: Configure nextcloud systemd service.
template: src=nextcloud.service dest=/etc/systemd/system/nextcloud.service
template: src=service.j2 dest=/etc/systemd/system/nextcloud.service
- name: Start nextcloud
systemd:
......
[Unit]
Description=HomelabOS nextcloud Service
After=docker.service
Requires=docker.service
[Service]
TimeoutSec=infinity
Restart=always
RestartSec=3
ExecStartPre=/usr/bin/docker-compose -f /var/homelabos/nextcloud/docker-compose.nextcloud.yml -p nextcloud down
ExecStart=/usr/bin/docker-compose -f /var/homelabos/nextcloud/docker-compose.nextcloud.yml -p nextcloud up
ExecStop=/usr/bin/docker-compose -f /var/homelabos/nextcloud/docker-compose.nextcloud.yml -p nextcloud stop
[Install]
WantedBy=multi-user.target
\ No newline at end of file