Add svdrp service definition, improve template

This commit is contained in:
Alexander Grothe 2017-03-01 21:11:56 +01:00
parent e358eb65b7
commit 14a9ea894c
3 changed files with 102 additions and 53 deletions

View File

@ -8,6 +8,7 @@
#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/lib/js/jquery.stickytableheaders.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/readtheorg/js/readtheorg.js"></script>
#+OPTIONS: ^:nil
#+PROPERTY: header-args :mkdirp yes
:END:
* Installing and configuring yaVDR with Ansible
This is an experimental feature which allows to set up a yaVDR installation based on a normal Ubuntu Server 16.04.x installation using [[http://ansible.com][Ansible]].
@ -77,12 +78,15 @@ localhost connection=local
#+END_SRC
* Group Variables
** default text for templates
#+BEGIN_SRC yaml :tangle group_vars/all :mkdirp yes
# file: group_vars/all
# this is the standard text to put in templates
ansible_managed_file: "*** YAVDR: ANSIBLE MANAGED FILE ***"
#+END_SRC
** PPAs
#+BEGIN_SRC yaml :tangle group_vars/all :mkdirp yes
branch: unstable
ppa_owner: 'ppa:yavdr'
# a list of all package repositories to be added to the installation
@ -92,18 +96,24 @@ repositories:
- '{{ ppa_owner }}/{{branch}}-vdr'
- '{{ ppa_owner }}/{{branch}}-yavdr'
- '{{ ppa_owner }}/{{branch}}-kodi'
#+END_SRC
** Drivers
#+BEGIN_SRC yaml :tangle group_vars/all :mkdirp yes
drivers:
sundtek: auto
ddvb-dkms: auto
#+END_SRC
** Media directories
#+BEGIN_SRC yaml :tangle group_vars/all :mkdirp yes
# dictionary of directories for (shared) files. Automatically exported via NFS and Samba if those roles are enabled
media_dirs:
audio: /srv/audio
video: /srv/audio
pictures: /srv/audio
files: /srv/files
#+END_SRC
** VDR user, directories, special configuration and plugins
#+BEGIN_SRC yaml :tangle group_vars/all :mkdirp yes
# properties of the user vdr and vdr-related options
vdr:
user: vdr
@ -123,15 +133,22 @@ vdr_plugins:
- vdr-plugin-restfulapi
- vdr-plugin-softhddevice
#+END_SRC
** Samba
#+BEGIN_SRC yaml :tangle group_vars/all :mkdirp yes
samba:
workgroup: YAVDR
#+END_SRC
** Additional packages
#+BEGIN_SRC yaml :tangle group_vars/all :mkdirp yes
# additional packages you want to install
extra_packages:
- vim
- tree
- w-scan
#+END_SRC
** System pre-configuration
#+BEGIN_SRC yaml :tangle group_vars/all :mkdirp yes
system:
shutdown: poweroff
grub:
@ -361,62 +378,82 @@ if __name__ == '__main__':
#+END_SRC
*** templates
#+BEGIN_SRC shell :tangle roles/yavdr-common/templates/90-norecommends.j2 :mkdirp yes
// {{ ansible_managed_file }}
{{ ansible_managed_file | comment('c') }}
// Recommends are as of now still abused in many packages
APT::Install-Recommends "0";
APT::Install-Suggests "0";
#+END_SRC
** vdr
*** tasks
**** install the basic vdr packages
#+BEGIN_SRC yaml :tangle roles/vdr/tasks/main.yml :mkdirp yes
---
# file: roles/vdr/tasks/main.yml
---
# file: roles/vdr/tasks/main.yml
- name: apt | install basic vdr packages
apt:
name: '{{ item }}'
state: present
install_recommends: no
with_items:
- vdr
- vdrctl
- vdr-plugin-dbus2vdr
- name: apt | install basic vdr packages
apt:
name: '{{ item }}'
state: present
install_recommends: no
with_items:
- vdr
- vdrctl
- vdr-plugin-dbus2vdr
#+END_SRC
**** Add svdrp/svdrp-disc to /etc/services
#+BEGIN_SRC yaml :tangle roles/vdr/tasks/main.yml :mkdirp yes
- name: add svdrp to /etc/services
lineinfile:
dest: /etc/services
state: present
line: "svdrp 6419/tcp"
- name: create vdr recdir
file:
state: directory
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
mode: 0775
dest: '{{ vdr.recdir }}'
- name: add svdrp-disc to /etc/services
lineinfile:
dest: /etc/services
state: present
line: "svdrp-disc 6419/udp"
#+END_SRC
**** Set up the recording directory for the vdr user
#+BEGIN_SRC yaml :tangle roles/vdr/tasks/main.yml :mkdirp yes
- 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
block: |
[vdr]
--hide-first-recording-level
when:
vdr.hide_first_recording_level
- name: set option to use hide-first-recording-level patch
blockinfile:
dest: /etc/vdr/conf.d/04-vdr-hide-first-recordinglevel.conf
create: true
block: |
[vdr]
--hide-first-recording-level
when:
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
- name: install additional vdr plugins
apt:
name: '{{ item }}'
state: present
install_recommends: no
with_items:
'{{ vdr_plugins }}'
- 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
#+END_SRC
**** Install additional vdr plugins
The additional plugins to install can be set in the variable ~{{vdr_plugins}}~ in the group variables
#+BEGIN_SRC yaml :tangle roles/vdr/tasks/main.yml :mkdirp yes
- name: install additional vdr plugins
apt:
name: '{{ item }}'
state: present
install_recommends: no
with_items:
'{{ vdr_plugins | default({}) }}'
#+END_SRC
*** Set up the directories for files in /srv
#+BEGIN_SRC yaml :tangle roles/vdr/tasks/main.yml :mkdirp yes

View File

@ -11,6 +11,18 @@
- vdrctl
- vdr-plugin-dbus2vdr
- name: add svdrp to /etc/services
lineinfile:
dest: /etc/services
state: present
line: "svdrp 6419/tcp"
- name: add svdrp-disc to /etc/services
lineinfile:
dest: /etc/services
state: present
line: "svdrp-disc 6419/udp"
- name: create vdr recdir
file:
state: directory
@ -45,7 +57,7 @@
state: present
install_recommends: no
with_items:
'{{ vdr_plugins }}'
'{{ vdr_plugins | default({}) }}'
- name: create directories for media files
file:

View File

@ -1,4 +1,4 @@
// {{ ansible_managed_file }}
{{ ansible_managed_file | comment('c') }}
// Recommends are as of now still abused in many packages
APT::Install-Recommends "0";
APT::Install-Suggests "0";