|
1 --- |
|
2 |
|
3 - name: install transmission |
|
4 become: yes |
|
5 apt: name="transmission-daemon" |
|
6 notify: restart transmission service |
|
7 |
|
8 - name: stop transmission service |
|
9 systemd: name="transmission-daemon" state="stopped" daemon_reload="yes" |
|
10 become: yes |
|
11 |
|
12 - name: config ip whitelist |
|
13 become: yes |
|
14 lineinfile: |
|
15 path: "{{transmission_config}}" |
|
16 regexp: '^ "rpc-whitelist":' |
|
17 line: ' "rpc-whitelist": "127.0.0.1,192.168.*.*",' |
|
18 notify: restart transmission service |
|
19 |
|
20 - name: config umask |
|
21 become: yes |
|
22 lineinfile: |
|
23 path: "{{transmission_config}}" |
|
24 regexp: '^ "umask":' |
|
25 line: ' "umask": 2,' |
|
26 notify: restart transmission service |
|
27 |
|
28 - name: config port |
|
29 become: yes |
|
30 lineinfile: |
|
31 path: "{{transmission_config}}" |
|
32 regexp: '^ "rpc-port":' |
|
33 line: " \"rpc-port\": {{transmission_port}}," |
|
34 notify: restart transmission service |
|
35 |
|
36 - name: config password |
|
37 become: yes |
|
38 lineinfile: |
|
39 path: "{{transmission_config}}" |
|
40 regexp: '^ "rpc-password":' |
|
41 line: " \"rpc-password\": \"{{transmission_passwd}}\"," |
|
42 notify: restart transmission service |
|
43 |
|
44 - name: config download dir |
|
45 become: yes |
|
46 lineinfile: |
|
47 path: "{{transmission_config}}" |
|
48 regexp: '^ "download-dir":' |
|
49 line: " \"download-dir\": \"{{transmission_download_dir}}\"," |
|
50 notify: restart transmission service |
|
51 |
|
52 - name: config disable seeding |
|
53 become: yes |
|
54 lineinfile: |
|
55 path: "{{transmission_config}}" |
|
56 regexp: '^ "idle-seeding-limit":' |
|
57 line: " \"idle-seeding-limit\": 0," |
|
58 notify: restart transmission service |
|
59 |
|
60 - name: config disable seeding |
|
61 become: yes |
|
62 lineinfile: |
|
63 path: "{{transmission_config}}" |
|
64 regexp: '^ "idle-seeding-limit-enabled":' |
|
65 line: " \"idle-seeding-limit-enabled\": true," |
|
66 notify: restart transmission service |
|
67 |
|
68 - name: start transmission service |
|
69 systemd: name="transmission-daemon" state="started" daemon_reload="yes" |
|
70 become: yes |