author | Luke Hoersten <luke@hoersten.org> |
Tue, 09 Jun 2020 14:39:54 -0500 | |
changeset 38 | b4e705f4cda4 |
parent 34 | ecbdaed7f151 |
child 42 | edb53dfadfb5 |
permissions | -rw-r--r-- |
0
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
1 |
--- |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
2 |
|
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
3 |
- name: install transmission |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
4 |
become: yes |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
5 |
apt: name="transmission-daemon" |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
6 |
notify: restart transmission service |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
7 |
|
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
8 |
- name: stop transmission service |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
9 |
systemd: name="transmission-daemon" state="stopped" daemon_reload="yes" |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
10 |
become: yes |
28
d289eab1ea52
Made transmission idempotent.
Luke Hoersten <luke@hoersten.org>
parents:
2
diff
changeset
|
11 |
changed_when: false |
0
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
12 |
|
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
13 |
- name: config ip whitelist |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
14 |
become: yes |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
15 |
lineinfile: |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
16 |
path: "{{transmission_config}}" |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
17 |
regexp: '^ "rpc-whitelist":' |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
18 |
line: ' "rpc-whitelist": "127.0.0.1,192.168.*.*",' |
34 | 19 |
insertafter: ",$" |
0
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
20 |
notify: restart transmission service |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
21 |
|
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
22 |
- name: config umask |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
23 |
become: yes |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
24 |
lineinfile: |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
25 |
path: "{{transmission_config}}" |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
26 |
regexp: '^ "umask":' |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
27 |
line: ' "umask": 2,' |
34 | 28 |
insertafter: ",$" |
0
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
29 |
notify: restart transmission service |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
30 |
|
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
31 |
- name: config port |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
32 |
become: yes |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
33 |
lineinfile: |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
34 |
path: "{{transmission_config}}" |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
35 |
regexp: '^ "rpc-port":' |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
36 |
line: " \"rpc-port\": {{transmission_port}}," |
34 | 37 |
insertafter: ",$" |
0
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
38 |
notify: restart transmission service |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
39 |
|
28
d289eab1ea52
Made transmission idempotent.
Luke Hoersten <luke@hoersten.org>
parents:
2
diff
changeset
|
40 |
# the password is hashed at start of server so this always changes |
0
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
41 |
- name: config password |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
42 |
become: yes |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
43 |
lineinfile: |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
44 |
path: "{{transmission_config}}" |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
45 |
regexp: '^ "rpc-password":' |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
46 |
line: " \"rpc-password\": \"{{transmission_passwd}}\"," |
34 | 47 |
insertafter: ",$" |
28
d289eab1ea52
Made transmission idempotent.
Luke Hoersten <luke@hoersten.org>
parents:
2
diff
changeset
|
48 |
changed_when: false |
0
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
49 |
|
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
50 |
- name: config download dir |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
51 |
become: yes |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
52 |
lineinfile: |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
53 |
path: "{{transmission_config}}" |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
54 |
regexp: '^ "download-dir":' |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
55 |
line: " \"download-dir\": \"{{transmission_download_dir}}\"," |
34 | 56 |
insertafter: ",$" |
0
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
57 |
notify: restart transmission service |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
58 |
|
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
59 |
- name: config disable seeding |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
60 |
become: yes |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
61 |
lineinfile: |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
62 |
path: "{{transmission_config}}" |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
63 |
regexp: '^ "idle-seeding-limit":' |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
64 |
line: " \"idle-seeding-limit\": 0," |
34 | 65 |
insertafter: ",$" |
0
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
66 |
notify: restart transmission service |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
67 |
|
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
68 |
- name: config disable seeding |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
69 |
become: yes |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
70 |
lineinfile: |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
71 |
path: "{{transmission_config}}" |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
72 |
regexp: '^ "idle-seeding-limit-enabled":' |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
73 |
line: " \"idle-seeding-limit-enabled\": true," |
34 | 74 |
insertafter: ",$" |
0
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
75 |
notify: restart transmission service |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
76 |
|
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
77 |
- name: start transmission service |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
78 |
systemd: name="transmission-daemon" state="started" daemon_reload="yes" |
df042396074e
Opensourcing raspberry pi roles.
Luke Hoersten <luke@hoersten.org>
parents:
diff
changeset
|
79 |
become: yes |
28
d289eab1ea52
Made transmission idempotent.
Luke Hoersten <luke@hoersten.org>
parents:
2
diff
changeset
|
80 |
changed_when: false |