torrent working
This commit is contained in:
35
ansible/roles/torrent/tasks/main.yaml
Normal file
35
ansible/roles/torrent/tasks/main.yaml
Normal file
@ -0,0 +1,35 @@
|
||||
---
|
||||
|
||||
- name: Create downloads directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ torrent_downloads_dir }}"
|
||||
state: directory
|
||||
owner: "{{ torrent_user }}"
|
||||
group: "{{ torrent_user }}"
|
||||
mode: "0775"
|
||||
|
||||
- name: Create qbittorrent config directory
|
||||
ansible.builtin.file:
|
||||
path: /etc/qbittorrent
|
||||
state: directory
|
||||
owner: "{{ torrent_user }}"
|
||||
group: "{{ torrent_user }}"
|
||||
mode: "0775"
|
||||
|
||||
- name: Template out the wireguard config
|
||||
ansible.builtin.template:
|
||||
dest: /etc/qbittorrent/wg0.conf
|
||||
src: wireguard.conf.j2
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0600"
|
||||
|
||||
- name: Modprobe the wireguard module
|
||||
community.general.modprobe:
|
||||
name: wireguard
|
||||
persistent: present
|
||||
state: present
|
||||
|
||||
- name: Branch to Docker role
|
||||
ansible.builtin.include_role:
|
||||
name: docker
|
11
ansible/roles/torrent/templates/wireguard.conf.j2
Normal file
11
ansible/roles/torrent/templates/wireguard.conf.j2
Normal file
@ -0,0 +1,11 @@
|
||||
[Interface]
|
||||
PrivateKey = {{ torrent_wireguard_private_key }}
|
||||
Address = {{ torrent_wireguard_address }}/32
|
||||
DNS = {{ torrent_wireguard_dns }}
|
||||
MTU = 1420
|
||||
|
||||
[Peer]
|
||||
PublicKey = {{ torrent_wireguard_peer_public_key }}
|
||||
AllowedIPs = 0.0.0.0/0
|
||||
Endpoint = {{ torrent_wireguard_peer_endpoint }}:51820
|
||||
PersistentKeepalive = 25
|
Reference in New Issue
Block a user