diff --git a/roles/bittorrent/files/sonarr.service b/roles/bittorrent/files/sonarr.service deleted file mode 100644 index b0a4522..0000000 --- a/roles/bittorrent/files/sonarr.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Sonarr Service -After=network.target - -[Service] -User=debian-transmission -Group=debian-transmission -ExecStart=/usr/bin/mono /opt/NzbDrone/NzbDrone.exe -nobrowser -Type=simple -TimeoutStopSec=20 - -[Install] -WantedBy=multi-user.target diff --git a/roles/bittorrent/handlers/main.yml b/roles/bittorrent/handlers/main.yml index d1d69a3..94c9f40 100644 --- a/roles/bittorrent/handlers/main.yml +++ b/roles/bittorrent/handlers/main.yml @@ -14,3 +14,10 @@ ansible.builtin.command: cmd: exportfs -a changed_when: true + +- name: Restart jackett + ansible.builtin.systemd_service: + name: jackett + daemon_reload: true + enabled: true + state: restarted diff --git a/roles/bittorrent/tasks/jackett.yml b/roles/bittorrent/tasks/jackett.yml new file mode 100644 index 0000000..838b14c --- /dev/null +++ b/roles/bittorrent/tasks/jackett.yml @@ -0,0 +1,25 @@ +--- + +- name: Create jackett user + ansible.builtin.user: + comment: jackett + home: "{{ jackett_home }}" + name: jackett + password: '!' + shell: /bin/bash + state: present + +- name: Unzip jackett + ansible.builtin.unarchive: + src: "{{ jackett_download_url }}" + remote_src: true + dest: "/opt" + owner: jackett + group: jackett + +- name: Install jackett systemd file + ansible.builtin.template: + src: jackett.service.j2 + dest: /etc/systemd/system/jackett.service + mode: 0644 + notify: Restart jackett diff --git a/roles/bittorrent/tasks/main.yml b/roles/bittorrent/tasks/main.yml index 63c4046..583d325 100644 --- a/roles/bittorrent/tasks/main.yml +++ b/roles/bittorrent/tasks/main.yml @@ -4,6 +4,8 @@ ansible.builtin.include_tasks: transmission.yml - name: Include sonarr ansible.builtin.include_tasks: sonarr.yml +- name: Include jackett + ansible.builtin.include_tasks: jackett.yml - name: Include subliminal ansible.builtin.include_tasks: subliminal.yml - name: Include nfsclient diff --git a/roles/bittorrent/tasks/sonarr.yml b/roles/bittorrent/tasks/sonarr.yml index 8ee1d74..054a66c 100644 --- a/roles/bittorrent/tasks/sonarr.yml +++ b/roles/bittorrent/tasks/sonarr.yml @@ -1,9 +1,9 @@ --- - name: Install sonarr repokey - ansible.builtin.apt_key: - keyserver: keyserver.ubuntu.com - id: "0xa236c58f409091a18aca53cbebff6b99d9b78493" + ansible.builtin.get_url: + url: https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xa236c58f409091a18aca53cbebff6b99d9b78493 + dest: /etc/apt/trusted.gpg.d/sonarr.asc - name: Install sonarr repo ansible.builtin.apt_repository: diff --git a/roles/bittorrent/templates/jackett.service.j2 b/roles/bittorrent/templates/jackett.service.j2 new file mode 100644 index 0000000..8b3ff3b --- /dev/null +++ b/roles/bittorrent/templates/jackett.service.j2 @@ -0,0 +1,17 @@ +[Unit] +Description=Jackett Daemon +After=network.target + +[Service] +SyslogIdentifier=jackett +Restart=always +RestartSec=5 +Type=simple +User=jackett +Group=jackett +WorkingDirectory={{ jackett_home }} +ExecStart=/bin/sh "{{ jackett_home }}/jackett_launcher.sh" +TimeoutStopSec=30 + +[Install] +WantedBy=multi-user.target diff --git a/roles/bittorrent/vars/main.yml b/roles/bittorrent/vars/main.yml new file mode 100644 index 0000000..fcc5288 --- /dev/null +++ b/roles/bittorrent/vars/main.yml @@ -0,0 +1,5 @@ +--- + +jackett_version: "v0.21.589" +jackett_download_url: "https://github.com/Jackett/Jackett/releases/download/{{ jackett_version }}/Jackett.Binaries.LinuxAMDx64.tar.gz" +jackett_home: "/opt/Jackett" diff --git a/roles/nginx/templates/vhosts/jackett.mateu.be.conf.j2 b/roles/nginx/templates/vhosts/jackett.mateu.be.conf.j2 new file mode 100644 index 0000000..36ace0e --- /dev/null +++ b/roles/nginx/templates/vhosts/jackett.mateu.be.conf.j2 @@ -0,0 +1,8 @@ +server { +{% include './templates/header.conf.j2' %} + + location / { + proxy_pass http://localhost:9117; + } +} +