diff --git a/group_vars/all.yml b/group_vars/all.yml index 6c012a3..291b265 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -143,15 +143,6 @@ dashy_config_dir: "{{ dashy_base_dir }}/config" dashy_port: "45132" dashy_domain: "start.zailon.ru" -qbittorrent_base_dir: "/opt/qbittorrent" -qbittorrent_config_dir: "{{ qbittorrent_base_dir }}/appdata" -qbittorrent_downloads_dir: "{{ qbittorrent_base_dir }}/downloads" -qbittorrent_puid: 1000 -qbittorrent_pgid: 1000 -qbittorrent_port_webui: 45133 -qbittorrent_port_torrent: 6881 -qbittorrent_password: "13qeadZC" - # ------------ data (192.168.1.202) ------------ bookstack_base_dir: "/mnt/bookstack" bookstack_config_dir: "/mnt/bookstack/config" @@ -195,12 +186,6 @@ audiobookshelf_config_dir: "{{ audiobookshelf_base_dir }}/config" audiobookshelf_db_dir: "{{ audiobookshelf_base_dir }}/db" audiobookshelf_port: "45132" -ampache_base_dir: "{{ service_config_base }}/ampache" -ampache_config_dir: "{{ ampache_base_dir }}/config" -ampache_logs_dir: "{{ ampache_base_dir }}/logs" -ampache_mysql_dir: "{{ ampache_base_dir }}/mysql" -ampache_port: "45134" - calibre_base_dir: "{{ service_config_base }}/calibre" calibre_library_dir: "/mnt/books/calibre" calibre_config_dir: "{{ calibre_base_dir }}/config" @@ -212,6 +197,25 @@ calibre_web_enable_registration: false calibre_web_enable_webdav: true calibre_web_enable_opds: true +ampache_base_dir: "{{ service_config_base }}/ampache" +ampache_config_dir: "{{ ampache_base_dir }}/config" +ampache_logs_dir: "{{ ampache_base_dir }}/logs" +ampache_mysql_dir: "{{ ampache_base_dir }}/mysql" +ampache_port: "45134" + +qbittorrent_base_dir: "/opt/qbittorrent" +qbittorrent_config_dir: "{{ qbittorrent_base_dir }}/appdata" +qbittorrent_downloads_dir: "{{ qbittorrent_base_dir }}/downloads" +qbittorrent_puid: 1000 +qbittorrent_pgid: 1000 +qbittorrent_port_webui: 45135 +qbittorrent_port_torrent: 6881 +qbittorrent_password: "13qeadZC" + +torrserver_base_dir: "/mnt/service/torrserver" +torrserver_config_dir: "{{ torrserver_base_dir }}/config" +torrserver_torrents_dir: "{{ torrserver_base_dir }}/torrents" +torrserver_port: "45136" # ------------ Flibusta ------------ flibusta_base_dir: "/mnt/service/flibusta" flibusta_source_archives_dir: "/mnt/books/flibusta" diff --git a/roles/torrserver/tasks/main.yml b/roles/torrserver/tasks/main.yml new file mode 100644 index 0000000..a240fbd --- /dev/null +++ b/roles/torrserver/tasks/main.yml @@ -0,0 +1,41 @@ +--- +- name: Create torrserver directories + file: + path: "{{ item }}" + state: directory + owner: 1000 + group: 1000 + mode: '0755' + loop: + - "{{ torrserver_base_dir }}" + - "{{ torrserver_config_dir }}" + - "{{ torrserver_torrents_dir }}" + +- name: Render docker-compose.yml + template: + src: docker-compose.yml.j2 + dest: "{{ torrserver_base_dir }}/docker-compose.yml" + owner: root + group: root + mode: '0644' + +- name: Deploy torrserver via docker-compose + docker_compose_v2: + project_src: "{{ torrserver_base_dir }}" + project_name: torrserver + state: present + pull: yes + recreate: smart + register: _compose_result + +- name: Wait for torrserver UI to respond + uri: + url: "http://{{ int_ip }}:{{ torrserver_port }}" + method: GET + status_code: 200 + timeout: 10 + register: _check + until: _check.status == 200 + retries: 12 + delay: 5 + ignore_errors: yes \ No newline at end of file diff --git a/roles/torrserver/templates/docker-compose.yml.j2 b/roles/torrserver/templates/docker-compose.yml.j2 new file mode 100644 index 0000000..37a8d72 --- /dev/null +++ b/roles/torrserver/templates/docker-compose.yml.j2 @@ -0,0 +1,15 @@ +services: + torrserver: + image: ghcr.io/yourok/torrserver:latest + container_name: torrserver + network_mode: host + environment: + - TS_PORT={{ torrserver_port }} + - TS_DONTKILL=1 + - TS_HTTPAUTH=0 + - TS_CONF_PATH=/opt/ts/config + - TS_TORR_DIR=/opt/ts/torrents + volumes: + - {{ torrserver_torrents_dir }}:/opt/ts/torrents + - {{ torrserver_config_dir }}:/opt/ts/config + restart: unless-stopped \ No newline at end of file