From 191374b812a1935d4ca5b4904fdb59d8b33a052a Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 2 Oct 2020 18:11:27 +0100 Subject: [PATCH] Move deluge onto `walker` Stop torrent traffic being limitted by home broadband --- ansible/main.yml | 1 + .../files}/docker-compose.yml | 4 ++-- ansible/roles/deluge/handlers/main.yml | 4 ++++ ansible/roles/deluge/tasks/main.yml | 17 ++++++++++++++ ansible/roles/intersect_docker/tasks/main.yml | 3 --- .../roles/intersect_docker/tasks/torrent.yml | 23 ------------------- 6 files changed, 24 insertions(+), 28 deletions(-) rename ansible/roles/{intersect_docker/files/torrent => deluge/files}/docker-compose.yml (80%) create mode 100644 ansible/roles/deluge/handlers/main.yml create mode 100644 ansible/roles/deluge/tasks/main.yml delete mode 100644 ansible/roles/intersect_docker/tasks/torrent.yml diff --git a/ansible/main.yml b/ansible/main.yml index d16177e..62dd2ef 100644 --- a/ansible/main.yml +++ b/ansible/main.yml @@ -52,3 +52,4 @@ - website - duplicati - gitlab_pages + - deluge diff --git a/ansible/roles/intersect_docker/files/torrent/docker-compose.yml b/ansible/roles/deluge/files/docker-compose.yml similarity index 80% rename from ansible/roles/intersect_docker/files/torrent/docker-compose.yml rename to ansible/roles/deluge/files/docker-compose.yml index e20f737..9147eff 100644 --- a/ansible/roles/intersect_docker/files/torrent/docker-compose.yml +++ b/ansible/roles/deluge/files/docker-compose.yml @@ -8,9 +8,9 @@ services: - TZ=Europe/London volumes: - "{{ app_data_dir }}/deluge:/config" - - /mnt/scratch/deluge:/downloads + - /mnt/tank/downloads:/downloads ports: - - 8112:8112 + - "{{ wireguard.clients[ansible_fqdn].ip }}:8112:8112" restart: unless-stopped depends_on: - tor-socks-proxy diff --git a/ansible/roles/deluge/handlers/main.yml b/ansible/roles/deluge/handlers/main.yml new file mode 100644 index 0000000..7bd8472 --- /dev/null +++ b/ansible/roles/deluge/handlers/main.yml @@ -0,0 +1,4 @@ +- name: restart deluge + shell: + chdir: /opt/deluge + cmd: "{{ docker_update_command }}" diff --git a/ansible/roles/deluge/tasks/main.yml b/ansible/roles/deluge/tasks/main.yml new file mode 100644 index 0000000..8b5c4e1 --- /dev/null +++ b/ansible/roles/deluge/tasks/main.yml @@ -0,0 +1,17 @@ +- name: Create deluge directory + file: + path: /opt/deluge + state: directory + owner: "{{ docker_user.name }}" + mode: "{{ docker_compose_directory_mask }}" + become: true + +- name: Install deluge compose file + template: + src: files/docker-compose.yml + dest: /opt/deluge/docker-compose.yml + mode: "{{ docker_compose_file_mask }}" + owner: "{{ docker_user.name }}" + validate: /usr/bin/docker-compose -f %s config + notify: restart deluge + become: true diff --git a/ansible/roles/intersect_docker/tasks/main.yml b/ansible/roles/intersect_docker/tasks/main.yml index 3e00bad..b9a51b4 100644 --- a/ansible/roles/intersect_docker/tasks/main.yml +++ b/ansible/roles/intersect_docker/tasks/main.yml @@ -19,9 +19,6 @@ - name: Install synapse include: synapse.yml -- name: Install torrent - include: torrent.yml - - name: Install tt-rss include: tt-rss.yml diff --git a/ansible/roles/intersect_docker/tasks/torrent.yml b/ansible/roles/intersect_docker/tasks/torrent.yml deleted file mode 100644 index a3b493f..0000000 --- a/ansible/roles/intersect_docker/tasks/torrent.yml +++ /dev/null @@ -1,23 +0,0 @@ -- name: Create torrent directory - file: - path: /opt/torrent - state: directory - owner: "{{ docker_user.name }}" - mode: "{{ docker_compose_directory_mask }}" - become: true - -- name: Install torrent compose file - template: - src: files/torrent/docker-compose.yml - dest: /opt/torrent/docker-compose.yml - mode: "{{ docker_compose_file_mask }}" - owner: "{{ docker_user.name }}" - validate: /usr/bin/docker-compose -f %s config - register: compose_file - become: true - -- name: restart torrent - shell: - chdir: /opt/torrent - cmd: "{{ docker_update_command }}" - when: compose_file.changed