From bb62b75f0e40ed827ceaaf56eb9bb55a622e41e2 Mon Sep 17 00:00:00 2001 From: Annika Merris Date: Wed, 18 Mar 2026 00:13:35 +0000 Subject: [PATCH] Sync --- .../minilab/roles/calibre/tasks/main.yaml | 54 +++++++++++++++++++ .../calibre/templates/docker-compose.yaml.j2 | 36 +++++++++++++ .../minilab/roles/calibre/vars/main.yaml | 2 + 3 files changed, 92 insertions(+) create mode 100644 collections/ansible_collections/adhdgirl/minilab/roles/calibre/tasks/main.yaml create mode 100644 collections/ansible_collections/adhdgirl/minilab/roles/calibre/templates/docker-compose.yaml.j2 create mode 100644 collections/ansible_collections/adhdgirl/minilab/roles/calibre/vars/main.yaml diff --git a/collections/ansible_collections/adhdgirl/minilab/roles/calibre/tasks/main.yaml b/collections/ansible_collections/adhdgirl/minilab/roles/calibre/tasks/main.yaml new file mode 100644 index 0000000..1b624e0 --- /dev/null +++ b/collections/ansible_collections/adhdgirl/minilab/roles/calibre/tasks/main.yaml @@ -0,0 +1,54 @@ +--- +- name: Load distro-specific variables + ansible.builtin.include_vars: "{{ item }}" + tags: always + with_first_found: + - files: + - "{{ ansible_facts['distribution'] }}.yaml" + skip: true + +- name: Ensure frigate is running on this device + block: + - name: Ensure presense of folders for CWA stack + tags: packages,docker,arr,sabnzbd + ansible.builtin.file: + path: "/opt/arr/{{ item }}" + state: directory + recurse: true + owner: 1000 + group: 1000 + loop: + - "sabnzbd/config" + - "radarr/config" + - "sonarr/config" + - "lidarr/config" + - "prowlarr/config" + - "homarr/appdata" + - "doplarr" + - "whisparr/config" + - name: Ensure compose files are properly loaded on the server + tags: packages,docker,frigate + ansible.builtin.template: + src: docker-compose.yaml.j2 + dest: /opt/frigate/docker-compose.yaml + owner: 1000 + group: 1000 + mode: "0644" + - name: Ensure frigate config is available for container + tags: packages,frigate + ansible.builtin.template: + src: frigate_config.yaml.j2 + dest: /opt/frigate/config/config.yaml + owner: 1000 + group: 1000 + mode: "0644" + - name: Ensure docker containers are pulled and running + tags: packages,docker,frigate + community.docker.docker_compose_v2: + project_src: /opt/frigate + pull: policy + + rescue: + - name: Set that this task failed # noqa: var-naming[no-role-prefix] + ansible.builtin.set_fact: + task_failed: true diff --git a/collections/ansible_collections/adhdgirl/minilab/roles/calibre/templates/docker-compose.yaml.j2 b/collections/ansible_collections/adhdgirl/minilab/roles/calibre/templates/docker-compose.yaml.j2 new file mode 100644 index 0000000..7624bba --- /dev/null +++ b/collections/ansible_collections/adhdgirl/minilab/roles/calibre/templates/docker-compose.yaml.j2 @@ -0,0 +1,36 @@ +--- +services: + calibre-web-automated: + image: crocodilestick/calibre-web-automated:{{ calibre_web_automated_image_tag }} + container_name: calibre-web-automated + environment: + # Only change these if you know what you're doing + - PUID=1000 + - PGID=1000 + # Edit to match your current timezone https://en.wikipedia.org/wiki/List_of_tz_database_time_zones + - TZ=America/New_York + # Hardcover API Key required for Hardcover as a Metadata Provider, get one here: https://docs.hardcover.app/api/getting-started/ + - HARDCOVER_TOKEN=Bearer + # If your library is on a network share (e.g., NFS/SMB), disable WAL to reduce locking issues + # Accepts: true/false (default: false) + - NETWORK_SHARE_MODE=false + # Override the default port (8083) for the web server. + # Accepts any valid port number. + - CWA_PORT_OVERRIDE=8083 + volumes: + # CW users migrating should stop their existing CW instance, make a copy of the config folder, and bind that here to carry over all of their user settings ect. + - /opt/calibre/automated/config:/config + # This is an ingest dir, NOT a library one. Anything added here will be automatically added to your library according to the settings you have configured in CWA Settings page. All files placed here are REMOVED AFTER PROCESSING + - /opt/calibre/automated/ingest:/cwa-book-ingest + # If you don't have an existing library, CWA will automatically create one at the bind provided here + - /opt/calibre/automated/config:/calibre-library + # If you use calibre plugins, you can bind your plugins folder here to have CWA attempt to add them to its workflow (WIP) + # If you are starting with a fresh install, you also need to copy customize.py.json to the Calibre config volume above, in /path/to/config/folder/.config/calibre/customize.py.json, see the note below for more info + - /opt/calibre/automated/config:/config/.config/calibre/plugins + ports: + # Change the first number to change the port you want to access the Web UI, not the second + - 8083:8083 + # If you set CWA_PORT_OVERRIDE to a port below 1024, you may need to uncomment the following line: + # cap_add: + # - NET_BIND_SERVICE + restart: unless-stopped diff --git a/collections/ansible_collections/adhdgirl/minilab/roles/calibre/vars/main.yaml b/collections/ansible_collections/adhdgirl/minilab/roles/calibre/vars/main.yaml new file mode 100644 index 0000000..bb8bafd --- /dev/null +++ b/collections/ansible_collections/adhdgirl/minilab/roles/calibre/vars/main.yaml @@ -0,0 +1,2 @@ +--- +calibre_web_automated_image_tag: v4.0.6