14 become: yes |
14 become: yes |
15 lineinfile: |
15 lineinfile: |
16 path: "{{transmission_config}}" |
16 path: "{{transmission_config}}" |
17 regexp: '^ "rpc-whitelist":' |
17 regexp: '^ "rpc-whitelist":' |
18 line: ' "rpc-whitelist": "127.0.0.1,192.168.*.*",' |
18 line: ' "rpc-whitelist": "127.0.0.1,192.168.*.*",' |
|
19 insertafter: ",$" |
19 notify: restart transmission service |
20 notify: restart transmission service |
20 |
21 |
21 - name: config umask |
22 - name: config umask |
22 become: yes |
23 become: yes |
23 lineinfile: |
24 lineinfile: |
24 path: "{{transmission_config}}" |
25 path: "{{transmission_config}}" |
25 regexp: '^ "umask":' |
26 regexp: '^ "umask":' |
26 line: ' "umask": 2,' |
27 line: ' "umask": 2,' |
|
28 insertafter: ",$" |
27 notify: restart transmission service |
29 notify: restart transmission service |
28 |
30 |
29 - name: config port |
31 - name: config port |
30 become: yes |
32 become: yes |
31 lineinfile: |
33 lineinfile: |
32 path: "{{transmission_config}}" |
34 path: "{{transmission_config}}" |
33 regexp: '^ "rpc-port":' |
35 regexp: '^ "rpc-port":' |
34 line: " \"rpc-port\": {{transmission_port}}," |
36 line: " \"rpc-port\": {{transmission_port}}," |
|
37 insertafter: ",$" |
35 notify: restart transmission service |
38 notify: restart transmission service |
36 |
39 |
37 # the password is hashed at start of server so this always changes |
40 # the password is hashed at start of server so this always changes |
38 - name: config password |
41 - name: config password |
39 become: yes |
42 become: yes |
40 lineinfile: |
43 lineinfile: |
41 path: "{{transmission_config}}" |
44 path: "{{transmission_config}}" |
42 regexp: '^ "rpc-password":' |
45 regexp: '^ "rpc-password":' |
43 line: " \"rpc-password\": \"{{transmission_passwd}}\"," |
46 line: " \"rpc-password\": \"{{transmission_passwd}}\"," |
|
47 insertafter: ",$" |
44 changed_when: false |
48 changed_when: false |
45 |
49 |
46 - name: config download dir |
50 - name: config download dir |
47 become: yes |
51 become: yes |
48 lineinfile: |
52 lineinfile: |
49 path: "{{transmission_config}}" |
53 path: "{{transmission_config}}" |
50 regexp: '^ "download-dir":' |
54 regexp: '^ "download-dir":' |
51 line: " \"download-dir\": \"{{transmission_download_dir}}\"," |
55 line: " \"download-dir\": \"{{transmission_download_dir}}\"," |
|
56 insertafter: ",$" |
52 notify: restart transmission service |
57 notify: restart transmission service |
53 |
58 |
54 - name: config disable seeding |
59 - name: config disable seeding |
55 become: yes |
60 become: yes |
56 lineinfile: |
61 lineinfile: |
57 path: "{{transmission_config}}" |
62 path: "{{transmission_config}}" |
58 regexp: '^ "idle-seeding-limit":' |
63 regexp: '^ "idle-seeding-limit":' |
59 line: " \"idle-seeding-limit\": 0," |
64 line: " \"idle-seeding-limit\": 0," |
|
65 insertafter: ",$" |
60 notify: restart transmission service |
66 notify: restart transmission service |
61 |
67 |
62 - name: config disable seeding |
68 - name: config disable seeding |
63 become: yes |
69 become: yes |
64 lineinfile: |
70 lineinfile: |
65 path: "{{transmission_config}}" |
71 path: "{{transmission_config}}" |
66 regexp: '^ "idle-seeding-limit-enabled":' |
72 regexp: '^ "idle-seeding-limit-enabled":' |
67 line: " \"idle-seeding-limit-enabled\": true," |
73 line: " \"idle-seeding-limit-enabled\": true," |
|
74 insertafter: ",$" |
68 notify: restart transmission service |
75 notify: restart transmission service |
69 |
76 |
70 - name: start transmission service |
77 - name: start transmission service |
71 systemd: name="transmission-daemon" state="started" daemon_reload="yes" |
78 systemd: name="transmission-daemon" state="started" daemon_reload="yes" |
72 become: yes |
79 become: yes |