From f4bc174d8737b2f9894ecb4c2cf889ea12c42117 Mon Sep 17 00:00:00 2001 From: Mike Wilson Date: Wed, 22 Feb 2023 13:25:15 -0500 Subject: [PATCH] Templatized cross-seed configuration (config.js) --- ansible/roles/qbittorrent/tasks/main.yml | 16 ++++++++++ .../templates/cross-seed/config.js | 30 +++++++++++++++++++ ansible/roles/qbittorrent/vars/main.yml | 8 +++++ 3 files changed, 54 insertions(+) create mode 100644 ansible/roles/qbittorrent/templates/cross-seed/config.js create mode 100644 ansible/roles/qbittorrent/vars/main.yml diff --git a/ansible/roles/qbittorrent/tasks/main.yml b/ansible/roles/qbittorrent/tasks/main.yml index 52fe236..fd69578 100644 --- a/ansible/roles/qbittorrent/tasks/main.yml +++ b/ansible/roles/qbittorrent/tasks/main.yml @@ -32,6 +32,22 @@ mode: "{{ docker_compose_file_mask }}" become: true +- name: Create cross-seed config directory + file: + path: "{{ data_dir }}/cross-seed" + state: directory + owner: "{{ service_user.uid }}" + mode: "{{ docker_compose_directory_mask }}" + become: true + +- name: Install cross-seed config file + template: + src: cross-seed/config.js + dest: "{{ data_dir }}/cross-seed/config.js" + owner: "{{ service_user.uid }}" + mode: "{{ docker_compose_file_mask }}" + become: true + - name: Start docker containers community.docker.docker_compose: project_src: "{{ install_directory }}/{{ role_name }}" diff --git a/ansible/roles/qbittorrent/templates/cross-seed/config.js b/ansible/roles/qbittorrent/templates/cross-seed/config.js new file mode 100644 index 0000000..8e388aa --- /dev/null +++ b/ansible/roles/qbittorrent/templates/cross-seed/config.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +module.exports = { + delay: 10, + + torznab: [ + "http://prowlarr.local.{{ personal_domain }}/1/api?apikey={{ prowlarr_api_key }}", // TorrentLeech + "http://prowlarr.local.{{ personal_domain }}/2/api?apikey={{ prowlarr_api_key }}", // DigitalCore + "http://prowlarr.local.{{ personal_domain }}/3/api?apikey={{ prowlarr_api_key }}", // ImmortalSeed + "http://prowlarr.local.{{ personal_domain }}/4/api?apikey={{ prowlarr_api_key }}", // TorrentSeeds + "http://prowlarr.local.{{ personal_domain }}/5/api?apikey={{ prowlarr_api_key }}", // AnimeTosho + "http://prowlarr.local.{{ personal_domain }}/6/api?apikey={{ prowlarr_api_key }}", // Aither + ], + + torrentDir: "/torrents", + outputDir: "/cross-seeds", + includeEpisodes: false, + includeNonVideos: false, + fuzzySizeThreshold: 0.02, + excludeOlder: undefined, + excludeRecentSearch: undefined, + action: "inject", + rtorrentRpcUrl: undefined, + qbittorrentUrl: "https://qbittorrent.local.{{ personal_domain }}", + duplicateCategories: true, + notificationWebhookUrl: undefined, + port: 2468, + rssCadence: "2w", + searchCadence: "6w", +}; diff --git a/ansible/roles/qbittorrent/vars/main.yml b/ansible/roles/qbittorrent/vars/main.yml new file mode 100644 index 0000000..7ebf7cc --- /dev/null +++ b/ansible/roles/qbittorrent/vars/main.yml @@ -0,0 +1,8 @@ +prowlarr_api_key: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 33613266653534343065316535383533393361316135303632333033353063353330333935323861 + 3763386430616462663135313335626432323463613432650a646233363838633237666131306161 + 31613165343530346165663661343736316566303761343263303133363430313765656163643530 + 6236313433373065640a393262613061613739626636653162653963663236303834376366626234 + 65316164613935376234356466333666316531353565393034353032653136376530663634383061 + 6335326539333362316333353131303533353537623232343637