From 91f0cf08c73163a9365a44ca582cc0f10af59628 Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 5 Dec 2025 11:07:30 +0500 Subject: [PATCH] Update 3 files - /group_vars/all.yml - /roles/flibusta/templates/docker-compose.yml.j2 - /roles/flibusta/tasks/main.yml --- group_vars/all.yml | 8 ++++++ roles/flibusta/tasks/main.yml | 24 +++++++++++++++++ .../flibusta/templates/docker-compose.yml.j2 | 27 +++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 roles/flibusta/tasks/main.yml create mode 100644 roles/flibusta/templates/docker-compose.yml.j2 diff --git a/group_vars/all.yml b/group_vars/all.yml index 8283c87..2aebb22 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -201,6 +201,14 @@ calibre_web_enable_registration: false calibre_web_enable_webdav: true calibre_web_enable_opds: true +flibusta_base_dir: "{{ service_config_base }}/flibusta" +flibusta_books_dir: "/mnt/books/flibusta" +flibusta_port: "45135" +flibusta_image: "flibusta/fb_tools:full-latest" +flibusta_webdav_enabled: true +flibusta_opds_enabled: true +flibusta_calibre_integration: true + # ------------ photo (192.168.1.204) ------------ immich_base_dir: "/mnt/immich" immich_port: "45131" diff --git a/roles/flibusta/tasks/main.yml b/roles/flibusta/tasks/main.yml new file mode 100644 index 0000000..660b3c2 --- /dev/null +++ b/roles/flibusta/tasks/main.yml @@ -0,0 +1,24 @@ +--- +- name: Ensure Flibusta directories exist + file: + path: "{{ item }}" + state: directory + mode: '0755' + loop: + - "{{ flibusta_base_dir }}/config" + - "{{ flibusta_base_dir }}/data" + - "{{ flibusta_books_dir }}" + become: yes + +- name: Deploy docker-compose.yml for Flibusta + template: + src: docker-compose.yml.j2 + dest: /opt/flibusta/docker-compose.yml + mode: '0644' + become: yes + +- name: Pull and deploy Flibusta container + community.docker.docker_compose_v2: + project_src: /opt/flibusta + pull: yes + become: yes \ No newline at end of file diff --git a/roles/flibusta/templates/docker-compose.yml.j2 b/roles/flibusta/templates/docker-compose.yml.j2 new file mode 100644 index 0000000..ac2aaad --- /dev/null +++ b/roles/flibusta/templates/docker-compose.yml.j2 @@ -0,0 +1,27 @@ +services: + flibusta: + image: "{{ flibusta_image }}" + container_name: flibusta + restart: unless-stopped + mem_limit: "2g" # ← жёстко, как у тебя везде (jellyfin/audiobookshelf ~2G) + security_opt: + - no-new-privileges:true + ports: + - "{{ int_ip }}:{{ flibusta_port }}:8080" + environment: + - TZ={{ timezone }} + - WEBDAV_ENABLED={{ flibusta_webdav_enabled | lower }} + - OPDS_ENABLED={{ flibusta_opds_enabled | lower }} + volumes: + - "{{ flibusta_base_dir }}/config:/app/config:rw" + - "{{ flibusta_base_dir }}/data:/app/rw:rw" + - "{{ flibusta_books_dir }}:/books:rw" + {% if flibusta_calibre_integration %} + - "{{ calibre_library_dir }}:/calibre:ro" + {% endif %} + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8080/health"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 40s \ No newline at end of file