diff --git a/group_vars/all.yml b/group_vars/all.yml index a5ce18a..7fbe0bf 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -91,12 +91,6 @@ audiobookshelf_config_dir: "{{ audiobookshelf_base_dir }}/config" audiobookshelf_db_dir: "{{ audiobookshelf_base_dir }}/db" audiobookshelf_port: "45132" -# Calibre-Web -calibre_web_base_dir: "{{ service_config_base }}/calibre-web" -calibre_web_config_dir: "{{ calibre_web_base_dir }}/config" -calibre_web_db_dir: "{{ calibre_web_base_dir }}/db" -calibre_web_port: "45133" - # Ampache ampache_base_dir: "{{ service_config_base }}/ampache" ampache_config_dir: "{{ ampache_base_dir }}/config" @@ -104,16 +98,20 @@ ampache_logs_dir: "{{ ampache_base_dir }}/logs" ampache_mysql_dir: "{{ ampache_base_dir }}/mysql" ampache_port: "45134" -# ------------192.168.1.206 talk------------ - -# Mumble -mumble_base_dir: "/mnt/mumble" -mumble_data_dir: "{{ mumble_base_dir }}/data" -mumble_port: "45131" -mumble_ice_port: "6502" -mumble_server_password: "passw0rd" -mumble_superuser_password: "13qeadZC" -mumble_max_users: "100" +# Calibre +calibre_base_dir: "{{ service_config_base }}/calibre" +calibre_library_dir: "/mnt/books" +calibre_config_dir: "{{ calibre_base_dir }}/config" +calibre_web_port: "45133" +calibre_server_port: "45136" +calibre_web_db_path: "{{ calibre_config_dir }}/app.db" +calibre_web_enable_uploading: true +calibre_web_enable_conversion: true +calibre_web_enable_registration: false +calibre_web_enable_webdav: true +calibre_web_enable_opds: true +calibre_web_admin_user: "zailon" +calibre_web_admin_password: "zailon123" # ------------192.168.1.204 photo------------ @@ -127,6 +125,17 @@ immich_db_name: "immich" immich_version: "release" # immich_public_url: "https://photos.yourdomain.com" # раскомментирую если нужно +# ------------192.168.1.206 talk------------ + +# Mumble +mumble_base_dir: "/mnt/mumble" +mumble_data_dir: "{{ mumble_base_dir }}/data" +mumble_port: "45131" +mumble_ice_port: "6502" +mumble_server_password: "passw0rd" +mumble_superuser_password: "13qeadZC" +mumble_max_users: "100" + # ------------192.168.1.208 manage------------ # MeshCentral diff --git a/inventories/hosts b/inventories/hosts index 92067c5..c78dceb 100644 --- a/inventories/hosts +++ b/inventories/hosts @@ -1,8 +1,8 @@ [infra] gateway ansible_host=192.168.1.201 int_ip=192.168.1.201 -data ansible_host=192.168.1.222 int_ip=192.168.1.222 +data ansible_host=192.168.1.202 int_ip=192.168.1.202 media ansible_host=192.168.1.223 int_ip=192.168.1.223 -photo ansible_host=192.168.1.224 int_ip=192.168.1.224 +photo ansible_host=192.168.1.204 int_ip=192.168.1.204 talk ansible_host=192.168.1.226 int_ip=192.168.1.226 cloud ansible_host=192.168.1.225 int_ip=192.168.1.225 manage ansible_host=192.168.1.228 int_ip=192.168.1.228 diff --git a/olimp-deploy.yml b/olimp-deploy.yml index 070da25..8ef761d 100644 --- a/olimp-deploy.yml +++ b/olimp-deploy.yml @@ -21,7 +21,8 @@ - { role: docker, tags: deploy_docker } - { role: ampache, tags: deploy_ampache } - { role: audiobookshelf, tags: deploy_audiobookshelf } - + - { role: calibre-web, tags: deploy_calibre_web } + - hosts: photo roles: - { role: docker, tags: deploy_docker } diff --git a/roles/calibre-web/tasks/main.yml b/roles/calibre-web/tasks/main.yml new file mode 100644 index 0000000..c16428a --- /dev/null +++ b/roles/calibre-web/tasks/main.yml @@ -0,0 +1,53 @@ +--- +- name: Create Calibre directories + file: + path: "{{ item }}" + state: directory + mode: 0755 + loop: + - "{{ calibre_base_dir }}" + - "{{ calibre_config_dir }}" + +- name: Ensure books directory has correct permissions + file: + path: "{{ calibre_library_dir }}" + state: directory + mode: 0755 + owner: "1000" + group: "1000" + +- name: Deploy Calibre-web docker-compose.yml + template: + src: docker-compose.yml.j2 + dest: "{{ calibre_base_dir }}/docker-compose.yml" + mode: 0644 + +- name: Start Calibre-web services + shell: | + cd {{ calibre_base_dir }} + docker compose up -d + args: + executable: /bin/bash + +- name: Wait for Calibre-web to start + pause: + seconds: 20 + +- name: Check Calibre-web container status + shell: docker ps --filter name=calibre-web + register: calibre_web_status + changed_when: false + +- name: Show Calibre-web status + debug: + var: calibre_web_status.stdout + +- name: Verify Calibre-web is accessible + uri: + url: "http://{{ ansible_host }}:{{ calibre_web_port }}" + status_code: 200 + timeout: 30 + register: calibre_web_accessible + until: calibre_web_accessible.status == 200 + retries: 5 + delay: 10 \ No newline at end of file diff --git a/roles/calibre-web/templates/docker-compose.yml.j2 b/roles/calibre-web/templates/docker-compose.yml.j2 new file mode 100644 index 0000000..1e1ab95 --- /dev/null +++ b/roles/calibre-web/templates/docker-compose.yml.j2 @@ -0,0 +1,27 @@ +version: '3.8' + +services: + calibre-web: + image: lscr.io/linuxserver/calibre-web:latest + container_name: calibre-web + environment: + - PUID=1000 + - PGID=1000 + - TZ={{ timezone }} + - DOCKER_MODS=linuxserver/mods:universal-calibre + - OAUTHLIB_RELAX_TOKEN_SCOPE=1 + # Включение WebDAV и OPDS + - WEBDAV__ENABLED={{ calibre_web_enable_webdav | default(true) | lower }} + - OPDS__ENABLED={{ calibre_web_enable_opds | default(true) | lower }} + volumes: + - {{ calibre_config_dir }}:/config + - {{ calibre_library_dir }}:/books + ports: + - "{{ calibre_web_port }}:8083" + restart: unless-stopped + networks: + - default + +networks: + default: + name: {{ docker_network | default('web') }} \ No newline at end of file