Skip to content

Commit 0877dfd

Browse files
committed
deluge: manage outgoing ports and disable network extras on new install
1 parent b986fae commit 0877dfd

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

roles/deluge/tasks/subtasks/post-install/settings/main.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,29 @@
1919
regexp: '"listen_random_port": ([\d|\W]+),'
2020
replace: '"listen_random_port": null,'
2121

22-
- name: Post-Install | Settings | Update 'core.conf' | Disable random ports
22+
- name: Post-Install | Settings | Update 'core.conf' | Disable random incoming port
2323
ansible.builtin.replace:
2424
path: "{{ deluge_paths_conf }}"
2525
regexp: '"random_port": ([\w]+),'
2626
replace: '"random_port": false,'
27+
28+
- name: Post-Install | Settings | Update 'core.conf' | Enable random outgoing ports
29+
ansible.builtin.replace:
30+
path: "{{ deluge_paths_conf }}"
31+
regexp: '"random_outgoing_ports": ([\w]+),'
32+
replace: '"random_outgoing_ports": true,'
33+
34+
- name: New Install
35+
when: not deluge_paths_conf_stat.stat.exists
36+
block:
37+
- name: Post-Install | Settings | Update 'core.conf' | Disable Network Extras
38+
ansible.builtin.replace:
39+
path: "{{ deluge_paths_conf }}"
40+
regexp: '"{{ item }}": ([\w]+){{ "," if item != "utpex" else "" }}'
41+
replace: '"{{ item }}": false{{ "," if item != "utpex" else "" }}'
42+
loop:
43+
- "dht"
44+
- "lsd"
45+
- "natpmp"
46+
- "upnp"
47+
- "utpex"

roles/deluge/tasks/subtasks/pre-install/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@
1414
protocol: both
1515
register: port_lookup_58112
1616
ignore_errors: true
17+
18+
- name: Pre-Install | Check if existing config file exists
19+
ansible.builtin.stat:
20+
path: "{{ deluge_paths_conf }}"
21+
register: deluge_paths_conf_stat

0 commit comments

Comments
 (0)