This commit is contained in:
Luigi Di Carmino 2017-11-13 22:48:10 +01:00
commit 7257d8845a
9 changed files with 5356 additions and 104 deletions

File diff suppressed because it is too large Load Diff

View File

@ -183,6 +183,7 @@ The ~yavdr07.yml~ playbook sets up a fully-featured yaVDR installation:
- autoinstall-pvr350 # install vdr-plugin-pgvr350 if a matching card is detected - autoinstall-pvr350 # install vdr-plugin-pgvr350 if a matching card is detected
- autoinstall-hauppauge-pvr # install vdr-plugin-pvrinput if a matching card is found - autoinstall-hauppauge-pvr # install vdr-plugin-pvrinput if a matching card is found
- autoinstall-dvbsddevice # install vdr-plugin-dvbsddevice if a matching card is detected - autoinstall-dvbsddevice # install vdr-plugin-dvbsddevice if a matching card is detected
- autoinstall-hardware-irmp # install yavdr-hardware-irmp if a matching usb device is detected
- kodi - kodi
- dvd # set up packages and a udev rule to allow kodi and other players - dvd # set up packages and a udev rule to allow kodi and other players
# to play and eject optical media # to play and eject optical media
@ -3250,6 +3251,20 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
when: '"dvb_ttpci" in modules' when: '"dvb_ttpci" in modules'
notify: [ 'Restart VDR' ] notify: [ 'Restart VDR' ]
#+END_SRC #+END_SRC
** autoinstall-hardware-irmp
*** tasks
#+BEGIN_SRC yaml :tangle roles/autoinstall-hardware-irmp/tasks/main.yml :padline no
---
# file roles/autoinstall-hardware-irmp/tasks/main.yml
- name: apt | install yavdr-hardware-irmp if connected
apt:
name: yavdr-hardware-irmp
when: '"1209:4444" in usb'
#+END_SRC
**** TODO add other device ids if necessary
** kodi ** kodi
*** tasks *** tasks
**** Install KODI **** Install KODI
@ -4116,6 +4131,9 @@ if __name__ == '__main__':
#+END_SRC #+END_SRC
* Handlers * Handlers
#+BEGIN_SRC yaml :tangle handlers/main.yml :mkdirp yes #+BEGIN_SRC yaml :tangle handlers/main.yml :mkdirp yes
- name: Reconfigure unattended upgrades with dpkg
command: '/usr/sbin/dpkg-reconfigure --frontend noninteractive unattended-upgrades'
- name: Restart Samba - name: Restart Samba
systemd: systemd:
name: smbd.service name: smbd.service

View File

@ -1,3 +1,6 @@
- name: Reconfigure unattended upgrades with dpkg
command: '/usr/sbin/dpkg-reconfigure --frontend noninteractive unattended-upgrades'
- name: Restart Samba - name: Restart Samba
systemd: systemd:
name: smbd.service name: smbd.service

View File

@ -0,0 +1,3 @@
---
dependencies:
- { role: yavdr-common }

View File

@ -1,8 +0,0 @@
---
# file roles/autoinstall-hardware-irmp/tasks/main.yml
- name: apt | install yavdr-hardware-irmp if connected
apt:
name: yavdr-hardware-irmp
when: '"1209:4444" in usb'
notify: [ 'Restart VDR' ]

View File

@ -1,10 +1,10 @@
--- ---
# file: roles/dvd/tasks/main.yml # file: roles/dvd/tasks/main.yml
- name: preconfigure libdvd-pkg #- name: preconfigure libdvd-pkg
shell: | # shell: |
echo 'libdvd-pkg libdvd-pkg/post-invoke_hook-install boolean true' | debconf-set-selections # echo 'libdvd-pkg libdvd-pkg/post-invoke_hook-install boolean true' | debconf-set-selections
echo 'libdvd-pkg libdvd-pkg/build boolean true' | debconf-set-selections # echo 'libdvd-pkg libdvd-pkg/build boolean true' | debconf-set-selections
- name: apt | install libdvd-pkg - name: apt | install libdvd-pkg
apt: apt:
@ -12,7 +12,18 @@
state: present state: present
install_recommends: no install_recommends: no
with_items: with_items:
- libdvd-pkg - 'libdvd-pkg'
- name: configure package libdvd-pkg
debconf:
name: 'libdvd-pkg'
question: '{{ item }}'
vtype: boolean
value: true
with_items:
- 'libdvd-pkg/post-invoke_hook-install'
- 'libdvd-pkg/build boolean'
notify: ['Reconfigure unattended upgrades with dpkg']
- name: change udev rule to allow KODI to eject optical disks - name: change udev rule to allow KODI to eject optical disks
shell: sed 's/--lock-media //' /lib/udev/rules.d/60-cdrom_id.rules > /etc/udev/rules.d/60-cdrom_id.rules shell: sed 's/--lock-media //' /lib/udev/rules.d/60-cdrom_id.rules > /etc/udev/rules.d/60-cdrom_id.rules

View File

@ -1,2 +1,2 @@
- include: install-kodi.yml tags=install,update,kodi:install - import_tasks: install-kodi.yml tags=install,update,kodi:install
- include: configure-kodi.yml tags=install,update,kodi:configure - import_tasks: configure-kodi.yml tags=install,update,kodi:configure

View File

@ -1,51 +0,0 @@
#!/usr/bin/ env python3
import subprocess
xrandr_data = subprocess.check_output(['xrandr', '-q'], universal_newlines=True)
def print_modelines(resolutions):
if resolutions:
for resolution, refreshrates in reversed(sorted(resolutions.items())):
for refreshrate in refreshrates:
print("{}_{}".format(resolution, refreshrate))
def cleanup_refreshrate(refreshrate):
return refreshrate.replace('+', '').replace('*', '')
resolutions = {}
for line in xrandr_data.splitlines():
if line.startswith('Screen'):
print_modelines(resolutions)
new_connection = False
screen = line.split(':', maxsplit=1)[0].split()[-1]
new_screen = True
print('Screen: {}'.format(screen))
elif new_screen and not new_connection and ' connected ' in line:
connection = line.split()[0]
new_screen = False
new_connection = True
print('Connection: {}'.format(connection))
resolutions = {}
elif new_connection and line.startswith(' '):
resolution, *refreshrates = line.split()
res_x, res_y = resolution.split('x')
resolution = (int(res_x), int(res_y))
r = []
for refreshrate in refreshrates:
if '+' in refreshrate:
current_mode = (resolution,
cleanup_refreshrate(refreshrate))
print('Current Mode: {}@{}'.format(*current_mode))
if '*' in refreshrate:
preferred_mode = (resolution,
cleanup_refreshrate(refreshrate))
print('Preferred Mode: {}@{}'.format(*preferred_mode))
r.append(cleanup_refreshrate(refreshrate))
resolutions[resolution] = r
print_modelines(resolutions)

View File

@ -1,36 +0,0 @@
---
# file: yavdr07.yml
# this playbook sets up a complete yaVDR 0.7 installation
- name: set up yaVDR
hosts: all
become: true
roles:
- yavdr-common # install and configure the basic system
- autoinstall-ubuntu-drivers # use ubuntu-drivers to install proprietary dirvers
# (e.g. nvidia, virtualbox)
# - nvidia-387 # install very recent nvidia-387 from ppa:graphics-drivers/ppa
- vdr # install vdr and related packages
- yavdr-network # enable network client capabilities
- samba-install # install samba server
- samba-config # configure samba server
- nfs-server # install nfs server
- pulseaudio # install pulseaudio
- yavdr-xorg # graphical session
- yavdr-remote # remote configuration files, services and scripts
- autoinstall-satip # install vdr-plugin-satip if a Sat>IP server has been found
- autoinstall-targavfd # install vdr-plugin-targavfd if display is connected
- autoinstall-imonlcd # install vdr-plugin-imonlcd if a matchind display is connected
- autoinstall-pvr350 # install vdr-plugin-pgvr350 if a matching card is detected
- autoinstall-hauppauge-pvr # install vdr-plugin-pvrinput if a matching card is found
- autoinstall-dvbsddevice # install vdr-plugin-dvbsddevice if a matching card is detected
- autoinstall-hardware-irmp # install yavdr-hardware-irmp if a matching usb device was detected
- kodi
- dvd # set up packages and a udev rule to allow kodi and other players
# to play and eject optical media
- grub-config # configure grub
tags:
- always
handlers:
- import_tasks: handlers/main.yml