Initialise repository structure and placeholder files. Generic functionality works i guess, need to come up with a better solution for compose templates

This commit is contained in:
boris committed 2026-07-08 10:29:51 +01:00
commit 53695f4fff
411 files changed
+7817

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
# pinchflat
Deploys Pinchflat with Docker Compose.
+19
View File
@@ -0,0 +1,19 @@
---
pinchflat_name: pinchflat
pinchflat_dir: /srv/docker/pinchflat
pinchflat_image: ghcr.io/kieraneglin/pinchflat:latest
pinchflat_domain: pinchflat.example.invalid
pinchflat_service_port: 8945
pinchflat_routing_mode: "{{ nbops_service_routing_mode }}"
pinchflat_env:
TZ: "{{ nbops_timezone }}"
pinchflat_directories:
- "{{ pinchflat_dir }}"
- /srv/config/pinchflat
- /srv/media/pinchflat
pinchflat_volumes:
- /srv/config/pinchflat:/config
- /srv/media/pinchflat:/downloads
pinchflat_ports:
- { host: 8945, container: 8945, protocol: tcp }
+1
View File
@@ -0,0 +1 @@
+1
View File
@@ -0,0 +1 @@
+18
View File
@@ -0,0 +1,18 @@
---
- name: Deploy Pinchflat
ansible.builtin.include_role:
name: docker_app
vars:
docker_app_env_template_src: "{{ playbook_dir }}/../roles/pinchflat/templates/env.j2"
docker_app_compose_template_src: "{{ playbook_dir }}/../roles/pinchflat/templates/compose.yaml.j2"
docker_app_name: "{{ pinchflat_name }}"
docker_app_dir: "{{ pinchflat_dir }}"
docker_app_image: "{{ pinchflat_image }}"
docker_app_env: "{{ pinchflat_env }}"
docker_app_directories: "{{ pinchflat_directories }}"
docker_app_volumes: "{{ pinchflat_volumes }}"
docker_app_ports: "{{ pinchflat_ports }}"
docker_app_routing_mode: "{{ pinchflat_routing_mode }}"
docker_app_domain: "{{ pinchflat_domain }}"
docker_app_service_port: "{{ pinchflat_service_port }}"
+1
View File
@@ -0,0 +1 @@
+90
View File
@@ -0,0 +1,90 @@
services:
{{ docker_app_name }}:
image: {{ docker_app_image }}
restart: {{ docker_app_restart }}
{% if docker_app_command | length > 0 %}
command: {{ docker_app_command | to_json }}
{% endif %}
{% if docker_app_user | length > 0 %}
user: "{{ docker_app_user }}"
{% endif %}
{% if docker_app_network_mode | length > 0 %}
network_mode: {{ docker_app_network_mode }}
{% endif %}
{% if docker_app_privileged | bool %}
privileged: true
{% endif %}
{% if docker_app_env | length > 0 %}
env_file: .env
{% endif %}
{% if docker_app_routing_mode == "host" and docker_app_ports | length > 0 %}
ports:
{% for port in docker_app_ports %}
- "{{ port.bind | default('0.0.0.0') }}:{{ port.host | default(port.container) }}:{{ port.container }}{% if port.protocol | default('tcp') != 'tcp' %}/{{ port.protocol }}{% endif %}"
{% endfor %}
{% endif %}
{% if docker_app_routing_mode == "traefik" and docker_app_service_port %}
# internal service port: {{ docker_app_service_port }}; not published on the Docker host
labels:
- traefik.enable=true
- traefik.http.routers.{{ docker_app_name }}.rule={{ docker_app_traefik_rule }}
- traefik.http.routers.{{ docker_app_name }}.entrypoints={{ docker_app_traefik_entrypoint }}
- traefik.http.routers.{{ docker_app_name }}.tls={{ docker_app_traefik_tls | bool | ternary('true', 'false') }}
{% if docker_app_traefik_middlewares | length > 0 %}
- traefik.http.routers.{{ docker_app_name }}.middlewares={{ docker_app_traefik_middlewares | join(',') }}
{% endif %}
- traefik.http.services.{{ docker_app_name }}.loadbalancer.server.port={{ docker_app_service_port }}
{% for key, value in docker_app_labels.items() %}
- {{ key }}={{ value }}
{% endfor %}
{% elif docker_app_labels | length > 0 %}
labels:
{% for key, value in docker_app_labels.items() %}
- {{ key }}={{ value }}
{% endfor %}
{% endif %}
{% if docker_app_volumes | length > 0 %}
volumes:
{% for volume in docker_app_volumes %}
- {{ volume }}
{% endfor %}
{% endif %}
{% if docker_app_devices | length > 0 %}
devices:
{% for device in docker_app_devices %}
- {{ device }}
{% endfor %}
{% endif %}
{% if docker_app_cap_add | length > 0 %}
cap_add:
{% for capability in docker_app_cap_add %}
- {{ capability }}
{% endfor %}
{% endif %}
{% if docker_app_group_add | length > 0 %}
group_add:
{% for group in docker_app_group_add %}
- "{{ group }}"
{% endfor %}
{% endif %}
{% if docker_app_extra_hosts | length > 0 %}
extra_hosts:
{% for host in docker_app_extra_hosts %}
- {{ host }}
{% endfor %}
{% endif %}
{% if docker_app_depends_on | length > 0 %}
depends_on:
{% for dependency in docker_app_depends_on %}
- {{ dependency }}
{% endfor %}
{% endif %}
{% if docker_app_routing_mode == "traefik" and docker_app_network_mode | length == 0 %}
networks:
- {{ docker_app_traefik_network }}
{% endif %}
{% if docker_app_routing_mode == "traefik" and docker_app_network_mode | length == 0 %}
networks:
{{ docker_app_traefik_network }}:
external: true
{% endif %}
+4
View File
@@ -0,0 +1,4 @@
{% for key, value in docker_app_env.items() %}
{{ key }}={{ value }}
{% endfor %}