untested: localsevices
This commit is contained in:
parent
fcc8cf57e0
commit
f656f415bd
23
defaults/main.yml
Normal file
23
defaults/main.yml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
path: /srv/{{ role_name }}
|
||||||
|
|
||||||
|
localservices_override: {}
|
||||||
|
localservices_defaults:
|
||||||
|
networkmount:
|
||||||
|
path: ""
|
||||||
|
host: ""
|
||||||
|
host_path: ""
|
||||||
|
args: ""
|
||||||
|
|
||||||
|
wg_client:
|
||||||
|
enabled: false
|
||||||
|
wg_conf: ""
|
||||||
|
aniworld:
|
||||||
|
url: ""
|
||||||
|
data_path: ""
|
||||||
|
bittorrent:
|
||||||
|
url: ""
|
||||||
|
data_path: ""
|
||||||
|
i2psnark:
|
||||||
|
url: ""
|
||||||
|
i2pc_host: ""
|
||||||
|
data_path: ""
|
||||||
9
handlers/main.yml
Normal file
9
handlers/main.yml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
- name: restart container
|
||||||
|
community.docker.docker_compose_v2:
|
||||||
|
project_src: "{{ path }}"
|
||||||
|
project_name: "{{ role_name }}"
|
||||||
|
recreate: "always"
|
||||||
|
services: ["localservices"]
|
||||||
|
state: "restarted"
|
||||||
|
when: not _localservices_already_restarted
|
||||||
|
|
||||||
20
meta/main.yml
Normal file
20
meta/main.yml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
galaxy_info:
|
||||||
|
author: "Niklas Freese <niklas@urmel.de>"
|
||||||
|
description: localservices
|
||||||
|
company: "Urmel Services"
|
||||||
|
license: AGPL-3.0-or-later
|
||||||
|
min_ansible_version: 2.1
|
||||||
|
# If this a Container Enabled role, provide the minimum Ansible Container version.
|
||||||
|
# min_ansible_container_version:
|
||||||
|
|
||||||
|
galaxy_tags: []
|
||||||
|
# List tags for your role here, one per line. A tag is a keyword that describes
|
||||||
|
# and categorizes the role. Users find roles by searching for tags. Be sure to
|
||||||
|
# remove the '[]' above, if you add tags to this list.
|
||||||
|
#
|
||||||
|
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
|
||||||
|
# Maximum 20 tags per role.
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
- role: traefik
|
||||||
32
tasks/main.yml
Normal file
32
tasks/main.yml
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
- name: "set local variables from overrides and defaults"
|
||||||
|
set_fact:
|
||||||
|
localservices: "{{ (localservices_defaults | combine(localservices_override, recursive=True)) if localservices_override else localservices_defaults }}"
|
||||||
|
|
||||||
|
- name: ensure that path exists
|
||||||
|
file:
|
||||||
|
path: "{{ path }}/config/localservices"
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- import_role:
|
||||||
|
name: storage_mount
|
||||||
|
vars:
|
||||||
|
storage_mount_override:
|
||||||
|
host: "{{ localservices.networkmount.host }}"
|
||||||
|
host_path: "{{ localservices.networkmount.host_path }}"
|
||||||
|
args: "{{ localservices.networkmount.args }}"
|
||||||
|
type: "{{ localservices.networkmount.type }}"
|
||||||
|
dest_path: "{{ localservices.localservices.path }}"
|
||||||
|
when: localservices.networkmount.host | length > 1
|
||||||
|
|
||||||
|
- name: template docker compose
|
||||||
|
template:
|
||||||
|
src: "compose.yml.j2"
|
||||||
|
dest: "{{ path }}/compose.yml"
|
||||||
|
|
||||||
|
- name: ensure everything is up
|
||||||
|
community.docker.docker_compose_v2:
|
||||||
|
project_src: "{{ path }}"
|
||||||
|
project_name: "{{ role_name }}"
|
||||||
|
recreate: always
|
||||||
|
state: "present"
|
||||||
@ -1,10 +1,5 @@
|
|||||||
version: "3.8"
|
|
||||||
|
|
||||||
configs:
|
|
||||||
wg0_conf:
|
|
||||||
file: ./aniworld/wg0.conf
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
{% if localservices.wg_client.enabled %}
|
||||||
wireguard:
|
wireguard:
|
||||||
image: linuxserver/wireguard
|
image: linuxserver/wireguard
|
||||||
cap_add:
|
cap_add:
|
||||||
@ -17,37 +12,41 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
sysctls:
|
sysctls:
|
||||||
- net.ipv4.conf.all.src_valid_mark=1
|
- net.ipv4.conf.all.src_valid_mark=1
|
||||||
configs:
|
volumes:
|
||||||
- source: wg0_conf
|
- ./config/wg0_conf:/config/wg0.conf
|
||||||
target: /config/wg0.conf
|
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
labels:
|
labels:
|
||||||
traefik.enable: true
|
traefik.enable: true
|
||||||
|
{% if localservices.aniworld.url | length > 0 %}
|
||||||
traefik.http.routers.aniworld.service: aniworld
|
traefik.http.routers.aniworld.service: aniworld
|
||||||
traefik.http.routers.aniworld.rule: Host(`aniworld.arpa.urmel.de`)
|
traefik.http.routers.aniworld.rule: Host(`{{ localservices.aniworld.url }}`)
|
||||||
traefik.http.routers.aniworld.tls: "true"
|
traefik.http.routers.aniworld.tls: "true"
|
||||||
traefik.http.routers.aniworld.tls.certresolver: hetzner
|
traefik.http.routers.aniworld.tls.certresolver: hetzner
|
||||||
traefik.http.services.aniworld.loadbalancer.server.port: 8080
|
traefik.http.services.aniworld.loadbalancer.server.port: 8080
|
||||||
traefik.http.routers.aniworld.middlewares: local-only@file, traefik-auth@file
|
traefik.http.routers.aniworld.middlewares: local-only@file, traefik-auth@file
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if localservices.aniworld.url | length > 0 %}
|
||||||
aniworld:
|
aniworld:
|
||||||
image: ghcr.io/phoenixthrush/aniworld-downloader:latest
|
image: ghcr.io/phoenixthrush/aniworld-downloader:latest
|
||||||
user: "0:0"
|
user: "0:0"
|
||||||
network_mode: "service:wireguard"
|
network_mode: "service:wireguard"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- data_aniworld:/app/Downloads
|
- {{ localservices.aniworld.url }}:/app/Downloads
|
||||||
- config_aniworld:/home/aniworld/.aniworld
|
- ./confg/.aniworld:/home/aniworld/.aniworld
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if localservices.bittorrent.url | length > 0 %}
|
||||||
bittorrent:
|
bittorrent:
|
||||||
image: linuxserver/qbittorrent:5.1.4
|
image: linuxserver/qbittorrent:latest
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
volumes:
|
volumes:
|
||||||
- config_qbittorrent:/config
|
- ./config/qbittorrent:/config
|
||||||
- data_qbittorrent:/downloads
|
- {{ localservices.aniworld.url }}:/downloads
|
||||||
ports:
|
ports:
|
||||||
- 6881:6881
|
- 6881:6881
|
||||||
- 6881:6881/udp
|
- 6881:6881/udp
|
||||||
@ -57,7 +56,7 @@ services:
|
|||||||
- TZ=Europe/Berlin
|
- TZ=Europe/Berlin
|
||||||
labels:
|
labels:
|
||||||
traefik.enable: true
|
traefik.enable: true
|
||||||
traefik.http.routers.qb.rule: "Host(`qbittorrent.arpa.urmel.de`)"
|
traefik.http.routers.qb.rule: "Host(`{{ localservices.bittorrent.url }}`)"
|
||||||
traefik.http.routers.qb.tls: "true"
|
traefik.http.routers.qb.tls: "true"
|
||||||
traefik.http.routers.qb.tls.certresolver: hetzner
|
traefik.http.routers.qb.tls.certresolver: hetzner
|
||||||
traefik.http.services.qb.loadbalancer.server.port: "8080"
|
traefik.http.services.qb.loadbalancer.server.port: "8080"
|
||||||
@ -70,22 +69,22 @@ services:
|
|||||||
traefik.http.routers.qb.middlewares: local-only@file, traefik-auth@file, qb-headers
|
traefik.http.routers.qb.middlewares: local-only@file, traefik-auth@file, qb-headers
|
||||||
traefik.http.services.qb.loadbalancer.passhostheader: "false"
|
traefik.http.services.qb.loadbalancer.passhostheader: "false"
|
||||||
|
|
||||||
|
{% if localservices.i2psnark.url | length > 0 %}
|
||||||
i2psnark:
|
i2psnark:
|
||||||
image: ypopovych/i2psnark:latest
|
image: ypopovych/i2psnark:latest
|
||||||
volumes:
|
volumes:
|
||||||
- config_i2psnark:/snark/config
|
- ./config/i2psnark:/snark/config
|
||||||
- data_i2psnark:/snark/downloads
|
- {{ localservices.aniworld.url }}:/snark/downloads
|
||||||
networks:
|
networks:
|
||||||
- proxy
|
- proxy
|
||||||
environment:
|
environment:
|
||||||
HOSTNAMES: "i2psnark.arpa.urmel.de"
|
HOSTNAMES: "{{ localservices.i2psnark.url }}"
|
||||||
I2CP_HOST: "i2pendpoint.arpa"
|
I2CP_HOST: "{{ localservices.i2psnark.i2pc_host }}"
|
||||||
restart: "on-failure"
|
restart: "on-failure"
|
||||||
|
|
||||||
labels:
|
labels:
|
||||||
traefik.enable: true
|
traefik.enable: true
|
||||||
traefik.http.routers.i2psnark.rule: "Host(`i2psnark.arpa.urmel.de`) && (PathPrefix(`/i2psnark/`) || Path(`/`))"
|
traefik.http.routers.i2psnark.rule: "Host(`{{ localservices.i2psnark.url }}`) && (PathPrefix(`/i2psnark/`) || Path(`/`))"
|
||||||
traefik.http.routers.i2psnark.tls: "true"
|
traefik.http.routers.i2psnark.tls: "true"
|
||||||
traefik.http.routers.i2psnark.tls.certresolver: hetzner
|
traefik.http.routers.i2psnark.tls.certresolver: hetzner
|
||||||
|
|
||||||
@ -96,7 +95,7 @@ services:
|
|||||||
traefik.http.middlewares.i2psnark-redirect.redirectregex.replacement: "/i2psnark/"
|
traefik.http.middlewares.i2psnark-redirect.redirectregex.replacement: "/i2psnark/"
|
||||||
traefik.http.middlewares.i2psnark-redirect.redirectregex.permanent: "true"
|
traefik.http.middlewares.i2psnark-redirect.redirectregex.permanent: "true"
|
||||||
|
|
||||||
traefik.http.middlewares.i2psnark-headers.headers.customRequestHeaders.Host: i2psnark.arpa.urmel.de
|
traefik.http.middlewares.i2psnark-headers.headers.customRequestHeaders.Host: {{ localservices.i2psnark.url }}
|
||||||
traefik.http.middlewares.i2psnark-headers.headers.customRequestHeaders.X-Forwarded-Proto: https
|
traefik.http.middlewares.i2psnark-headers.headers.customRequestHeaders.X-Forwarded-Proto: https
|
||||||
traefik.http.routers.i2psnark.middlewares: local-only@file, traefik-auth@file, i2psnark-redirect, i2psnark-headers
|
traefik.http.routers.i2psnark.middlewares: local-only@file, traefik-auth@file, i2psnark-redirect, i2psnark-headers
|
||||||
|
|
||||||
@ -104,25 +103,3 @@ networks:
|
|||||||
proxy:
|
proxy:
|
||||||
external: true
|
external: true
|
||||||
name: traefik_exposed
|
name: traefik_exposed
|
||||||
|
|
||||||
volumes:
|
|
||||||
data_i2psnark:
|
|
||||||
driver_opts:
|
|
||||||
type: nfs4
|
|
||||||
o: addr=217.100.0.2,rw,noatime,tcp
|
|
||||||
device: ":/mnt/Main/servicesData/i2psnark"
|
|
||||||
config_i2psnark:
|
|
||||||
|
|
||||||
data_aniworld:
|
|
||||||
driver_opts:
|
|
||||||
type: nfs4
|
|
||||||
o: addr=217.100.0.2,rw,noatime,tcp
|
|
||||||
device: ":/mnt/Main/servicesData/aniworld"
|
|
||||||
config_aniworld:
|
|
||||||
|
|
||||||
config_qbittorrent:
|
|
||||||
data_qbittorrent:
|
|
||||||
driver_opts:
|
|
||||||
type: nfs4
|
|
||||||
o: addr=217.100.0.2,rw,noatime,tcp
|
|
||||||
device: ":/mnt/Main/servicesData/qbittorrent"
|
|
||||||
Loading…
x
Reference in New Issue
Block a user