Disable user lingering & use system systemd services
This commit is contained in:
parent
d8c4f71c62
commit
42e0ee3182
11 changed files with 117 additions and 19 deletions
|
|
@ -1,20 +1,60 @@
|
|||
# transmission's configuration file does not change while the service is
|
||||
# still running
|
||||
- name: stop transmission daemon
|
||||
become: true
|
||||
systemd:
|
||||
name: transmission
|
||||
name: transmission-daemon
|
||||
state: stopped
|
||||
scope: user
|
||||
|
||||
- name: copy transmission template
|
||||
- name: create transmission directories
|
||||
become: true
|
||||
file:
|
||||
path: '{{ item.path }}'
|
||||
mode: '{{ item.mode }}'
|
||||
owner: '{{ item.owner }}'
|
||||
group: '{{ item.group }}'
|
||||
state: directory
|
||||
loop:
|
||||
- {
|
||||
path: '{{ ansible_env.HOME }}/.config/transmission-daemon',
|
||||
mode: 755,
|
||||
owner: 'sonny',
|
||||
group: 'sonny',
|
||||
}
|
||||
- {
|
||||
path: '/etc/systemd/system/transmission-daemon.service.d',
|
||||
mode: 755,
|
||||
owner: 'root',
|
||||
group: 'root',
|
||||
}
|
||||
|
||||
- name: copy transmission templates
|
||||
become: true
|
||||
template:
|
||||
src: 'templates/transmission.j2'
|
||||
dest: '{{ ansible_env.HOME }}/.config/transmission-daemon/settings.json'
|
||||
mode: '0600'
|
||||
src: '{{ item.src }}'
|
||||
dest: '{{ item.dest }}'
|
||||
mode: '{{ item.mode }}'
|
||||
owner: '{{ item.owner }}'
|
||||
group: '{{ item.group }}'
|
||||
loop:
|
||||
- {
|
||||
src: 'templates/systemd/transmission.j2',
|
||||
dest: '/etc/systemd/system/transmission-daemon.service.d/override.conf',
|
||||
mode: '755',
|
||||
owner: 'root',
|
||||
group: 'root',
|
||||
}
|
||||
- {
|
||||
src: 'templates/transmission.j2',
|
||||
dest: '{{ ansible_env.HOME }}/.config/transmission-daemon/settings.json',
|
||||
mode: '0600',
|
||||
owner: 'sonny',
|
||||
group: 'sonny',
|
||||
}
|
||||
|
||||
- name: start transmission daemon
|
||||
become: true
|
||||
systemd:
|
||||
name: transmission
|
||||
name: transmission-daemon
|
||||
state: started
|
||||
enabled: true
|
||||
scope: user
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue