2017-02-22 15:27:48 +01:00
|
|
|
---
|
|
|
|
# file: roles/vdr/tasks/main.yml
|
|
|
|
|
|
|
|
- name: apt | install basic vdr packages
|
|
|
|
apt:
|
2018-10-05 17:49:39 +02:00
|
|
|
name:
|
|
|
|
- vdr
|
|
|
|
- vdrctl
|
|
|
|
- vdr-plugin-dbus2vdr
|
2017-02-22 15:27:48 +01:00
|
|
|
state: present
|
|
|
|
install_recommends: no
|
2017-07-15 14:28:23 +02:00
|
|
|
- name: add svdrp and svdrp-disc to /etc/services
|
2017-03-01 21:11:56 +01:00
|
|
|
lineinfile:
|
|
|
|
dest: /etc/services
|
|
|
|
state: present
|
2017-07-15 14:28:23 +02:00
|
|
|
line: "{{ item }}"
|
|
|
|
with_items:
|
|
|
|
- "svdrp 6419/tcp"
|
|
|
|
- "svdrp-disc 6419/udp"
|
2017-02-22 15:27:48 +01:00
|
|
|
- name: create vdr recdir
|
|
|
|
file:
|
|
|
|
state: directory
|
|
|
|
owner: '{{ vdr.user }}'
|
|
|
|
group: '{{ vdr.group }}'
|
|
|
|
mode: 0775
|
|
|
|
dest: '{{ vdr.recdir }}'
|
|
|
|
|
|
|
|
- name: set option to use hide-first-recording-level patch
|
|
|
|
blockinfile:
|
|
|
|
dest: /etc/vdr/conf.d/04-vdr-hide-first-recordinglevel.conf
|
|
|
|
create: true
|
2017-12-19 20:10:39 +01:00
|
|
|
state: "{{ 'present' if vdr.hide_first_recording_level else 'absent' }}"
|
2017-02-22 15:27:48 +01:00
|
|
|
block: |
|
|
|
|
[vdr]
|
|
|
|
--hide-first-recording-level
|
|
|
|
|
|
|
|
- name: create local dir in recdir
|
|
|
|
file:
|
|
|
|
state: directory
|
|
|
|
owner: '{{ vdr.user }}'
|
|
|
|
group: '{{ vdr.group }}'
|
|
|
|
mode: '0775'
|
|
|
|
dest: '{{ vdr.recdir }}/local'
|
|
|
|
when:
|
|
|
|
vdr.hide_first_recording_level
|
|
|
|
|
2017-03-13 14:53:07 +01:00
|
|
|
# TODO: set recdir, user etc. in /etc/vdr/conf.d/
|
2017-03-13 15:27:21 +01:00
|
|
|
- name: apt | install additional vdr plugins
|
2017-02-22 15:27:48 +01:00
|
|
|
apt:
|
2018-10-05 17:49:39 +02:00
|
|
|
name: '{{ vdr_plugins | default([]) }}'
|
2017-02-22 15:27:48 +01:00
|
|
|
state: present
|
|
|
|
install_recommends: no
|
2017-03-13 15:27:21 +01:00
|
|
|
notify: [ 'Restart VDR' ]
|
2017-06-21 12:46:51 +02:00
|
|
|
- name: ensure vdr is stopped
|
|
|
|
systemd:
|
|
|
|
name: vdr.service
|
|
|
|
state: stopped
|
|
|
|
notify: [ 'Start VDR' ]
|
|
|
|
|
2017-07-08 13:37:35 +02:00
|
|
|
- name: "vdr configuration | copy remote.conf if it doesn't exist yet"
|
|
|
|
copy:
|
|
|
|
src: files/remote.conf
|
|
|
|
dest: '{{ vdr.confdir }}/remote.conf'
|
|
|
|
owner: '{{ vdr.user }}'
|
|
|
|
group: '{{ vdr.group }}'
|
|
|
|
mode: 0644
|
|
|
|
force: no
|
|
|
|
|
|
|
|
- name: "vdr configuration | copy keymacros.conf if it doesn't exist yet"
|
|
|
|
copy:
|
|
|
|
src: files/keymacros.conf
|
|
|
|
dest: '{{ vdr.confdir }}/keymacros.conf'
|
2017-06-21 12:46:51 +02:00
|
|
|
owner: '{{ vdr.user }}'
|
|
|
|
group: '{{ vdr.group }}'
|
|
|
|
mode: 0644
|
2017-07-08 13:37:35 +02:00
|
|
|
force: no
|
2019-03-18 16:08:37 +01:00
|
|
|
|
2019-03-18 17:09:28 +01:00
|
|
|
- name: "vdr configuration | copy channels.conf if it doesn't exist yet"
|
2019-03-18 16:08:37 +01:00
|
|
|
copy:
|
|
|
|
src: '{{ vdr_channels_conf }}'
|
|
|
|
dest: '{{ vdr.confdir }}/channels.conf'
|
|
|
|
owner: '{{ vdr.user }}'
|
|
|
|
group: '{{ vdr.group }}'
|
|
|
|
mode: 0644
|
|
|
|
force: no
|
|
|
|
when: vdr_channels_conf is defined
|
2019-03-18 17:09:28 +01:00
|
|
|
|
|
|
|
- name: "vdr configuration | download channels.conf if it doesn't exist yet"
|
|
|
|
get_url:
|
|
|
|
url: '{{ vdr_channels_conf_url }}'
|
|
|
|
dest: '{{ vdr.confdir }}/channels.conf'
|
|
|
|
owner: '{{ vdr.user }}'
|
|
|
|
group: '{{ vdr.group }}'
|
|
|
|
mode: 0644
|
|
|
|
force: no
|
|
|
|
when: vdr_channels_conf is not defined and vdr_channels_conf_url is defined
|
2018-02-12 13:09:57 +01:00
|
|
|
- name: create directory for vdr.service systemd drop-in files
|
|
|
|
file:
|
|
|
|
dest: '{{ item }}'
|
|
|
|
state: directory
|
|
|
|
with_items:
|
|
|
|
- "/etc/systemd/system/vdr.service.d/"
|
|
|
|
|
2018-02-12 10:27:01 +01:00
|
|
|
- name: systemd-drop-in | start vdr.service after network-online.target
|
|
|
|
template:
|
|
|
|
src: templates/systemd/network-online.j2
|
|
|
|
dest: /etc/systemd/system/vdr.service.d/network-online.conf
|