From 264f1b311c0b345bbbcb45912703cb29c2eb967a Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Thu, 9 Aug 2018 10:07:20 +0200 Subject: [PATCH 01/20] Revert "use debconf module instead of shell command" openbox autostart calls the autostart script with sh as shell and using ansible's debconf module does not change dash to bash successfully, so for the moment we need to use the shell command instead. This reverts commit 4170935a5aa60a782585ad8beb3369a02f94fb25. --- Manual.org | 20 ++++--------------- roles/grub-config/handlers/main.yml | 5 ----- roles/yavdr-common/tasks/configure_system.yml | 19 ++++-------------- 3 files changed, 8 insertions(+), 36 deletions(-) diff --git a/Manual.org b/Manual.org index f0bc063..04c9ec8 100644 --- a/Manual.org +++ b/Manual.org @@ -461,22 +461,10 @@ yavdr-common executes the following tasks: #+END_SRC ***** Use bash instead of dash #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_system.yml :mkdirp yes -- name: apt | ensure debconf and debconf-utils are installed - apt: - name: "{{ packages }}" - vars: - packages: - - debconf - - debconf-utils - -- name: use bash instead of dash by default - debconf: - name: dash - question: dash/sh - value: 'false' - vtype: select - notify: ['Reconfigure unattended upgrades with dpkg'] - +- name: use bash instead of dash + shell: | + echo "set dash/sh false" | debconf-communicate + dpkg-reconfigure -f noninteractive dash #+END_SRC ***** create user vdr diff --git a/roles/grub-config/handlers/main.yml b/roles/grub-config/handlers/main.yml index 21185fc..b6d741c 100644 --- a/roles/grub-config/handlers/main.yml +++ b/roles/grub-config/handlers/main.yml @@ -1,10 +1,5 @@ --- -- name: Update Initramfs - command: "update-initramfs -u" - failed_when: ('error' in initramfs_register_update.stderr) - register: initramfs_register_update - - name: Update GRUB command: update-grub failed_when: ('error' in grub_register_update.stderr) diff --git a/roles/yavdr-common/tasks/configure_system.yml b/roles/yavdr-common/tasks/configure_system.yml index 37e310a..da3184f 100644 --- a/roles/yavdr-common/tasks/configure_system.yml +++ b/roles/yavdr-common/tasks/configure_system.yml @@ -1,18 +1,7 @@ -- name: apt | ensure debconf and debconf-utils are installed - apt: - name: "{{ packages }}" - vars: - packages: - - debconf - - debconf-utils - -- name: use bash instead of dash by default - debconf: - name: dash - question: dash/sh - value: 'false' - vtype: select - notify: ['Reconfigure unattended upgrades with dpkg'] +- name: use bash instead of dash + shell: | + echo "set dash/sh false" | debconf-communicate + dpkg-reconfigure -f noninteractive dash - name: create vdr group group: gid: '{{ vdr.gid }}' From da6cac8e2436e62ac75cdbd77b0c2e2f77b66457 Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Fri, 10 Aug 2018 08:11:45 +0200 Subject: [PATCH 02/20] Add rules to install drivers to yavdr07-headless.yml --- yavdr07-headless.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/yavdr07-headless.yml b/yavdr07-headless.yml index fa23f82..056cbf9 100644 --- a/yavdr07-headless.yml +++ b/yavdr07-headless.yml @@ -14,7 +14,12 @@ - samba-config - nfs-server - grub-config - - autoinstall-satip + - autoinstall-satip # install vdr-plugin-satip if a Sat>IP server has been found + - autoinstall-pvr350 # install vdr-plugin-pvr350 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-dvbsky-firmware # download and install required firmware files for dvbsky cards + - autoinstall-firmware # download and install firmware files for dvb devices - wakeup tags: - always From fa2e50128d995754cde010b4336f93975b123947 Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Fri, 10 Aug 2018 08:12:24 +0200 Subject: [PATCH 03/20] Add role to install firmware files --- roles/autoinstall-firmware/tasks/main.yml | 20 ++++++++++++++++++-- yavdr07.yml | 5 +++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/roles/autoinstall-firmware/tasks/main.yml b/roles/autoinstall-firmware/tasks/main.yml index c0de959..2e895cd 100644 --- a/roles/autoinstall-firmware/tasks/main.yml +++ b/roles/autoinstall-firmware/tasks/main.yml @@ -2,16 +2,32 @@ # This role provides easyily downloadable firmware files -- name: Firmware for Hauppauge WinTV HD Solo/Duo, PCTV 292e +- name: Firmware dvb-demod-si2168-b40-01.fw for Hauppauge WinTV HD Solo/Duo, PCTV 292e get_url: url: https://github.com/OpenELEC/dvb-firmware/raw/master/firmware/dvb-demod-si2168-b40-01.fw checksum: sha256:8507536630d75a316d0719d6b95c04b90c36baa5b457ad457c9bacadafcef134 dest: /lib/firmware/dvb-demod-si2168-b40-01.fw when: '"2040:0264" in usb or "2013:025f" in usb' -- name: Firmware for Hauppauge WinTV-HVR-930C +- name: Firmware dvb-fe-xc5000-1.6.114.fw for Hauppauge WinTV-HVR-930C get_url: url: https://github.com/OpenELEC/dvb-firmware/raw/master/firmware/dvb-fe-xc5000-1.6.114.fw checksum: sha256:7104bda8df301fe1bd4c09de1708aeb6d0d8e1f9d55505449fecfad82639235f dest: /lib/firmware/dvb-fe-xc5000-1.6.114.fw when: '"2040:1605" in usb' + +- name: Firmware ngenge_18.fw for ngene cards + get_url: + url: http://l4m-daten.de/downloads/firmware/dvb-s2/linux/all/ngene_18.fw + checksum: sha256:213d98ec2cd575eba15d82ee79fed7098e670de43792f8aa773a95cfb7c32060 + dest: /lib/firmware/ngene_18.fw + when: '"ngene" in modules' + notify: reboot required + +- name: Firmware drxk_a3.mc for drxk + get_url: + url: https://github.com/OpenELEC/dvb-firmware/raw/master/firmware/drxk_a3.mc + checksum: sha256:f8956ad6f92a4ce90a6ab94ed23e2f9a27e9317e936fd3e0119778dd28e7e294 + dest: /lib/firmware/drxk_a3.mc + when: '"ngene" in modules or "drxk" in modules' + notify: reboot required diff --git a/yavdr07.yml b/yavdr07.yml index a65f90d..e171680 100644 --- a/yavdr07.yml +++ b/yavdr07.yml @@ -24,13 +24,14 @@ - 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-pvr350 # install vdr-plugin-pvr350 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 is detected - autoinstall-atric-usb # preconfigure lircd for Atric IR-WakeupUSB receiver - autoinstall-yausbir # preconfigure lircd for yaUsbIR receiver - - autoinstall-dvbsky-firmware # download an install required firmware files for dvbsky cards + - autoinstall-dvbsky-firmware # download and install required firmware files for dvbsky cards + - autoinstall-firmware # download and install firmware files for dvb devices - kodi - dvd # set up packages and a udev rule to allow kodi and other players # to play and eject optical media From 840423bacf81422e414e5c9a9b8995fcb4b2ea30 Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Fri, 10 Aug 2018 08:12:49 +0200 Subject: [PATCH 04/20] Add handler to indicate a reboot is required --- handlers/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/handlers/main.yml b/handlers/main.yml index eb5b1fe..3a5f8b9 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -77,3 +77,7 @@ name: x@vt7.service state: stopped register: x_stop + +- name: reboot required + debug: + msg: PLEASE REBOOT YOUR SYSTEM. From 88d16009c7e40578346ad46e1b44f7c5fd937af1 Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Fri, 10 Aug 2018 08:13:21 +0200 Subject: [PATCH 05/20] Fix some spelling errors --- Manual.org | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Manual.org b/Manual.org index 04c9ec8..37bc587 100644 --- a/Manual.org +++ b/Manual.org @@ -185,13 +185,14 @@ The ~yavdr07.yml~ playbook sets up a fully-featured yaVDR installation: - 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-pvr350 # install vdr-plugin-pvr350 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 is detected - autoinstall-atric-usb # preconfigure lircd for Atric IR-WakeupUSB receiver - autoinstall-yausbir # preconfigure lircd for yaUsbIR receiver - - autoinstall-dvbsky-firmware # download an install required firmware files for dvbsky cards + - autoinstall-dvbsky-firmware # download and install required firmware files for dvbsky cards + - autoinstall-firmware # download and install firmware files for dvb devices - kodi - dvd # set up packages and a udev rule to allow kodi and other players # to play and eject optical media @@ -220,7 +221,12 @@ For a headless server installation ~yavdr07-headless.yml~ is a good choice - samba-config - nfs-server - grub-config - - autoinstall-satip + - autoinstall-satip # install vdr-plugin-satip if a Sat>IP server has been found + - autoinstall-pvr350 # install vdr-plugin-pvr350 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-dvbsky-firmware # download and install required firmware files for dvbsky cards + - autoinstall-firmware # download and install firmware files for dvb devices - wakeup tags: - always From e4eebf2e2d6f1c06f55de4025f5fc1f1da98fc82 Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Fri, 10 Aug 2018 08:13:44 +0200 Subject: [PATCH 06/20] Add handler to update initramfs --- roles/grub-config/handlers/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/roles/grub-config/handlers/main.yml b/roles/grub-config/handlers/main.yml index b6d741c..21185fc 100644 --- a/roles/grub-config/handlers/main.yml +++ b/roles/grub-config/handlers/main.yml @@ -1,5 +1,10 @@ --- +- name: Update Initramfs + command: "update-initramfs -u" + failed_when: ('error' in initramfs_register_update.stderr) + register: initramfs_register_update + - name: Update GRUB command: update-grub failed_when: ('error' in grub_register_update.stderr) From 9d9ac03f5d784caacd0965f0028b0ab65faca26e Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Fri, 10 Aug 2018 08:13:55 +0200 Subject: [PATCH 07/20] Update Manual.org and Manual.html --- Manual.html | 2561 +++++++++++++++++++++++++++++++++++---------------- Manual.org | 24 +- 2 files changed, 1781 insertions(+), 804 deletions(-) diff --git a/Manual.html b/Manual.html index 3ce8839..41263e1 100644 --- a/Manual.html +++ b/Manual.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Ansible Playbooks for yaVDR 0.7 @@ -240,260 +240,261 @@ for the JavaScript code in this tag.

Inhaltsverzeichnis

-
-

1 User Stories

+
+

1 User Stories

-
-

1.1 yavdr-full

+
+

1.1 yavdr-full

A User wants to install yaVDR without customization and relies on full automation. @@ -526,22 +527,22 @@ Several roles are used to tie everything together:

-
-

1.1.1 Using vdr, pulseaudio and xorg together

+
+

1.1.1 Using vdr, pulseaudio and xorg together

-
-

2 Introduction

+
+

2 Introduction

One of the major problems we faced with customized Ubuntu ISO files as installation media for prior yaVDR versions has been the limited hardware support and the time consuming process to create and update them. An interesting alternative to this approach is to enable the user to choose the installation medium by himself, so point releases, kernel versions and additional drivers can be chosen deliberately. After the basic setup is complete (and a working internet connection is available), a fully customizable install script completes the yaVDR installation.

-
-

3 Installing and configuring yaVDR with Ansible

+
+

3 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 Ansible. @@ -576,11 +577,11 @@ We use a callback to generate tags for all roles autmatically:

-
-

3.1 Install script for local usage

+
+

3.1 Install script for local usage

-
if (( $EUID != 0 )); then
+
if (( $EUID != 0 )); then
     echo "This script must be run using sudo -H or as root"
     exit
 fi
@@ -598,12 +599,12 @@ ansible-playbook yavdr07.yml -b -i 'localhost_inventory
 
-
-

4 Playbooks

+
+

4 Playbooks

-
-

4.1 yavdr07.yml

+
+

4.1 yavdr07.yml

The yavdr07.yml playbook sets up a fully-featured yaVDR installation: @@ -635,13 +636,14 @@ The yavdr07.yml playbook sets up a fully-featured yaVDR installatio - 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-pvr350 # install vdr-plugin-pvr350 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 is detected - autoinstall-atric-usb # preconfigure lircd for Atric IR-WakeupUSB receiver - autoinstall-yausbir # preconfigure lircd for yaUsbIR receiver - - autoinstall-dvbsky-firmware # download an install required firmware files for dvbsky cards + - autoinstall-dvbsky-firmware # download and install required firmware files for dvbsky cards + - autoinstall-firmware # download and install firmware files for dvb devices - kodi - dvd # set up packages and a udev rule to allow kodi and other players # to play and eject optical media @@ -654,8 +656,8 @@ The yavdr07.yml playbook sets up a fully-featured yaVDR installatio

-
-

4.2 yavdr07-headless.yml

+
+

4.2 yavdr07-headless.yml

For a headless server installation yavdr07-headless.yml is a good choice @@ -677,7 +679,12 @@ For a headless server installation yavdr07-headless.yml is a good c - samba-config - nfs-server - grub-config - - autoinstall-satip + - autoinstall-satip # install vdr-plugin-satip if a Sat>IP server has been found + - autoinstall-pvr350 # install vdr-plugin-pvr350 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-dvbsky-firmware # download and install required firmware files for dvbsky cards + - autoinstall-firmware # download and install firmware files for dvb devices - wakeup tags: - always @@ -688,8 +695,8 @@ For a headless server installation yavdr07-headless.yml is a good c

-
-

5 Hosts

+
+

5 Hosts

This playbook can either be used to run the installation on the localhost or any other PC in the network that can be accessed via ssh. Simply add the host names or IP addresses to the hosts file in the respective section: @@ -703,12 +710,12 @@ This playbook can either be used to run the installation on the localhost or any

-
-

6 Group Variables

+
+

6 Group Variables

-
-

6.1 PPAs

+
+

6.1 PPAs

---
@@ -726,8 +733,8 @@ This playbook can either be used to run the installation on the localhost or any
 
-
-

6.2 VDR user, directories, special configuration and plugins

+
+

6.2 VDR user, directories, special configuration and plugins

# properties of the user vdr and vdr-related options
@@ -748,14 +755,13 @@ This playbook can either be used to run the installation on the localhost or any
 vdr_plugins:
   - vdr-plugin-devstatus
   - vdr-plugin-markad
-  - vdr-plugin-restfulapi
   - vdr-plugin-softhddevice-vpp
 
-
-

6.3 Media directories

+
+

6.3 Media directories

# dictionary of directories for (shared) files. Automatically exported via NFS and Samba if those roles are enabled
@@ -770,8 +776,8 @@ This playbook can either be used to run the installation on the localhost or any
 
-
-

6.4 NFS

+
+

6.4 NFS

nfs:
@@ -780,8 +786,8 @@ This playbook can either be used to run the installation on the localhost or any
 
-
-

6.5 Samba

+
+

6.5 Samba

samba:
@@ -791,8 +797,8 @@ This playbook can either be used to run the installation on the localhost or any
 
-
-

6.6 Additional packages

+
+

6.6 Additional packages

# additional packages you want to install
@@ -808,8 +814,8 @@ This playbook can either be used to run the installation on the localhost or any
 
-
-

6.7 System pre-configuration

+
+

6.7 System pre-configuration

frontend: vdr
@@ -824,20 +830,20 @@ This playbook can either be used to run the installation on the localhost or any
 
-
-

7 Roles

+
+

7 Roles

-
-

7.1 install-dependencies

+
+

7.1 install-dependencies

-
-

7.1.1 tasks

+
+

7.1.1 tasks

    -
  1. main.yml
    +
  2. main.yml
    ---
    @@ -858,19 +864,19 @@ This playbook can either be used to run the installation on the localhost or any
     
    -
    -

    7.2 nvidia experimental drivers

    +
    +

    7.2 nvidia experimental drivers

    install nvidia-396 from ppa:graphics-drivers/ppa

    -
    -

    7.2.1 tasks

    +
    +

    7.2.1 tasks

      -
    1. main.yml
      +
    2. main.yml
      ---
      @@ -900,15 +906,15 @@ install nvidia-396 from ppa:graphics-drivers/ppa
       
    -
    -

    7.3 yavdr-common

    +
    +

    7.3 yavdr-common

    This role is used to set up a basic yaVDR installation. It creates the directories, installs the vdr and other useful packages.

    -
    -

    7.3.1 default variables

    +
    +

    7.3.1 default variables

    This section is for reference only, please use the files in global_vars for customizations. @@ -921,7 +927,7 @@ This section is for reference only, please use the files in global_vars

      -
    1. Repositories
      +
    2. Repositories

      You can set a list of package repositories which provide the necessary packages. Feel free to use own PPAs if you need special customization to the VDR and it’s plugins. @@ -938,7 +944,7 @@ You can set a list of package repositories which provide the necessary packages.

  3. -
  4. Drivers
    +
  5. Drivers

    Automatically installed drivers can be very useful, but if you know you need a certain driver, you can simply set it’s value to true. If you don’t want a driver to be installed, set it’s value to false. @@ -951,7 +957,7 @@ Automatically installed drivers can be very useful, but if you know you need a c

-
  • Additional Packages
    +
  • Additional Packages

    Add additional packages you would like to have on your installation to this list @@ -965,7 +971,7 @@ Add additional packages you would like to have on your installation to this list

  • -
  • VDR
    +
  • VDR

    This section allows you to set the recording directory, the user and group that runs the vdr and it’s home directory. @@ -998,15 +1004,15 @@ This section allows you to set the recording directory, the user and group that

  • -
    -

    7.3.2 tasks

    +
    +

    7.3.2 tasks

    yavdr-common executes the following tasks:

      -
    1. main.yml
      +
    2. main.yml
      ---
      @@ -1023,7 +1029,7 @@ yavdr-common executes the following tasks:
       
        -
      1. Disable default installation of recommended packages
        +
      2. Disable default installation of recommended packages

        This task prevents apt to automatically install all recommended dependencies for packages: @@ -1040,14 +1046,14 @@ This task prevents apt to automatically install all recommended dependencies for

    -
  • Set up package repositories
    +
  • Set up package repositories
    - name: add PPAs
       apt_repository:
           repo: '{{ item }}'
           state: present
    -      update_cache: yes
    +      update_cache: no
       with_items: '{{ repositories }}'
       tags:
         - ppa
    @@ -1060,7 +1066,7 @@ This task prevents apt to automatically install all recommended dependencies for
     
  • -
  • Use bash instead of dash
    +
  • Use bash instead of dash
    - name: use bash instead of dash
    @@ -1072,10 +1078,10 @@ This task prevents apt to automatically install all recommended dependencies for
     
  • -
  • create user vdr
  • -
  • Disable release-upgrade notifications
    +
  • create user vdr
  • +
  • Disable release-upgrade notifications
      -
    1. SOMEDAY move from lineinfile to template
      +
    2. SOMEDAY move from lineinfile to template
      - name: disable release-upgrade notifications
      @@ -1097,7 +1103,7 @@ This task prevents apt to automatically install all recommended dependencies for
       
  • -
  • Install essential packages
    +
  • Install essential packages
    - name: apt | install basic packages
    @@ -1129,7 +1135,7 @@ This task prevents apt to automatically install all recommended dependencies for
     
  • -
  • Install additional packages (user defined)
    +
  • Install additional packages (user defined)
    - name: apt | install extra packages
    @@ -1143,17 +1149,17 @@ This task prevents apt to automatically install all recommended dependencies for
     
  • -
  • create directories
  • -
  • create sudoers drop-in for vdr
  • +
  • create directories
  • +
  • create sudoers drop-in for vdr
  • -
    -

    7.3.3 templates

    +
    +

    7.3.3 templates

    -
    {{ ansible_managed | comment('c') }}
    +
    {{ ansible_managed | comment('c') }}
     // Recommends are as of now still abused in many packages
     APT::Install-Recommends "0";
     APT::Install-Suggests "0";
    @@ -1161,14 +1167,14 @@ APT::Install-Suggests "0";
     
      -
    1. yavdr sudoers drop-in
      +
    2. yavdr sudoers drop-in

      Allow the vdr user to restart vdr.service and reboot the system

      -
      {{ vdr.user }} ALL=NOPASSWD: /bin/systemctl --no-block restart vdr.service
      -{{ vdr.user }} ALL=NOPASSWD: /bin/systemctl --no-block reboot
      +
      {{ vdr.user }} ALL=NOPASSWD: /bin/systemctl --no-block restart vdr.service
      +{{ vdr.user }} ALL=NOPASSWD: /bin/systemctl --no-block reboot
       
      @@ -1176,12 +1182,12 @@ Allow the vdr user to restart vdr.service and reboot the system
    -
    -

    7.4 collect facts about the system with custom modules

    +
    +

    7.4 collect facts about the system with custom modules

    -
    -

    7.4.1 variables

    +
    +

    7.4.1 variables

    first_run: False
    @@ -1189,12 +1195,12 @@ Allow the vdr user to restart vdr.service and reboot the system
     
    -
    -

    7.4.2 tasks

    +
    +

    7.4.2 tasks

      -
    1. main.yml
      +
    2. main.yml
      - name: get information about usb and pci hardware and loaded kernel modules
      @@ -1234,16 +1240,16 @@ Allow the vdr user to restart vdr.service and reboot the system
       
    -
    -

    7.5 vdr

    +
    +

    7.5 vdr

    -
    -

    7.5.1 tasks

    +
    +

    7.5.1 tasks

      -
    1. install the basic vdr packages
      +
    2. install the basic vdr packages
      ---
      @@ -1262,7 +1268,7 @@ Allow the vdr user to restart vdr.service and reboot the system
       
    3. -
    4. Add svdrp/svdrp-disc to /etc/services
      +
    5. Add svdrp/svdrp-disc to /etc/services
      - name: add svdrp and svdrp-disc to /etc/services
      @@ -1277,7 +1283,7 @@ Allow the vdr user to restart vdr.service and reboot the system
       
    6. -
    7. Set up the recording directory for the vdr user
      +
    8. Set up the recording directory for the vdr user
      - name: create vdr recdir
      @@ -1312,7 +1318,7 @@ Allow the vdr user to restart vdr.service and reboot the system
       
    9. -
    10. Install additional vdr plugins
      +
    11. Install additional vdr plugins

      The additional plugins to install can be set in the variable {{vdr_plugins}} in the group variables @@ -1330,7 +1336,7 @@ The additional plugins to install can be set in the variable {{vdr_plugins

    -
  • copy vdr configuration files (if they don’t exist yet)
    +
  • copy vdr configuration files (if they don’t exist yet)
    - name: ensure vdr is stopped
    @@ -1361,7 +1367,7 @@ The additional plugins to install can be set in the variable {{vdr_plugins
     
  • -
  • start vdr after network-online.target
    +
  • start vdr after network-online.target
    - name: create directory for vdr.service systemd drop-in files
    @@ -1382,8 +1388,8 @@ The additional plugins to install can be set in the variable {{vdr_plugins
     
     
    -
    -

    7.5.2 templates

    +
    +

    7.5.2 templates

    Start after network-online.target @@ -1395,12 +1401,12 @@ Start after network-online.target

    -
    -

    7.5.3 files

    +
    +

    7.5.3 files

      -
    1. remote.conf
      +
    2. remote.conf
      LIRC.Up KEY_UP
      @@ -1535,7 +1541,7 @@ XKeySym.Next       XF86AudioNext
       
    3. -
    4. keymacros.conf
      +
    5. keymacros.conf
      # Remote control key macros for VDR
      @@ -1561,12 +1567,12 @@ User0     @osdteletext
       
    -
    -

    7.6 STARTED yavdr-network

    +
    +

    7.6 STARTED yavdr-network

    -
    -

    7.6.1 default variables

    +
    +

    7.6.1 default variables

    install_avahi: true
    @@ -1574,8 +1580,8 @@ User0     @osdteletext
     
    -
    -

    7.6.2 tasks

    +
    +

    7.6.2 tasks

    ---
    @@ -1645,15 +1651,15 @@ User0     @osdteletext
     
    -
    -

    7.7 nfs-server

    +
    +

    7.7 nfs-server

    -
    -

    7.7.1 TODO avahi-services für NFS beim Stoppen des nfs-kernel-servers depublizieren, beim Start wieder announcen

    +
    +

    7.7.1 TODO avahi-services für NFS beim Stoppen des nfs-kernel-servers depublizieren, beim Start wieder announcen

    -
    -

    7.7.2 tasks

    +
    +

    7.7.2 tasks

    ---
    @@ -1682,12 +1688,12 @@ User0     @osdteletext
     
    -
    -

    7.7.3 templates

    +
    +

    7.7.3 templates

      -
    1. /etc/exports
      +
    2. /etc/exports
      /srv *(rw,fsid=0,sync,no_subtree_check,all_squash,anongid={{ vdr.gid }},anonuid={{ vdr.uid }})
      @@ -1698,7 +1704,7 @@ User0     @osdteletext
       
    3. -
    4. avahi services
      +
    5. avahi services
      <?xml version="1.0" standalone='no'?>
      @@ -1719,12 +1725,13 @@ User0     @osdteletext
       
    -
    -

    7.8 STARTED yavdr-remote

    + +
    +

    7.8 STARTED yavdr-remote

    -
    -

    7.8.1 default variables

    +
    +

    7.8.1 default variables

    lircd0_socket: /var/run/lirc/lircd0
    @@ -1732,8 +1739,8 @@ User0     @osdteletext
     
    -
    -

    7.8.2 tasks

    +
    +

    7.8.2 tasks

    ---
    @@ -1806,12 +1813,12 @@ User0     @osdteletext
     
    -
    -

    7.8.3 templates

    +
    +

    7.8.3 templates

      -
    1. Systemd Drop-in to start vdr with lirc support
      +
    2. Systemd Drop-in to start vdr with lirc support
      {% if frontend != 'kodi' %}
      @@ -1822,7 +1829,7 @@ User0     @osdteletext
       
    3. -
    4. Systemd Drop-in to start lircd2uinput with lircd
      +
    5. Systemd Drop-in to start lircd2uinput with lircd
      [Service]
      @@ -1832,10 +1839,11 @@ User0     @osdteletext
       
    6. -
    7. create /etc/rc_maps.cfg
      +
    8. create /etc/rc_maps.cfg
      -
      #
      +
      {{ ansible_managed | comment }}
      +#
       # Keymaps table
       #
       # This table creates an association between a keycode file and a kernel
      @@ -2023,17 +2031,17 @@ ati_remote    rc-medion-x10-digitainer   /lib/udev/rc_keymaps/rc-medion-x10-digi
       
    -
    -

    7.8.4 files

    +
    +

    7.8.4 files

    -
    -

    7.9 pulseaudio

    +
    +

    7.9 pulseaudio

    -
    -

    7.9.1 tasks

    +
    +

    7.9.1 tasks

    ---
    @@ -2056,8 +2064,8 @@ ati_remote    rc-medion-x10-digitainer   /lib/udev/rc_keymaps/rc-medion-x10-digi
     
    -
    -

    7.9.2 templates

    +
    +

    7.9.2 templates

    # Use PulseAudio by default
    @@ -2079,12 +2087,13 @@ ati_remote    rc-medion-x10-digitainer   /lib/udev/rc_keymaps/rc-medion-x10-digi
     
    -
    -

    7.10 yavdr-xorg

    + +
    +

    7.10 yavdr-xorg

    -
    -

    7.10.1 About the GUI session

    +
    +

    7.10.1 About the GUI session

    The X-Server is started by using the two systemd units xlogin@.service and x@.service provided by the package xlogin. The former is enabled (and started) for the vdr user - which results (using the default settings for the user vdr with the uid 666) in the activation of xlogin@vdr.service when reaching the graphical.target. To simplify starting and stopping the X-server and the desktop session a yavdr-xorg.service is provided by the package yavdr-xorg, which depends on the two units mentioned before. @@ -2113,8 +2122,8 @@ In order to achive a clean shutdown of the session, x@t7.service is

    -
    -

    7.10.2 default variables

    +
    +

    7.10.2 default variables

    first_run: False
    @@ -2137,12 +2146,12 @@ In order to achive a clean shutdown of the session, x@t7.service is
     
    -
    -

    7.10.3 tasks

    +
    +

    7.10.3 tasks

      -
    1. main.yml
      +
    2. main.yml
      ---
      @@ -2155,7 +2164,7 @@ In order to achive a clean shutdown of the session, x@t7.service is
       
    3. -
    4. setup-xorg.yml
      +
    5. setup-xorg.yml
      ---
      @@ -2276,7 +2285,7 @@ In order to achive a clean shutdown of the session, x@t7.service is
       
    6. -
    7. detect-xorg.yml
      +
    8. detect-xorg.yml
      ---
      @@ -2432,21 +2441,76 @@ In order to achive a clean shutdown of the session, x@t7.service is
         when:
           - nvidia_detected
       
      +
      +
      +
      +
    9. +
    10. intel.yml
      +
      +

      +KMS drivers (like for intel (i915) and amd (radeon)) require additional configuration beneath a customized xorg.conf - for a „static“ output configuration (which works if the TV or AV receiver is not turned on) we need to force loading the display(s) EDID early during the boot process. +

      + +

      +This task therefore performs the following actions after the xrandr detection has been executed: +

      +
        +
      • create an initramfs-hook to copy the EDID(s) into the initramfs
      • +
      • get the connector names and match them to the ones determined by xrandr
      • +
      • add kernel boot arguments to set EDID and mode (refreshrate and resolution) for all outputs
      • +
      • recreate and update initramfs and grub config
      • +
      + +

      +Please note that rescanning the connected displays works only after removing the forced loading of EDID(s) during boot (call clean-edids) and a reboot. +

      +
      +
      - name: "create initramfs hook to copy EDID files"
      +  copy:
      +    src: files/include-edid-data.sh
      +    dest: '/etc/initramfs-tools/hooks/include-edid-data'
      +    mode: 0755
      +    force: yes
      +
      +- name: "create /lib/firmware/edid"
      +  file:
      +    state: directory
      +    dest: /lib/firmware/edid
      +# TODO:
      +# - write EDID files to /lib/firmware/edid/
      +# - complete template for grub.d
      +name: "add kernel boot parameters for static display configuration"
      +template:
      +  src: templates/grub.d/intel.j2
      +  dest: /etc/grub.d/99_intel
      +  mode: 0755
      +  notify: ['Update Initramfs', 'Update GRUB']
      +
       
    -
    -

    7.10.4 templates

    +
    +

    7.10.4 templates

      -
    1. xorg
      +
    2. grub
      +
      +
      +
      {% set output_flag = 'D' if ("HDMI" in xorg.primary.connector or "DVI" in xorg.primary.connector or "DP" in xorg.primary.connector) else 'e' %} 
      +GRUB_CMDLINE_LINUX+=" video={{ xorg.primary.drm_connector }}:{{ xorg.primary.mode|replace('_', '@') }}{{ output_flag }} drm.edid_firmware={{ xorg.primary.drm_connector }}:edid/edid.bin"
      +# TODO: configure additional monitors (second monitor on, all others off)
      +
      +
      +
      +
    3. +
    4. xorg
        -
      1. x-verbose@.service
        -
        +
      2. x-verbose@.service
        +
        # file: roles/yavdr-xorg/templates/systemd/system/x-verbose@.service.j2
         [Unit]
        @@ -2461,8 +2525,8 @@ In order to achive a clean shutdown of the session, x@t7.service is
         
      3. -
      4. Drop-in snippet for x@.service
        -
        +
      5. Drop-in snippet for x@.service
        +
        [Unit]
         After=plymouth.service
        @@ -2487,8 +2551,8 @@ In order to achive a clean shutdown of the session, x@t7.service is
         
      6. -
      7. Drop-in snippet for vdr.service
        -
        +
      8. Drop-in snippet for vdr.service
        +
        {{ ansible_managed | comment }}
         [Unit]
        @@ -2499,8 +2563,8 @@ In order to achive a clean shutdown of the session, x@t7.service is
         
      9. -
      10. xorg.conf snippets
        -
        +
      11. xorg.conf snippets
        +
        {{ ansible_managed | comment }}
         
        @@ -2513,8 +2577,8 @@ EndSection
         
      12. -
      13. xorg.conf
        -
        +
      14. xorg.conf
        +
        Section "Device"
                 Identifier "nvidia"
        @@ -2640,14 +2704,14 @@ EndSection
         
        -
        {{ ansible_managed | comment }}
        +
        {{ ansible_managed | comment }}
         
         Section "ServerLayout"
             Identifier     "Layout0"
             Screen      0  "Screen0"
        -    {% if xorg.best_tv_mode.secondary is defined %}
        +    {% if xorg.best_tv_mode.secondary is defined %}
             Screen      1  "Screen1" RightOf "Screen0"
        -    {% endif %}
        +    {% endif %}
             InputDevice    "Keyboard0" "CoreKeyboard"
             InputDevice    "Mouse0" "CorePointer"
         EndSection
        @@ -2684,54 +2748,54 @@ Section "Monitor"
             Identifier     "Monitor0"
             VendorName     "Unknown"
             ModelName      "Unknown"
        -{# TODO: VGA2SCART support (if needed)
        -{% if system.x11.display.0.default == "VGA2Scart_4_3" or system.x11.display.0.default == "VGA2Scart_16_9" %}
        +{# TODO: VGA2SCART support (if needed)
        +{% if system.x11.display.0.default == "VGA2Scart_4_3" or system.x11.display.0.default == "VGA2Scart_16_9" %}
             HorizSync       14-17
             VertRefresh     49-61
        -    {% if system.x11.display.0.default == "VGA2Scart_4_3" %}
        +    {% if system.x11.display.0.default == "VGA2Scart_4_3" %}
             Modeline "VGA2Scart_4_3" 13.875 720 744 808 888 576 580 585 625 -HSync -Vsync interlace
        -    {% elif system.x11.display.0.default == "VGA2Scart_16_9" %}
        +    {% elif system.x11.display.0.default == "VGA2Scart_16_9" %}
             Modeline "VGA2Scart_16_9" 19 1024 1032 1120 1216 576 581 586 625 -Hsync -Vsync interlace
        -    {% endif %}
        -{% endif %}
        +    {% endif %}
        +{% endif %}
         #}
             Option         "DPMS"
             Option         "ExactModeTimingsDVI" "True"
         EndSection
         
         
        -{% if xrandr.best_tv_mode.secondary is defined %}
        +{% if xrandr.best_tv_mode.secondary is defined %}
         Section "Monitor"
             Identifier     "Monitor1"
             VendorName     "Unknown"
             ModelName      "Unknown"
        -{#
        -{% if system.x11.display.1.default in ("VGA2Scart_4_3",  "VGA2Scart_16_9") %}
        +{#
        +{% if system.x11.display.1.default in ("VGA2Scart_4_3",  "VGA2Scart_16_9") %}
             HorizSync       14-17
             VertRefresh     49-61
        -    {% if system.x11.display.1.default == "VGA2Scart_4_3" %}
        +    {% if system.x11.display.1.default == "VGA2Scart_4_3" %}
             Modeline "VGA2Scart_4_3" 13.875 720 744 808 888 576 580 585 625 -HSync -Vsync interlace
        -    {% elif system.x11.display.1.default == "VGA2Scart_16_9" %}
        +    {% elif system.x11.display.1.default == "VGA2Scart_16_9" %}
             Modeline "VGA2Scart_16_9" 19 1024 1032 1120 1216 576 581 586 625 -Hsync -Vsync interlace
        -    {% endif %}
        +    {% endif %}
             Option         "DPMS"
             Option         "ExactModeTimingsDVI" "True"
        -{% endif %}
        +{% endif %}
         #}
         EndSection
        -{% endif %}
        +{% endif %}
         
         Section "Device"
             Identifier     "Device0"
        -{% if system.hardware.nvidia.detected %}
        +{% if system.hardware.nvidia.detected %}
             Driver         "nvidia"
             VendorName     "NVIDIA Corporation"
        -{% endif %}
        +{% endif %}
             Screen          0
             Option         "DPI" "100x100"
        -{% if system.hardware.nvidia.busid is defined and system.hardware.busid %}
        +{% if system.hardware.nvidia.busid is defined and system.hardware.busid %}
             BusID          "PCI: {{ system.hardware.nvidia.busid }}"
        -{% endif %}
        +{% endif %}
             Option         "NoLogo" "True"
             Option         "UseEvents" "True"
             Option         "TripleBuffer" "False"
        @@ -2742,17 +2806,17 @@ Section "Device"
             Option         "FlatPanelProperties" "Scaling = Native"
         EndSection
         
        -{% if xrandr.best_tv_mode.secondary is defined %}
        +{% if xrandr.best_tv_mode.secondary is defined %}
         Section "Device"
             Identifier     "Device1"
        -    {% if system.hardware.nvidia.detected %}
        +    {% if system.hardware.nvidia.detected %}
             Driver         "nvidia"
             VendorName     "NVIDIA Corporation"
        -    {% endif %}
        +    {% endif %}
             Screen          1
        -    {% if system.hardware.nvidia.busid is defined and system.hardware.nvidia.busid %}
        +    {% if system.hardware.nvidia.busid is defined and system.hardware.nvidia.busid %}
             BusID          "PCI: {{ system.hardware.nvidia.busid }}"
        -    {% endif %}
        +    {% endif %}
             Option         "NoLogo" "True"
             Option         "UseEvents" "True"
             Option         "TripleBuffer" "False"
        @@ -2760,7 +2824,7 @@ Section "Device"
             Option         "TwinView" "0"
             Option         "DynamicTwinView" "0"
         EndSection
        -{% endif %}
        +{% endif %}
         
         
         Section "Screen"
        @@ -2770,19 +2834,19 @@ Section "Screen"
             DefaultDepth    24
             SubSection     "Display"
                 Depth       24
        -{% if xrandr.best_tv_mode.primary is defined %}
        -        Modes      "{{ xrandr.best_tv_mode.primary.mode }}"{#{% for mode in xrandr %}{% if mode != system.x11.display.0.default %} "{{ mode }}"{% endif %}{% endfor %}#} nvidia-auto-select
        +{% if xrandr.best_tv_mode.primary is defined %}
        +        Modes      "{{ xrandr.best_tv_mode.primary.mode }}"{#{% for mode in xrandr %}{% if mode != system.x11.display.0.default %} "{{ mode }}"{% endif %}{% endfor %}#} nvidia-auto-select
         
        -{% elif system.hardware.nvidia.detected == 1 %}
        +{% elif system.hardware.nvidia.detected == 1 %}
                 Modes      "nvidia-auto-select"
        -{% endif %}
        +{% endif %}
             EndSubSection
        -{% if system.x11.display.0.default or system.x11.default %}
        -    {% if system.x11.display.0.device is definded and system.x11.display.0.device %}
        -    Option         "ConnectedMonitor" {{ system.x11.display.0.device }}
        -    {% else %}
        -    Option         "ConnectedMonitor" {{ system.x11.default }}
        -    {% endif %}
        +{% if system.x11.display.0.default or system.x11.default %}
        +    {% if system.x11.display.0.device is definded and system.x11.display.0.device %}
        +    Option         "ConnectedMonitor" {{ system.x11.display.0.device }}
        +    {% else %}
        +    Option         "ConnectedMonitor" {{ system.x11.default }}
        +    {% endif %}
             #     Option         "ConnectedMonitor" "<?cs if:(?system.x11.display.0.device) ?><?cs call:fix_display_name(system.x11.display.0.device) ?><?cs else ?><?cs var:system.x11.default ?><?cs /if ?><?cs if:(?system.x11.dualhead.enabled && system.x11.dualhead.enabled == 1) ?>, <?cs call:fix_display_name(system.x11.display.1.device) ?><?cs /if ?>"
             #Option         "ConnectedMonitor"
             "<?cs if:(?system.x11.display.0.device) ?>
        @@ -2800,10 +2864,10 @@ Section "Screen"
         #     Option          "MetaModes" "<?cs call:fix_display_name(system.x11.display.0.device) ?>: <?cs var:system.x11.display.0.default ?> { ViewPortIn=<?cs var:system.x11.display.0.viewport.in.x ?>x<?cs var:system.x11.display.0.viewport.in.y ?>, ViewPortOut=<?cs var:system.x11.display.0.viewport.out.x ?>x<?cs var:system.x11.display.0.viewport.out.y ?>+<?cs var:system.x11.display.0.viewport.out.plusx ?>+<?cs var:system.x11.display.0.viewport.out.plusy ?> }"
         # <?cs each:mode = system.x11.display.0.mode ?><?cs if:(mode != system.x11.display.0.default) ?>
         #     Option          "MetaModes" "<?cs call:fix_display_name(system.x11.display.0.device) ?>: <?cs var:mode ?> { ViewPortIn=<?cs var:system.x11.display.0.viewport.in.x ?>x<?cs var:system.x11.display.0.viewport.in.y ?>, ViewPortOut=<?cs var:system.x11.display.0.viewport.out.x ?>x<?cs var:system.x11.display.0.viewport.out.y ?>+<?cs var:system.x11.display.0.viewport.out.plusx ?>+<?cs var:system.x11.display.0.viewport.out.plusy ?> }"<?cs /if ?><?cs /each ?> 
        -{% endif %}
        +{% endif %}
         EndSection
         
        -{% if system.x11.dualhead.enabled == "1" %}
        +{% if system.x11.dualhead.enabled == "1" %}
         Section "Screen"
         
              Identifier     "Screen1"
        @@ -2812,12 +2876,12 @@ Section "Screen"
              DefaultDepth    24
              SubSection     "Display"
                  Depth       24
        -{% if system.x11.display.0.default is defined and system.x11.display.0.default %}
        -         Modes      "{{ system.x11.display.1.default }}"{% for mode in system.x11.display.1.mode %}{% if mode != system.x11.display.1.default %} "{{ mode }}"{% endif %}{% endfor %}
        +{% if system.x11.display.0.default is defined and system.x11.display.0.default %}
        +         Modes      "{{ system.x11.display.1.default }}"{% for mode in system.x11.display.1.mode %}{% if mode != system.x11.display.1.default %} "{{ mode }}"{% endif %}{% endfor %}
         
        -{% elif system.hardware.nvidia.detected == "1" %}
        +{% elif system.hardware.nvidia.detected == "1" %}
                  Modes      "nvidia-auto-select"
        -{% endif %}
        +{% endif %}
               EndSubSection
         
         # <?cs if:(?system.x11.display.1.default && system.x11.display.1.default != "" && system.x11.display.1.default != "disabled") ?>
        @@ -2832,15 +2896,15 @@ Section "Screen"
         #     Option          "MetaModes" "<?cs call:fix_display_name(system.x11.display.1.device) ?>: <?cs var:mode ?> { ViewPortIn=<?cs var:system.x11.display.1.viewport.in.x ?>x<?cs var:system.x11.display.1.viewport.in.y ?>, ViewPortOut=<?cs var:system.x11.display.1.viewport.out.x ?>x<?cs var:system.x11.display.1.viewport.out.y ?>+<?cs var:system.x11.display.1.viewport.out.plusx ?>+<?cs var:system.x11.display.1.viewport.out.plusy ?> }"<?cs /if ?><?cs /each ?>
         # <?cs /if ?>
         EndSection
        -{% endif %}
        +{% endif %}
         
    5. -
    6. vdr
      -
      +
    7. vdr
      +

      Set environment variables for system locale and user session on startup

      @@ -2855,18 +2919,47 @@ Set environment variables for system locale and user session on startup
    +
    +

    7.10.5 files

    +
    +
    +
      +
    1. initramfs EDID hook
      +
      +
      +
      #!/bin/bash
      +# Created by yavdr-ansible.
      +# This hook copies EDID files with the naming scheme "edid.${OUTPUT}.bin" to the initramfs.
      +
      +[ "$1" = "prereqs" ] && { echo "udev"; exit 0; }
      +
      +# load hook helper functions
      +. /usr/share/initramfs-tools/hook-functions
      +
      +rm /lib/firmware/edid/edid.*.bin
      +find "/etc/X11/" -name "edid.*.bin" -type f -exec cp -t "/lib/firmware/edid/" {} +
      +mkdir -p "${DESTDIR}/lib/firmware/edid"
      +find "/etc/X11/" -name "edid.*.bin" -type f -exec cp -t "${DESTDIR}/lib/firmware/edid/" {} +
      +manual_add_modules i915 radeon
      +exit 0
      +
      +
      +
      +
    2. +
    +
    -
    -

    7.11 yavdr-desktop

    +
    +

    7.11 yavdr-desktop

    -
    -

    7.11.1 Tasks

    +
    +

    7.11.1 Tasks

      -
    1. main.yml
      +
    2. main.yml
      ---
      @@ -2916,6 +3009,14 @@ Set environment variables for system locale and user session on startup
             owner: '{{ vdr.user }}'
             group: '{{ vdr.group }}'
       
      +- name: expand rc2.xml for openbox on second display
      +  template:
      +      src: 'templates/openbox/rc2.xml.j2'
      +      dest: '{{ vdr.home }}/.config/openbox/rc2.xml'
      +      mode: 0644
      +      owner: '{{ vdr.user }}'
      +      group: '{{ vdr.group }}'
      +
       - name: create yavdr-desktop.target for the user session
         template:
             src: 'templates/systemd/user/yavdr-desktop.target.j2'
      @@ -3007,14 +3108,14 @@ Set environment variables for system locale and user session on startup
       
    -
    -

    7.11.2 Templates

    +
    +

    7.11.2 Templates

      -
    1. xorg configuration
      +
    2. xorg configuration
        -
      1. .Xresources
        +
      2. .Xresources
        xterm*background: Black
        @@ -3037,11 +3138,11 @@ XTerm.vt100.font: 7x13
         
      3. -
      4. .xinitrc
        +
      5. .xinitrc
        #!/bin/bash
        -{{ ansible_managed | comment }}
        +{{ ansible_managed | comment }}
         exec openbox-session
         
        @@ -3049,9 +3150,9 @@ XTerm.vt100.font: 7x13
    3. -
    4. openbox
      +
    5. openbox
        -
      1. autostart
        +
      2. autostart
        # forward environment variables to an environment file and the systemd user session
        @@ -3060,12 +3161,12 @@ systemctl --user import-environment DISPLAY XAUTHORITY XDG_RUNTIME_DIR DBUS_SESS
         
         feh --bg-center "/usr/share/yavdr/images/yavdr_logo.png"
         
        -enabled_services=(
        +enabled_services=(
             "tmux.service" "detect-second-display.service"
             "openbox-second.service" "osd2web.service"
             "yavdr-frontend.service" "pulseaudio.socket"
        -    "pulseaudio.service" "wm-exit.service" "irexec.service")
        -disabled_services=()
        +    "pulseaudio.service" "wm-exit.service" "irexec.service")
        +disabled_services=()
         
         # enable configured services for the user session
         for service in "${enabled_services[@]}"; do
        @@ -3077,7 +3178,7 @@ feh --bg-center "/usr/share/yavdr/images/yavdr_logo.png
           systemctl --user disable "$service"
         done
         
        -if which dbus-update-activation-environment >/dev/null 2>&1; then
        +if which dbus-update-activation-environment >/dev/null 2>&1; then
                 dbus-update-activation-environment DISPLAY XAUTHORITY XDG_RUNTIME_DIR
         fi
         
        @@ -3087,7 +3188,7 @@ systemctl --user isolate yavdr-desktop.target
         
      3. -
      4. rc.xml
        +
      5. rc.xml
        <?xml version="1.0" encoding="UTF-8"?>
        @@ -3903,6 +4004,826 @@ systemctl --user isolate yavdr-desktop.target
           </applications>
         </openbox_config>
         
        +
        +
        +
        +
      6. +
      7. rc2.xml
        +
        +
        +
        <?xml version="1.0" encoding="UTF-8"?>
        +<openbox_config xmlns="http://openbox.org/3.4/rc" xmlns:xi="http://www.w3.org/2001/XInclude">
        +<!-- Do not edit this file, it will be overwritten on install.
        +        Copy the file to $HOME/.config/openbox/ instead. -->
        +  <resistance>
        +    <strength>10</strength>
        +    <screen_edge_strength>20</screen_edge_strength>
        +  </resistance>
        +  <focus>
        +    <focusNew>no</focusNew>
        +    <!-- always try to focus new windows when they appear. other rules do
        +       apply -->
        +    <followMouse>no</followMouse>
        +    <!-- move focus to a window when you move the mouse into it -->
        +    <focusLast>yes</focusLast>
        +    <!-- focus the last used window when changing desktops, instead of the one
        +       under the mouse pointer. when followMouse is enabled -->
        +    <underMouse>no</underMouse>
        +    <!-- move focus under the mouse, even when the mouse is not moving -->
        +    <focusDelay>200</focusDelay>
        +    <!-- when followMouse is enabled, the mouse must be inside the window for
        +       this many milliseconds (1000 = 1 sec) before moving focus to it -->
        +    <raiseOnFocus>no</raiseOnFocus>
        +    <!-- when followMouse is enabled, and a window is given focus by moving the
        +       mouse into it, also raise the window -->
        +  </focus>
        +  <placement>
        +    <policy>Smart</policy>
        +    <!-- 'Smart' or 'UnderMouse' -->
        +    <center>yes</center>
        +    <!-- whether to place windows in the center of the free area found or
        +       the top left corner -->
        +    <monitor>Active</monitor>
        +    <!-- with Smart placement on a multi-monitor system, try to place new windows
        +       on: 'Any' - any monitor, 'Mouse' - where the mouse is, 'Active' - where
        +       the active window is, 'Primary' - only on the primary monitor -->
        +    <primaryMonitor>Active</primaryMonitor>
        +    <!-- The monitor where Openbox should place popup dialogs such as the
        +       focus cycling popup, or the desktop switch popup.  It can be an index
        +       from 1, specifying a particular monitor.  Or it can be one of the
        +       following: 'Mouse' - where the mouse is, or
        +                  'Active' - where the active window is -->
        +  </placement>
        +  <theme>
        +    <name>Onyx</name>
        +    <titleLayout>NLIMC</titleLayout>
        +    <!--
        +      available characters are NDSLIMC, each can occur at most once.
        +      N: window icon
        +      L: window label (AKA title).
        +      I: iconify
        +      M: maximize
        +      C: close
        +      S: shade (roll up/down)
        +      D: omnipresent (on all desktops).
        +  -->
        +    <keepBorder>no</keepBorder>
        +    <animateIconify>yes</animateIconify>
        +    <font place="ActiveWindow">
        +      <name>sans</name>
        +      <size>8</size>
        +      <!-- font size in points -->
        +      <weight>bold</weight>
        +      <!-- 'bold' or 'normal' -->
        +      <slant>normal</slant>
        +      <!-- 'italic' or 'normal' -->
        +    </font>
        +    <font place="InactiveWindow">
        +      <name>sans</name>
        +      <size>8</size>
        +      <!-- font size in points -->
        +      <weight>bold</weight>
        +      <!-- 'bold' or 'normal' -->
        +      <slant>normal</slant>
        +      <!-- 'italic' or 'normal' -->
        +    </font>
        +    <font place="MenuHeader">
        +      <name>sans</name>
        +      <size>9</size>
        +      <!-- font size in points -->
        +      <weight>normal</weight>
        +      <!-- 'bold' or 'normal' -->
        +      <slant>normal</slant>
        +      <!-- 'italic' or 'normal' -->
        +    </font>
        +    <font place="MenuItem">
        +      <name>sans</name>
        +      <size>9</size>
        +      <!-- font size in points -->
        +      <weight>normal</weight>
        +      <!-- 'bold' or 'normal' -->
        +      <slant>normal</slant>
        +      <!-- 'italic' or 'normal' -->
        +    </font>
        +    <font place="ActiveOnScreenDisplay">
        +      <name>sans</name>
        +      <size>9</size>
        +      <!-- font size in points -->
        +      <weight>bold</weight>
        +      <!-- 'bold' or 'normal' -->
        +      <slant>normal</slant>
        +      <!-- 'italic' or 'normal' -->
        +    </font>
        +    <font place="InactiveOnScreenDisplay">
        +      <name>sans</name>
        +      <size>9</size>
        +      <!-- font size in points -->
        +      <weight>bold</weight>
        +      <!-- 'bold' or 'normal' -->
        +      <slant>normal</slant>
        +      <!-- 'italic' or 'normal' -->
        +    </font>
        +  </theme>
        +  <desktops>
        +    <!-- this stuff is only used at startup, pagers allow you to change them
        +       during a session
        +
        +       these are default values to use when other ones are not already set
        +       by other applications, or saved in your session
        +
        +       use obconf if you want to change these without having to log out
        +       and back in -->
        +    <number>2</number>
        +    <firstdesk>1</firstdesk>
        +    <names>
        +      <!-- set names up here if you want to, like this:
        +    <name>desktop 1</name>
        +    <name>desktop 2</name>
        +    -->
        +    </names>
        +    <popupTime>875</popupTime>
        +    <!-- The number of milliseconds to show the popup for when switching
        +       desktops.  Set this to 0 to disable the popup. -->
        +  </desktops>
        +  <resize>
        +    <drawContents>yes</drawContents>
        +    <popupShow>Nonpixel</popupShow>
        +    <!-- 'Always', 'Never', or 'Nonpixel' (xterms and such) -->
        +    <popupPosition>Center</popupPosition>
        +    <!-- 'Center', 'Top', or 'Fixed' -->
        +    <popupFixedPosition>
        +      <!-- these are used if popupPosition is set to 'Fixed' -->
        +      <x>10</x>
        +      <!-- positive number for distance from left edge, negative number for
        +         distance from right edge, or 'Center' -->
        +      <y>10</y>
        +      <!-- positive number for distance from top edge, negative number for
        +         distance from bottom edge, or 'Center' -->
        +    </popupFixedPosition>
        +  </resize>
        +  <!-- You can reserve a portion of your screen where windows will not cover when
        +     they are maximized, or when they are initially placed.
        +     Many programs reserve space automatically, but you can use this in other
        +     cases. -->
        +  <margins>
        +    <top>0</top>
        +    <bottom>0</bottom>
        +    <left>0</left>
        +    <right>0</right>
        +  </margins>
        +  <dock>
        +    <position>TopLeft</position>
        +    <!-- (Top|Bottom)(Left|Right|)|Top|Bottom|Left|Right|Floating -->
        +    <floatingX>0</floatingX>
        +    <floatingY>0</floatingY>
        +    <noStrut>no</noStrut>
        +    <stacking>Above</stacking>
        +    <!-- 'Above', 'Normal', or 'Below' -->
        +    <direction>Vertical</direction>
        +    <!-- 'Vertical' or 'Horizontal' -->
        +    <autoHide>no</autoHide>
        +    <hideDelay>300</hideDelay>
        +    <!-- in milliseconds (1000 = 1 second) -->
        +    <showDelay>300</showDelay>
        +    <!-- in milliseconds (1000 = 1 second) -->
        +    <moveButton>Middle</moveButton>
        +    <!-- 'Left', 'Middle', 'Right' -->
        +  </dock>
        +  <keyboard>
        +    <chainQuitKey>C-g</chainQuitKey>
        +    <!-- Keybindings for desktop switching -->
        +    <keybind key="C-A-Left">
        +      <action name="GoToDesktop">
        +        <to>left</to>
        +        <wrap>no</wrap>
        +      </action>
        +    </keybind>
        +    <keybind key="C-A-Right">
        +      <action name="GoToDesktop">
        +        <to>right</to>
        +        <wrap>no</wrap>
        +      </action>
        +    </keybind>
        +    <keybind key="C-A-Up">
        +      <action name="GoToDesktop">
        +        <to>up</to>
        +        <wrap>no</wrap>
        +      </action>
        +    </keybind>
        +    <keybind key="C-A-Down">
        +      <action name="GoToDesktop">
        +        <to>down</to>
        +        <wrap>no</wrap>
        +      </action>
        +    </keybind>
        +    <keybind key="S-A-Left">
        +      <action name="SendToDesktop">
        +        <to>left</to>
        +        <wrap>no</wrap>
        +      </action>
        +    </keybind>
        +    <keybind key="S-A-Right">
        +      <action name="SendToDesktop">
        +        <to>right</to>
        +        <wrap>no</wrap>
        +      </action>
        +    </keybind>
        +    <keybind key="S-A-Up">
        +      <action name="SendToDesktop">
        +        <to>up</to>
        +        <wrap>no</wrap>
        +      </action>
        +    </keybind>
        +    <keybind key="S-A-Down">
        +      <action name="SendToDesktop">
        +        <to>down</to>
        +        <wrap>no</wrap>
        +      </action>
        +    </keybind>
        +    <keybind key="W-F1">
        +      <action name="GoToDesktop">
        +        <to>1</to>
        +      </action>
        +    </keybind>
        +    <keybind key="W-F2">
        +      <action name="GoToDesktop">
        +        <to>2</to>
        +      </action>
        +    </keybind>
        +    <keybind key="W-F3">
        +      <action name="GoToDesktop">
        +        <to>3</to>
        +      </action>
        +    </keybind>
        +    <keybind key="W-F4">
        +      <action name="GoToDesktop">
        +        <to>4</to>
        +      </action>
        +    </keybind>
        +    <keybind key="W-d">
        +      <action name="ToggleShowDesktop"/>
        +    </keybind>
        +    <!-- Keybindings for windows -->
        +    <keybind key="A-F4">
        +      <action name="Close"/>
        +    </keybind>
        +    <keybind key="A-Escape">
        +      <action name="Lower"/>
        +      <action name="FocusToBottom"/>
        +      <action name="Unfocus"/>
        +    </keybind>
        +    <keybind key="A-space">
        +      <action name="ShowMenu">
        +        <menu>client-menu</menu>
        +      </action>
        +    </keybind>
        +    <!-- Take a screenshot of the current window with scrot when Alt+Print are pressed -->
        +    <keybind key="A-Print">
        +      <action name="Execute">
        +        <command>scrot -s</command>
        +      </action>
        +    </keybind>
        +    <!-- Keybindings for window switching -->
        +    <keybind key="A-Tab">
        +      <action name="NextWindow">
        +        <finalactions>
        +          <action name="Focus"/>
        +          <action name="Raise"/>
        +          <action name="Unshade"/>
        +        </finalactions>
        +      </action>
        +    </keybind>
        +    <keybind key="A-S-Tab">
        +      <action name="PreviousWindow">
        +        <finalactions>
        +          <action name="Focus"/>
        +          <action name="Raise"/>
        +          <action name="Unshade"/>
        +        </finalactions>
        +      </action>
        +    </keybind>
        +    <keybind key="C-A-Tab">
        +      <action name="NextWindow">
        +        <panels>yes</panels>
        +        <desktop>yes</desktop>
        +        <finalactions>
        +          <action name="Focus"/>
        +          <action name="Raise"/>
        +          <action name="Unshade"/>
        +        </finalactions>
        +      </action>
        +    </keybind>
        +    <!-- Keybindings for window switching with the arrow keys -->
        +    <keybind key="W-S-Right">
        +      <action name="DirectionalCycleWindows">
        +        <direction>right</direction>
        +      </action>
        +    </keybind>
        +    <keybind key="W-S-Left">
        +      <action name="DirectionalCycleWindows">
        +        <direction>left</direction>
        +      </action>
        +    </keybind>
        +    <keybind key="W-S-Up">
        +      <action name="DirectionalCycleWindows">
        +        <direction>up</direction>
        +      </action>
        +    </keybind>
        +    <keybind key="W-S-Down">
        +      <action name="DirectionalCycleWindows">
        +        <direction>down</direction>
        +      </action>
        +    </keybind>
        +  </keyboard>
        +  <mouse>
        +    <dragThreshold>1</dragThreshold>
        +    <!-- number of pixels the mouse must move before a drag begins -->
        +    <doubleClickTime>500</doubleClickTime>
        +    <!-- in milliseconds (1000 = 1 second) -->
        +    <screenEdgeWarpTime>400</screenEdgeWarpTime>
        +    <!-- Time before changing desktops when the pointer touches the edge of the
        +       screen while moving a window, in milliseconds (1000 = 1 second).
        +       Set this to 0 to disable warping -->
        +    <screenEdgeWarpMouse>false</screenEdgeWarpMouse>
        +    <!-- Set this to TRUE to move the mouse pointer across the desktop when
        +       switching due to hitting the edge of the screen -->
        +    <context name="Frame">
        +      <mousebind button="A-Left" action="Press">
        +        <action name="Focus"/>
        +        <action name="Raise"/>
        +      </mousebind>
        +      <mousebind button="A-Left" action="Click">
        +        <action name="Unshade"/>
        +      </mousebind>
        +      <mousebind button="A-Left" action="Drag">
        +        <action name="Move"/>
        +      </mousebind>
        +      <mousebind button="A-Right" action="Press">
        +        <action name="Focus"/>
        +        <action name="Raise"/>
        +        <action name="Unshade"/>
        +      </mousebind>
        +      <mousebind button="A-Right" action="Drag">
        +        <action name="Resize"/>
        +      </mousebind>
        +      <mousebind button="A-Middle" action="Press">
        +        <action name="Lower"/>
        +        <action name="FocusToBottom"/>
        +        <action name="Unfocus"/>
        +      </mousebind>
        +      <mousebind button="A-Up" action="Click">
        +        <action name="GoToDesktop">
        +          <to>previous</to>
        +        </action>
        +      </mousebind>
        +      <mousebind button="A-Down" action="Click">
        +        <action name="GoToDesktop">
        +          <to>next</to>
        +        </action>
        +      </mousebind>
        +      <mousebind button="C-A-Up" action="Click">
        +        <action name="GoToDesktop">
        +          <to>previous</to>
        +        </action>
        +      </mousebind>
        +      <mousebind button="C-A-Down" action="Click">
        +        <action name="GoToDesktop">
        +          <to>next</to>
        +        </action>
        +      </mousebind>
        +      <mousebind button="A-S-Up" action="Click">
        +        <action name="SendToDesktop">
        +          <to>previous</to>
        +        </action>
        +      </mousebind>
        +      <mousebind button="A-S-Down" action="Click">
        +        <action name="SendToDesktop">
        +          <to>next</to>
        +        </action>
        +      </mousebind>
        +    </context>
        +    <context name="Titlebar">
        +      <mousebind button="Left" action="Drag">
        +        <action name="Move"/>
        +      </mousebind>
        +      <mousebind button="Left" action="DoubleClick">
        +        <action name="ToggleMaximize"/>
        +      </mousebind>
        +      <mousebind button="Up" action="Click">
        +        <action name="if">
        +          <shaded>no</shaded>
        +          <then>
        +            <action name="Shade"/>
        +            <action name="FocusToBottom"/>
        +            <action name="Unfocus"/>
        +            <action name="Lower"/>
        +          </then>
        +        </action>
        +      </mousebind>
        +      <mousebind button="Down" action="Click">
        +        <action name="if">
        +          <shaded>yes</shaded>
        +          <then>
        +            <action name="Unshade"/>
        +            <action name="Raise"/>
        +          </then>
        +        </action>
        +      </mousebind>
        +    </context>
        +    <context name="Titlebar Top Right Bottom Left TLCorner TRCorner BRCorner BLCorner">
        +      <mousebind button="Left" action="Press">
        +        <action name="Focus"/>
        +        <action name="Raise"/>
        +        <action name="Unshade"/>
        +      </mousebind>
        +      <mousebind button="Middle" action="Press">
        +        <action name="Lower"/>
        +        <action name="FocusToBottom"/>
        +        <action name="Unfocus"/>
        +      </mousebind>
        +      <mousebind button="Right" action="Press">
        +        <action name="Focus"/>
        +        <action name="Raise"/>
        +        <action name="ShowMenu">
        +          <menu>client-menu</menu>
        +        </action>
        +      </mousebind>
        +    </context>
        +    <context name="Top">
        +      <mousebind button="Left" action="Drag">
        +        <action name="Resize">
        +          <edge>top</edge>
        +        </action>
        +      </mousebind>
        +    </context>
        +    <context name="Left">
        +      <mousebind button="Left" action="Drag">
        +        <action name="Resize">
        +          <edge>left</edge>
        +        </action>
        +      </mousebind>
        +    </context>
        +    <context name="Right">
        +      <mousebind button="Left" action="Drag">
        +        <action name="Resize">
        +          <edge>right</edge>
        +        </action>
        +      </mousebind>
        +    </context>
        +    <context name="Bottom">
        +      <mousebind button="Left" action="Drag">
        +        <action name="Resize">
        +          <edge>bottom</edge>
        +        </action>
        +      </mousebind>
        +      <mousebind button="Right" action="Press">
        +        <action name="Focus"/>
        +        <action name="Raise"/>
        +        <action name="ShowMenu">
        +          <menu>client-menu</menu>
        +        </action>
        +      </mousebind>
        +    </context>
        +    <context name="TRCorner BRCorner TLCorner BLCorner">
        +      <mousebind button="Left" action="Press">
        +        <action name="Focus"/>
        +        <action name="Raise"/>
        +        <action name="Unshade"/>
        +      </mousebind>
        +      <mousebind button="Left" action="Drag">
        +        <action name="Resize"/>
        +      </mousebind>
        +    </context>
        +    <context name="Client">
        +      <mousebind button="Left" action="Press">
        +        <action name="Focus"/>
        +        <action name="Raise"/>
        +      </mousebind>
        +      <mousebind button="Middle" action="Press">
        +        <action name="Focus"/>
        +        <action name="Raise"/>
        +      </mousebind>
        +      <mousebind button="Right" action="Press">
        +        <action name="Focus"/>
        +        <action name="Raise"/>
        +      </mousebind>
        +    </context>
        +    <context name="Icon">
        +      <mousebind button="Left" action="Press">
        +        <action name="Focus"/>
        +        <action name="Raise"/>
        +        <action name="Unshade"/>
        +        <action name="ShowMenu">
        +          <menu>client-menu</menu>
        +        </action>
        +      </mousebind>
        +      <mousebind button="Right" action="Press">
        +        <action name="Focus"/>
        +        <action name="Raise"/>
        +        <action name="ShowMenu">
        +          <menu>client-menu</menu>
        +        </action>
        +      </mousebind>
        +    </context>
        +    <context name="AllDesktops">
        +      <mousebind button="Left" action="Press">
        +        <action name="Focus"/>
        +        <action name="Raise"/>
        +        <action name="Unshade"/>
        +      </mousebind>
        +      <mousebind button="Left" action="Click">
        +        <action name="ToggleOmnipresent"/>
        +      </mousebind>
        +    </context>
        +    <context name="Shade">
        +      <mousebind button="Left" action="Press">
        +        <action name="Focus"/>
        +        <action name="Raise"/>
        +      </mousebind>
        +      <mousebind button="Left" action="Click">
        +        <action name="ToggleShade"/>
        +      </mousebind>
        +    </context>
        +    <context name="Iconify">
        +      <mousebind button="Left" action="Press">
        +        <action name="Focus"/>
        +        <action name="Raise"/>
        +      </mousebind>
        +      <mousebind button="Left" action="Click">
        +        <action name="Iconify"/>
        +      </mousebind>
        +    </context>
        +    <context name="Maximize">
        +      <mousebind button="Left" action="Press">
        +        <action name="Focus"/>
        +        <action name="Raise"/>
        +        <action name="Unshade"/>
        +      </mousebind>
        +      <mousebind button="Middle" action="Press">
        +        <action name="Focus"/>
        +        <action name="Raise"/>
        +        <action name="Unshade"/>
        +      </mousebind>
        +      <mousebind button="Right" action="Press">
        +        <action name="Focus"/>
        +        <action name="Raise"/>
        +        <action name="Unshade"/>
        +      </mousebind>
        +      <mousebind button="Left" action="Click">
        +        <action name="ToggleMaximize"/>
        +      </mousebind>
        +      <mousebind button="Middle" action="Click">
        +        <action name="ToggleMaximize">
        +          <direction>vertical</direction>
        +        </action>
        +      </mousebind>
        +      <mousebind button="Right" action="Click">
        +        <action name="ToggleMaximize">
        +          <direction>horizontal</direction>
        +        </action>
        +      </mousebind>
        +    </context>
        +    <context name="Close">
        +      <mousebind button="Left" action="Press">
        +        <action name="Focus"/>
        +        <action name="Raise"/>
        +        <action name="Unshade"/>
        +      </mousebind>
        +      <mousebind button="Left" action="Click">
        +        <action name="Close"/>
        +      </mousebind>
        +    </context>
        +    <context name="Desktop">
        +      <mousebind button="Up" action="Click">
        +        <action name="GoToDesktop">
        +          <to>previous</to>
        +        </action>
        +      </mousebind>
        +      <mousebind button="Down" action="Click">
        +        <action name="GoToDesktop">
        +          <to>next</to>
        +        </action>
        +      </mousebind>
        +      <mousebind button="A-Up" action="Click">
        +        <action name="GoToDesktop">
        +          <to>previous</to>
        +        </action>
        +      </mousebind>
        +      <mousebind button="A-Down" action="Click">
        +        <action name="GoToDesktop">
        +          <to>next</to>
        +        </action>
        +      </mousebind>
        +      <mousebind button="C-A-Up" action="Click">
        +        <action name="GoToDesktop">
        +          <to>previous</to>
        +        </action>
        +      </mousebind>
        +      <mousebind button="C-A-Down" action="Click">
        +        <action name="GoToDesktop">
        +          <to>next</to>
        +        </action>
        +      </mousebind>
        +      <mousebind button="Left" action="Press">
        +        <action name="Focus"/>
        +        <action name="Raise"/>
        +      </mousebind>
        +      <mousebind button="Right" action="Press">
        +        <action name="Focus"/>
        +        <action name="Raise"/>
        +      </mousebind>
        +    </context>
        +    <context name="Root">
        +      <!-- Menus -->
        +      <mousebind button="Middle" action="Press">
        +        <action name="ShowMenu">
        +          <menu>client-list-combined-menu</menu>
        +        </action>
        +      </mousebind>
        +      <mousebind button="Right" action="Press">
        +        <action name="ShowMenu">
        +          <menu>root-menu</menu>
        +        </action>
        +      </mousebind>
        +    </context>
        +    <context name="MoveResize">
        +      <mousebind button="Up" action="Click">
        +        <action name="GoToDesktop">
        +          <to>previous</to>
        +        </action>
        +      </mousebind>
        +      <mousebind button="Down" action="Click">
        +        <action name="GoToDesktop">
        +          <to>next</to>
        +        </action>
        +      </mousebind>
        +      <mousebind button="A-Up" action="Click">
        +        <action name="GoToDesktop">
        +          <to>previous</to>
        +        </action>
        +      </mousebind>
        +      <mousebind button="A-Down" action="Click">
        +        <action name="GoToDesktop">
        +          <to>next</to>
        +        </action>
        +      </mousebind>
        +    </context>
        +  </mouse>
        +  <menu>
        +    <!-- You can specify more than one menu file in here and they are all loaded,
        +       just don't make menu ids clash or, well, it'll be kind of pointless -->
        +    <!-- default menu file (or custom one in $HOME/.config/openbox/) -->
        +    <!-- system menu files on Debian systems -->
        +    <file>/var/lib/openbox/debian-menu.xml</file>
        +    <file>menu.xml</file>
        +    <hideDelay>200</hideDelay>
        +    <!-- if a press-release lasts longer than this setting (in milliseconds), the
        +       menu is hidden again -->
        +    <middle>no</middle>
        +    <!-- center submenus vertically about the parent entry -->
        +    <submenuShowDelay>100</submenuShowDelay>
        +    <!-- time to delay before showing a submenu after hovering over the parent
        +       entry.
        +       if this is a negative value, then the delay is infinite and the
        +       submenu will not be shown until it is clicked on -->
        +    <submenuHideDelay>400</submenuHideDelay>
        +    <!-- time to delay before hiding a submenu when selecting another
        +       entry in parent menu
        +       if this is a negative value, then the delay is infinite and the
        +       submenu will not be hidden until a different submenu is opened -->
        +    <showIcons>yes</showIcons>
        +    <!-- controls if icons appear in the client-list-(combined-)menu -->
        +    <manageDesktops>yes</manageDesktops>
        +    <!-- show the manage desktops section in the client-list-(combined-)menu -->
        +  </menu>
        +    <!--
        +  # this is an example with comments through out. use these to make your
        +  # own rules, but without the comments of course.
        +  # you may use one or more of the name/class/role/title/type rules to specify
        +  # windows to match
        +
        +  <application name="the window's _OB_APP_NAME property (see obxprop)"
        +              class="the window's _OB_APP_CLASS property (see obxprop)"
        +          groupname="the window's _OB_APP_GROUP_NAME property (see obxprop)"
        +         groupclass="the window's _OB_APP_GROUP_CLASS property (see obxprop)"
        +               role="the window's _OB_APP_ROLE property (see obxprop)"
        +              title="the window's _OB_APP_TITLE property (see obxprop)"
        +               type="the window's _OB_APP_TYPE property (see obxprob)..
        +                      (if unspecified, then it is 'dialog' for child windows)">
        +  # you may set only one of name/class/role/title/type, or you may use more
        +  # than one together to restrict your matches.
        +
        +  # the name, class, role, and title use simple wildcard matching such as those
        +  # used by a shell. you can use * to match any characters and ? to match
        +  # any single character.
        +
        +  # the type is one of: normal, dialog, splash, utility, menu, toolbar, dock,
        +  #    or desktop
        +
        +  # when multiple rules match a window, they will all be applied, in the
        +  # order that they appear in this list
        +
        +
        +    # each rule element can be left out or set to 'default' to specify to not 
        +    # change that attribute of the window
        +
        +    <decor>yes</decor>
        +    # enable or disable window decorations
        +
        +    <shade>no</shade>
        +    # make the window shaded when it appears, or not
        +
        +    <position force="no">
        +      # the position is only used if both an x and y coordinate are provided
        +      # (and not set to 'default')
        +      # when force is "yes", then the window will be placed here even if it
        +      # says you want it placed elsewhere.  this is to override buggy
        +      # applications who refuse to behave
        +      <x>center</x>
        +      # a number like 50, or 'center' to center on screen. use a negative number
        +      # to start from the right (or bottom for <y>), ie -50 is 50 pixels from
        +      # the right edge (or bottom). use 'default' to specify using value
        +      # provided by the application, or chosen by openbox, instead.
        +      <y>200</y>
        +      <monitor>1</monitor>
        +      # specifies the monitor in a xinerama setup.
        +      # 1 is the first head, or 'mouse' for wherever the mouse is
        +    </position>
        +
        +    <size>
        +      # the size to make the window.
        +      <width>20</width>
        +      # a number like 20, or 'default' to use the size given by the application.
        +      # you can use fractions such as 1/2 or percentages such as 75% in which
        +      # case the value is relative to the size of the monitor that the window
        +      # appears on.
        +      <height>30%</height>
        +    </size>
        +
        +    <focus>yes</focus>
        +    # if the window should try be given focus when it appears. if this is set
        +    # to yes it doesn't guarantee the window will be given focus. some
        +    # restrictions may apply, but Openbox will try to
        +
        +    <desktop>1</desktop>
        +    # 1 is the first desktop, 'all' for all desktops
        +
        +    <layer>normal</layer>
        +    # 'above', 'normal', or 'below'
        +
        +    <iconic>no</iconic>
        +    # make the window iconified when it appears, or not
        +
        +    <skip_pager>no</skip_pager>
        +    # asks to not be shown in pagers
        +
        +    <skip_taskbar>no</skip_taskbar>
        +    # asks to not be shown in taskbars. window cycling actions will also
        +    # skip past such windows
        +
        +    <fullscreen>yes</fullscreen>
        +    # make the window in fullscreen mode when it appears
        +
        +    <maximized>true</maximized>
        +    # 'Horizontal', 'Vertical' or boolean (yes/no)
        +  </application>
        +
        +  # end of the example
        +-->
        +  <applications>
        +    <application title="softhddevice">
        +      <decor>no</decor>
        +      <maximized>yes</maximized>
        +      <!--<skip_pager>yes</skip_pager>-->
        +      <skip_taskbar>no</skip_taskbar>
        +    </application>
        +    <application title="vaapidevice">
        +      <decor>no</decor>
        +      <maximized>yes</maximized>
        +      <!--<skip_pager>yes</skip_pager>-->
        +      <skip_taskbar>no</skip_taskbar>
        +    </application>
        +    <application class="VDR">
        +      <decor>no</decor>
        +      <maximized>yes</maximized>
        +      <!--<skip_pager>yes</skip_pager>-->
        +      <skip_taskbar>no</skip_taskbar>
        +    </application>
        +    <application title="browser">
        +      <decor>no</decor>
        +      <maximized>yes</maximized>
        +      <!--<skip_pager>yes</skip_pager>-->
        +      <skip_taskbar>no</skip_taskbar>
        +    </application>
        +    <application title="osd2Web">
        +      <decor>no</decor>
        +      <maximized>yes</maximized>
        +      <!--<skip_pager>yes</skip_pager>-->
        +      <skip_taskbar>no</skip_taskbar>
        +    </application>
        +  </applications>
        +</openbox_config>
        +
         
        @@ -3910,12 +4831,12 @@ systemctl --user isolate yavdr-desktop.target
    6. -
    7. Systemd User Session
      +
    8. Systemd User Session
        -
      1. yavdr-desktop.target
        +
      2. yavdr-desktop.target
        -
        [Unit]
        +
        [Unit]
         Description=yaVDR Desktop
         Requires=default.target
         After=default.target pulseaudio.service
        @@ -3925,7 +4846,7 @@ systemctl --user isolate yavdr-desktop.target
         
      3. -
      4. detect-second-display
        +
      5. detect-second-display
        [Unit]
        @@ -3941,7 +4862,7 @@ systemctl --user isolate yavdr-desktop.target
         
      6. -
      7. openbox-second.service
        +
      8. openbox-second.service
        [Unit]
        @@ -3953,7 +4874,7 @@ systemctl --user isolate yavdr-desktop.target
         
         [Service]
         EnvironmentFile=%h/.second_display
        -ExecStart=/usr/bin/openbox --config-file %h/.config/openbox/rc.xml
        +ExecStart=/usr/bin/openbox --config-file %h/.config/openbox/rc2.xml
         ExecStartPost=/usr/bin/xset -dpms s off -display $DISPLAY
         ExecStartPost=/bin/bash %h/.fehbg
         
        @@ -3963,7 +4884,7 @@ systemctl --user isolate yavdr-desktop.target
         
      9. -
      10. osd2web.service
        +
      11. osd2web.service
        [Unit]
        @@ -3986,7 +4907,7 @@ systemctl --user isolate yavdr-desktop.target
         
      12. -
      13. tmux.service
        +
      14. tmux.service
        [Unit]
        @@ -4005,7 +4926,7 @@ systemctl --user isolate yavdr-desktop.target
         
      15. -
      16. wm-exit.service
        +
      17. wm-exit.service
        [Unit]
        @@ -4024,20 +4945,20 @@ systemctl --user isolate yavdr-desktop.target
         
    9. -
    10. irexec
      +
    11. irexec

      irexec.service starts irexec for the user session

      -
      [Unit]
      +
      [Unit]
       Description=LIRC command handler
       
      -[Service]
      +[Service]
       Type=simple
       ExecStart=/usr/bin/irexec %h/.lircrc
       
      -[Install]
      +[Install]
       WantedBy=yavdr-desktop.target
       
      @@ -4046,9 +4967,9 @@ irexec.service starts irexec for the user session

      begin
      -    prog = irexec
      -    button = KEY_HOME
      -    config = frontend-dbus-send switchbetween kodi vdr
      +    prog = irexec
      +    button = KEY_HOME
      +    config = frontend-dbus-send switchbetween kodi vdr
       end
       
      @@ -4058,12 +4979,12 @@ end
    -
    -

    7.12 samba-install

    +
    +

    7.12 samba-install

    -
    -

    7.12.1 tasks

    +
    +

    7.12.1 tasks

    ---
    @@ -4085,12 +5006,12 @@ end
     
    -
    -

    7.13 samba-config

    +
    +

    7.13 samba-config

    -
    -

    7.13.1 tasks

    +
    +

    7.13.1 tasks

    ---
    @@ -4115,14 +5036,14 @@ end
     
    -
    -

    7.13.2 templates

    +
    +

    7.13.2 templates

      -
    1. smb.conf
      +
    2. smb.conf
        -
      1. global settings
        +
      2. global settings
        {{ ansible_managed | comment }}
        @@ -4208,7 +5129,7 @@ end
         
      3. -
      4. media directories
        +
      5. media directories
        {% for name, path in media_dirs.iteritems() %}
        @@ -4230,7 +5151,7 @@ end
         
      6. -
      7. include custom samba exports
        +
      8. include custom samba exports
        include = /etc/samba/smb.conf.custom
        @@ -4243,15 +5164,15 @@ end
         
    -
    -

    7.14 STARTED autoinstall-drivers

    +
    +

    7.14 STARTED autoinstall-drivers

    It would be nice to be able to detect if it is suitable to install those drivers:

    -
    -

    7.14.1 TODO sundtek for Sundtek devices (local or network connection)

    +
    +

    7.14.1 TODO sundtek for Sundtek devices (local or network connection)

    Vendor-IDs: @@ -4261,9 +5182,20 @@ Vendor-IDs:

  • 2659:* (neuere Sticks)
  • +
      +
    1. planned packages
      +
      +
        +
      • yavdr-hardware-sundtek
      • +
      • python3-sundtek
      • +
      • yavdr-backend-sundtek
      • +
      -
      -

      7.14.2 TODO drivers for TT S2-6400 FF

      +
    2. +
    +
    +
    +

    7.14.2 TODO drivers for TT S2-6400 FF

    https://github.com/s-moch/linux-saa716x - kann man den relevanten Teil als dkms-Paket bauen? @@ -4271,15 +5203,15 @@ Vendor-IDs:

    -
    -

    7.15 autoinstall-ubuntu-drivers

    +
    +

    7.15 autoinstall-ubuntu-drivers

    The tool ubuntu-drivers is used to install the matching driver version for nvidia graphics cards, virtualbox guest additions and Intel and AMD microcode updates.

    -
    -

    7.15.1 tasks

    +
    +

    7.15.1 tasks

    ---
    @@ -4302,8 +5234,8 @@ The tool ubuntu-drivers is used to install the matching driver version for nvidi
     
    -
    -

    7.16 autoinstall-virtualbox-guest

    +
    +

    7.16 autoinstall-virtualbox-guest

    This role installs the guest additions for virtualbox guests on Ubuntu 16.04 @@ -4354,12 +5286,12 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04

    -
    -

    7.17 autoinstall-atric-usb

    +
    +

    7.17 autoinstall-atric-usb

    -
    -

    7.17.1 dependencies

    +
    +

    7.17.1 dependencies

    ---
    @@ -4371,8 +5303,8 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04
     
    -
    -

    7.17.2 tasks

    +
    +

    7.17.2 tasks

    ---
    @@ -4414,8 +5346,8 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04
     
    -
    -

    7.17.3 templates

    +
    +

    7.17.3 templates

    {{ ansible_managed | comment }}
    @@ -4444,12 +5376,12 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04
     
    -
    -

    7.18 autoinstall-yausbir

    +
    +

    7.18 autoinstall-yausbir

    -
    -

    7.18.1 dependencies

    +
    +

    7.18.1 dependencies

    ---
    @@ -4460,8 +5392,8 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04
     
    -
    -

    7.18.2 tasks

    +
    +

    7.18.2 tasks

    ---
    @@ -4503,8 +5435,8 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04
     
    -
    -

    7.18.3 templates

    +
    +

    7.18.3 templates

    {{ ansible_managed | comment }}
    @@ -4532,15 +5464,15 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04
     
    -
    -

    7.19 autoinstall-satip

    +
    +

    7.19 autoinstall-satip

    If a Sat>IP Server responds to a discovery request, the package vdr-plugin-satip is installed.

    -
    -

    7.19.1 tasks

    +
    +

    7.19.1 tasks

    ---
    @@ -4565,12 +5497,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.20 autoinstall-targavfd

    +
    +

    7.20 autoinstall-targavfd

    -
    -

    7.20.1 tasks

    +
    +

    7.20.1 tasks

    ---
    @@ -4586,12 +5518,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.21 autoinstall-imonlcd

    +
    +

    7.21 autoinstall-imonlcd

    -
    -

    7.21.1 tasks

    +
    +

    7.21.1 tasks

    ---
    @@ -4607,12 +5539,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.22 autoinstall-libcecdaemon

    +
    +

    7.22 autoinstall-libcecdaemon

    -
    -

    7.22.1 tasks

    +
    +

    7.22.1 tasks

    ---
    @@ -4628,12 +5560,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.23 autoinstall-pvr350

    +
    +

    7.23 autoinstall-pvr350

    -
    -

    7.23.1 tasks

    +
    +

    7.23.1 tasks

    ---
    @@ -4649,8 +5581,8 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.24 autoinstall-hauppauge-pvr

    +
    +

    7.24 autoinstall-hauppauge-pvr

    ---
    @@ -4665,12 +5597,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.25 autoinstall-firmware

    +
    +

    7.25 autoinstall-firmware

    -
    -

    7.25.1 dependencies

    +
    +

    7.25.1 dependencies

    ---
    @@ -4681,38 +5613,54 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.25.2 tasks

    +
    +

    7.25.2 tasks

    ---
     
     # This role provides easyily downloadable firmware files
     
    -- name: Firmware for Hauppauge WinTV HD Solo/Duo, PCTV 292e
    +- name: Firmware dvb-demod-si2168-b40-01.fw for Hauppauge WinTV HD Solo/Duo, PCTV 292e
       get_url:
         url: https://github.com/OpenELEC/dvb-firmware/raw/master/firmware/dvb-demod-si2168-b40-01.fw
         checksum: sha256:8507536630d75a316d0719d6b95c04b90c36baa5b457ad457c9bacadafcef134
         dest: /lib/firmware/dvb-demod-si2168-b40-01.fw
       when: '"2040:0264" in usb or "2013:025f" in usb'
     
    -- name: Firmware for Hauppauge WinTV-HVR-930C
    +- name: Firmware dvb-fe-xc5000-1.6.114.fw for Hauppauge WinTV-HVR-930C
       get_url:
         url: https://github.com/OpenELEC/dvb-firmware/raw/master/firmware/dvb-fe-xc5000-1.6.114.fw
         checksum: sha256:7104bda8df301fe1bd4c09de1708aeb6d0d8e1f9d55505449fecfad82639235f
         dest: /lib/firmware/dvb-fe-xc5000-1.6.114.fw
       when: '"2040:1605" in usb'
    +
    +- name: Firmware ngenge_18.fw for ngene cards
    +  get_url:
    +    url: http://l4m-daten.de/downloads/firmware/dvb-s2/linux/all/ngene_18.fw
    +    checksum: sha256:213d98ec2cd575eba15d82ee79fed7098e670de43792f8aa773a95cfb7c32060
    +    dest: /lib/firmware/ngene_18.fw
    +  when: '"ngene" in modules'
    +  notify: reboot required
    +
    +- name: Firmware drxk_a3.mc for drxk
    +  get_url:
    +     url: https://github.com/OpenELEC/dvb-firmware/raw/master/firmware/drxk_a3.mc
    +     checksum: sha256:f8956ad6f92a4ce90a6ab94ed23e2f9a27e9317e936fd3e0119778dd28e7e294
    +     dest: /lib/firmware/drxk_a3.mc
    +  when: '"ngene" in modules or "drxk" in modules'
    +  notify: reboot required
     
    -
    -

    7.26 autoinstall-dvbsky-firmware

    +
    +

    7.26 autoinstall-dvbsky-firmware

    -
    -

    7.26.1 dependencies

    +
    +

    7.26.1 dependencies

    ---
    @@ -4723,8 +5671,8 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.26.2 defaults

    +
    +

    7.26.2 defaults

    ---
    @@ -4734,8 +5682,8 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.26.3 tasks

    +
    +

    7.26.3 tasks

    ---
    @@ -4785,15 +5733,15 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
     
    -
    -

    7.27 TODO autoinstall-dvbhddevice

    +
    +

    7.27 TODO autoinstall-dvbhddevice

    Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware sollte in yavdr-firmware stecken

    -
    -

    7.27.1 dependencies

    +
    +

    7.27.1 dependencies

    ---
    @@ -4804,8 +5752,8 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
     
    -
    -

    7.27.2 tasks

    +
    +

    7.27.2 tasks

    ---
    @@ -4822,12 +5770,12 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
     
    -
    -

    7.28 autoinstall-dvbsddevice

    +
    +

    7.28 autoinstall-dvbsddevice

    -
    -

    7.28.1 dependencies

    +
    +

    7.28.1 dependencies

    ---
    @@ -4838,8 +5786,8 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
     
    -
    -

    7.28.2 tasks

    +
    +

    7.28.2 tasks

    ---
    @@ -4857,12 +5805,12 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
     
    -
    -

    7.29 autoinstall-hardware-irmp

    +
    +

    7.29 autoinstall-hardware-irmp

    -
    -

    7.29.1 dependencies

    +
    +

    7.29.1 dependencies

    ---
    @@ -4873,8 +5821,8 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
     
    -
    -

    7.29.2 tasks

    +
    +

    7.29.2 tasks

    ---
    @@ -4890,19 +5838,19 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
     
    -
    -

    7.30 kodi

    +
    +

    7.30 kodi

    -
    -

    7.30.1 tasks

    +
    +

    7.30.1 tasks

      -
    1. Install KODI
      +
    2. Install KODI
        -
      • main.yml
        -
        +
      • main.yml
        +
        - import_tasks: install-kodi.yml tags=install,update,kodi:install
         - import_tasks: configure-kodi.yml tags=install,update,kodi:configure
        @@ -4910,7 +5858,7 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
         
      • -
      • install-kodi.yml
        +
      • install-kodi.yml
        ---
        @@ -4928,7 +5876,7 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
         
      • -
      • configure-kodi.yml
        +
      • configure-kodi.yml
        - name: create kodi.service for the user session
        @@ -4977,12 +5925,12 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
         
    -
    -

    7.30.2 templates

    +
    +

    7.30.2 templates

      -
    1. kodi.service
      +
    2. kodi.service

      This systemd unit for the user session starts (and stops) kodi. @@ -5007,15 +5955,15 @@ This systemd unit for the user session starts (and stops) kodi.

    -
    -

    7.30.3 files

    +
    +

    7.30.3 files

    Those configuration files provide a preconfiguration for kodi which overrides the system wide configuration

      -
    1. Lircmap.xml
      +
    2. Lircmap.xml

      This file allows to map keys sent by remotes via eventlircd (which uses the name devinput) to kodi key names. @@ -5086,14 +6034,14 @@ This file allows to map keys sent by remotes via eventlircd (which uses the name

    -
  • keymaps
    +
  • keymaps

    This file maps the keys defined in Lircmap.xml to actions within kodi.

      -
    1. remote.xml
      +
    2. remote.xml
      <?xml version="1.0" encoding="UTF-8"?>
      @@ -5645,17 +6593,17 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
       
  • -
    -

    7.31 dvd

    +
    +

    7.31 dvd

    -
    -

    7.31.1 tasks

    +
    +

    7.31.1 tasks

      -
    • install libdvd-pkg, allow programs to eject optical media
      -
      +
    • install libdvd-pkg, allow programs to eject optical media
      +
      ---
       # file: roles/dvd/tasks/main.yml
      @@ -5695,15 +6643,15 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
       
    -
    -

    7.32 install-sundtek

    +
    +

    7.32 install-sundtek

    -
    -

    7.32.1 variables

    +
    +

    7.32.1 variables

    -
    -

    7.32.2 tasks

    +
    +

    7.32.2 tasks

    ---
    @@ -5752,8 +6700,8 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
     
    -
    -

    7.32.3 templates

    +
    +

    7.32.3 templates

    # ----- GLOBAL SECTION -----
    @@ -5859,8 +6807,8 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
     
    -
    -

    7.33 template-test

    +
    +

    7.33 template-test

    ---
    @@ -5876,14 +6824,14 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
     
    -
    {{ ansible_managed | comment }}
    +
    {{ ansible_managed | comment }}
     
     Section "ServerLayout"
         Identifier     "Layout0"
         Screen      0  "Screen0"
    -    {% if system.x11.dualhead.enabled %}
    +    {% if system.x11.dualhead.enabled %}
         Screen      1  "Screen1" RightOf "Screen0"
    -    {% endif %}
    +    {% endif %}
         InputDevice    "Keyboard0" "CoreKeyboard"
         InputDevice    "Mouse0" "CorePointer"
     EndSection
    @@ -5920,50 +6868,50 @@ Section "Monitor"
         Identifier     "Monitor0"
         VendorName     "Unknown"
         ModelName      "Unknown"
    -{% if system.x11.display.0.default == "VGA2Scart_4_3" or system.x11.display.0.default == "VGA2Scart_16_9" %}
    +{% if system.x11.display.0.default == "VGA2Scart_4_3" or system.x11.display.0.default == "VGA2Scart_16_9" %}
         HorizSync       14-17
         VertRefresh     49-61
    -    {% if system.x11.display.0.default == "VGA2Scart_4_3" %}
    +    {% if system.x11.display.0.default == "VGA2Scart_4_3" %}
         Modeline "VGA2Scart_4_3" 13.875 720 744 808 888 576 580 585 625 -HSync -Vsync interlace
    -    {% elif system.x11.display.0.default == "VGA2Scart_16_9" %}
    +    {% elif system.x11.display.0.default == "VGA2Scart_16_9" %}
         Modeline "VGA2Scart_16_9" 19 1024 1032 1120 1216 576 581 586 625 -Hsync -Vsync interlace
    -    {% endif %}
    -{% endif %}
    +    {% endif %}
    +{% endif %}
         Option         "DPMS"
         Option         "ExactModeTimingsDVI" "True"
     EndSection
     
     
    -{% if system.x11.dualhead.enabled == "1" %}
    +{% if system.x11.dualhead.enabled == "1" %}
     Section "Monitor"
         Identifier     "Monitor1"
         VendorName     "Unknown"
         ModelName      "Unknown"
    -{% if system.x11.display.1.default in ("VGA2Scart_4_3",  "VGA2Scart_16_9") %}
    +{% if system.x11.display.1.default in ("VGA2Scart_4_3",  "VGA2Scart_16_9") %}
         HorizSync       14-17
         VertRefresh     49-61
    -    {% if system.x11.display.1.default == "VGA2Scart_4_3" %}
    +    {% if system.x11.display.1.default == "VGA2Scart_4_3" %}
         Modeline "VGA2Scart_4_3" 13.875 720 744 808 888 576 580 585 625 -HSync -Vsync interlace
    -    {% elif system.x11.display.1.default == "VGA2Scart_16_9" %}
    +    {% elif system.x11.display.1.default == "VGA2Scart_16_9" %}
         Modeline "VGA2Scart_16_9" 19 1024 1032 1120 1216 576 581 586 625 -Hsync -Vsync interlace
    -    {% endif %}
    +    {% endif %}
         Option         "DPMS"
         Option         "ExactModeTimingsDVI" "True"
    -{% endif %}
    +{% endif %}
     EndSection
    -{% endif %}
    +{% endif %}
     
     Section "Device"
         Identifier     "Device0"
    -{% if system.hardware.nvidia.detected %}
    +{% if system.hardware.nvidia.detected %}
         Driver         "nvidia"
         VendorName     "NVIDIA Corporation"
    -{% endif %}
    +{% endif %}
         Screen          0
         Option         "DPI" "100x100"
    -{% if system.hardware.nvidia.busid %}
    +{% if system.hardware.nvidia.busid %}
         BusID          "PCI: {{ system.hardware.nvidia.busid }}"
    -{% endif %}
    +{% endif %}
         Option         "NoLogo" "True"
         Option         "UseEvents" "True"
         Option         "TripleBuffer" "False"
    @@ -5974,17 +6922,17 @@ Section "Device"
         Option         "FlatPanelProperties" "Scaling = Native"
     EndSection
     
    -{% if system.x11.dualhead.enabled == "1" %}
    +{% if system.x11.dualhead.enabled == "1" %}
     Section "Device"
         Identifier     "Device1"
    -    {% if system.hardware.nvidia.detected %}
    +    {% if system.hardware.nvidia.detected %}
         Driver         "nvidia"
         VendorName     "NVIDIA Corporation"
    -    {% endif %}
    +    {% endif %}
         Screen          1
    -    {% if system.hardware.nvidia.busid %}
    +    {% if system.hardware.nvidia.busid %}
         BusID          "PCI: {{ system.hardware.nvidia.busid }}"
    -    {% endif %}
    +    {% endif %}
         Option         "NoLogo" "True"
         Option         "UseEvents" "True"
         Option         "TripleBuffer" "False"
    @@ -5992,7 +6940,7 @@ Section "Device"
         Option         "TwinView" "0"
         Option         "DynamicTwinView" "0"
     EndSection
    -{% endif %}
    +{% endif %}
     
     
     Section "Screen"
    @@ -6002,19 +6950,19 @@ Section "Screen"
         DefaultDepth    24
         SubSection     "Display"
             Depth       24
    -{% if system.x11.display.0.default is defined and system.x11.display.0.default %}
    -        Modes      "{{ system.x11.display.0.default }}"{% for mode in system.x11.display.0.mode %}{% if mode != system.x11.display.0.default %} "{{ mode }}"{% endif %}{% endfor %}
    +{% if system.x11.display.0.default is defined and system.x11.display.0.default %}
    +        Modes      "{{ system.x11.display.0.default }}"{% for mode in system.x11.display.0.mode %}{% if mode != system.x11.display.0.default %} "{{ mode }}"{% endif %}{% endfor %}
     
    -{% elif system.hardware.nvidia.detected == 1 %}
    +{% elif system.hardware.nvidia.detected == 1 %}
             Modes      "nvidia-auto-select"
    -{% endif %}
    +{% endif %}
         EndSubSection
    -{% if system.x11.display.0.default or system.x11.default %}
    -    {% if system.x11.display.0.device is definded and system.x11.display.0.device %}
    -    Option         "ConnectedMonitor" {{ system.x11.display.0.device }}
    -    {% else %}
    -    Option         "ConnectedMonitor" {{ system.x11.default }}
    -    {% endif %}
    +{% if system.x11.display.0.default or system.x11.default %}
    +    {% if system.x11.display.0.device is definded and system.x11.display.0.device %}
    +    Option         "ConnectedMonitor" {{ system.x11.display.0.device }}
    +    {% else %}
    +    Option         "ConnectedMonitor" {{ system.x11.default }}
    +    {% endif %}
         #     Option         "ConnectedMonitor" "<?cs if:(?system.x11.display.0.device) ?><?cs call:fix_display_name(system.x11.display.0.device) ?><?cs else ?><?cs var:system.x11.default ?><?cs /if ?><?cs if:(?system.x11.dualhead.enabled && system.x11.dualhead.enabled == 1) ?>, <?cs call:fix_display_name(system.x11.display.1.device) ?><?cs /if ?>"
         #Option         "ConnectedMonitor"
         "<?cs if:(?system.x11.display.0.device) ?>
    @@ -6032,10 +6980,10 @@ Section "Screen"
     #     Option          "MetaModes" "<?cs call:fix_display_name(system.x11.display.0.device) ?>: <?cs var:system.x11.display.0.default ?> { ViewPortIn=<?cs var:system.x11.display.0.viewport.in.x ?>x<?cs var:system.x11.display.0.viewport.in.y ?>, ViewPortOut=<?cs var:system.x11.display.0.viewport.out.x ?>x<?cs var:system.x11.display.0.viewport.out.y ?>+<?cs var:system.x11.display.0.viewport.out.plusx ?>+<?cs var:system.x11.display.0.viewport.out.plusy ?> }"
     # <?cs each:mode = system.x11.display.0.mode ?><?cs if:(mode != system.x11.display.0.default) ?>
     #     Option          "MetaModes" "<?cs call:fix_display_name(system.x11.display.0.device) ?>: <?cs var:mode ?> { ViewPortIn=<?cs var:system.x11.display.0.viewport.in.x ?>x<?cs var:system.x11.display.0.viewport.in.y ?>, ViewPortOut=<?cs var:system.x11.display.0.viewport.out.x ?>x<?cs var:system.x11.display.0.viewport.out.y ?>+<?cs var:system.x11.display.0.viewport.out.plusx ?>+<?cs var:system.x11.display.0.viewport.out.plusy ?> }"<?cs /if ?><?cs /each ?> 
    -{% endif %}
    +{% endif %}
     EndSection
     
    -{% if system.x11.dualhead.enabled == "1" %}
    +{% if system.x11.dualhead.enabled == "1" %}
     Section "Screen"
     
          Identifier     "Screen1"
    @@ -6044,12 +6992,12 @@ Section "Screen"
          DefaultDepth    24
          SubSection     "Display"
              Depth       24
    -{% if system.x11.display.0.default is defined and system.x11.display.0.default %}
    -         Modes      "{{ system.x11.display.1.default }}"{% for mode in system.x11.display.1.mode %}{% if mode != system.x11.display.1.default %} "{{ mode }}"{% endif %}{% endfor %}
    +{% if system.x11.display.0.default is defined and system.x11.display.0.default %}
    +         Modes      "{{ system.x11.display.1.default }}"{% for mode in system.x11.display.1.mode %}{% if mode != system.x11.display.1.default %} "{{ mode }}"{% endif %}{% endfor %}
     
    -{% elif system.hardware.nvidia.detected == "1" %}
    +{% elif system.hardware.nvidia.detected == "1" %}
              Modes      "nvidia-auto-select"
    -{% endif %}
    +{% endif %}
           EndSubSection
     
     # <?cs if:(?system.x11.display.1.default && system.x11.display.1.default != "" && system.x11.display.1.default != "disabled") ?>
    @@ -6064,14 +7012,14 @@ Section "Screen"
     #     Option          "MetaModes" "<?cs call:fix_display_name(system.x11.display.1.device) ?>: <?cs var:mode ?> { ViewPortIn=<?cs var:system.x11.display.1.viewport.in.x ?>x<?cs var:system.x11.display.1.viewport.in.y ?>, ViewPortOut=<?cs var:system.x11.display.1.viewport.out.x ?>x<?cs var:system.x11.display.1.viewport.out.y ?>+<?cs var:system.x11.display.1.viewport.out.plusx ?>+<?cs var:system.x11.display.1.viewport.out.plusy ?> }"<?cs /if ?><?cs /each ?>
     # <?cs /if ?>
     EndSection
    -{% endif %}
    +{% endif %}
     
    -{% if not system.x11.use_compositing %}
    +{% if not system.x11.use_compositing %}
     Section "Extensions"
     # if not open-gl OSD is needed (e.g. for vdr-sxfe):
         Option         "Composite" "Disable"
     EndSection
    -{% endif %}
    +{% endif %}
     
    @@ -6101,12 +7049,12 @@ EndSection
    -
    -

    7.34 wakeup

    +
    +

    7.34 wakeup

    -
    -

    7.34.1 defaults

    +
    +

    7.34.1 defaults

    ---
    @@ -6116,8 +7064,8 @@ EndSection
     
    -
    -

    7.34.2 tasks

    +
    +

    7.34.2 tasks

    ---
    @@ -6138,8 +7086,8 @@ EndSection
     
    -
    -

    7.34.3 templates

    +
    +

    7.34.3 templates

    {{ ansible_managed | comment }}
    @@ -6165,12 +7113,12 @@ ACPI_START_AHEAD=5
     
    -
    -

    7.35 grub-config

    +
    +

    7.35 grub-config

    -
    -

    7.35.1 default variables

    +
    +

    7.35.1 default variables

    system:
    @@ -6182,8 +7130,8 @@ ACPI_START_AHEAD=5
     
    -
    -

    7.35.2 tasks

    +
    +

    7.35.2 tasks

    ---
    @@ -6208,8 +7156,8 @@ ACPI_START_AHEAD=5
     
    -
    -

    7.35.3 templates

    +
    +

    7.35.3 templates

    #!/bin/sh
    @@ -6217,27 +7165,32 @@ ACPI_START_AHEAD=5
     
     # This file is configured by the ansible configuration for yaVDR
     
    -{% if system.shutdown is defined and system.shutdown == 'reboot' %}
    -menuentry "PowerOff" {
    +{% if system.shutdown is defined and system.shutdown == 'reboot' %}
    +menuentry "PowerOff" {
         halt
    -}
    -{% endif %}
    +}
    +{% endif %}
     
    -if [ "${recordfail}" = 1 ]; then
    -    set timeout={{ 3 if grub.timeout < 3 else grub.timeout }}
    +if [ "${recordfail}" = 1 ]; then
    +    set timeout={{ 3 if grub.timeout < 3 else grub.timeout }}
     else
    -    set timeout={{ grub.timeout if grub.timeout is defined else 0 }}
    +    set timeout={{ grub.timeout if grub.timeout is defined else 0 }}
     fi
     
    -
    -

    7.35.4 handlers

    +
    +

    7.35.4 handlers

    ---
     
    +- name: Update Initramfs
    +  command: "update-initramfs -u"
    +  failed_when: ('error' in initramfs_register_update.stderr)
    +  register: initramfs_register_update
    +
     - name: Update GRUB
       command: update-grub
       failed_when: ('error' in grub_register_update.stderr)
    @@ -6251,15 +7204,15 @@ menuentry "PowerOff" {
     
    -
    -

    8 Modules

    +
    +

    8 Modules

    This section contains custom modules for the yaVDR Playbooks. They are used to collect facts about the system and configure applications and daemons.

    -
    -

    8.1 hardware_facts.py

    +
    +

    8.1 hardware_facts.py

    # This Module collects the vendor- and device ids for USB- and PCI(e)-devices and currently loaded kernel modules.
    @@ -6335,110 +7288,110 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
     from ansible.module_utils.basic import *
     
     
    -PCIDevice = namedtuple("PCIDevice", 'idVendor idProduct idClass pciPath')
    +PCIDevice = namedtuple("PCIDevice", 'idVendor idProduct idClass pciPath')
     
    -vendor_dict = {
    +vendor_dict = {
         0x10de: 'nvidia',
         0x8086: 'intel',
         0x1002: 'amd',
         0x80ee: 'virtualbox',
    -    }
    +    }
     
    -def get_pci_devices():
    -    for device in chain(glob.glob('/sys/devices/pci*/*:*:*/'), glob.glob('/sys/devices/pci*/*:*:*/*:*:*/')):
    +def get_pci_devices():
    +    for device in chain(glob.glob('/sys/devices/pci*/*:*:*/'), glob.glob('/sys/devices/pci*/*:*:*/*:*:*/')):
             try:
    -            with open(os.path.join(device, 'device')) as d:
    -                product_id = int(d.read().strip(), 16)
    -            with open(os.path.join(device, 'vendor')) as d:
    -                vendor_id = int(d.read().strip(), 16)
    -            with open(os.path.join(device, 'class')) as d:
    -                class_id = int(d.read().strip(), 16)
    -            yield PCIDevice(idVendor=vendor_id, idProduct=product_id, idClass=class_id, pciPath=device)
    +            with open(os.path.join(device, 'device')) as d:
    +                product_id = int(d.read().strip(), 16)
    +            with open(os.path.join(device, 'vendor')) as d:
    +                vendor_id = int(d.read().strip(), 16)
    +            with open(os.path.join(device, 'class')) as d:
    +                class_id = int(d.read().strip(), 16)
    +            yield PCIDevice(idVendor=vendor_id, idProduct=product_id, idClass=class_id, pciPath=device)
             except IOError:
                 pass
     
    -def format_device_list(iterator):
    -    return ["{:04x}:{:04x}".format(d.idVendor, d.idProduct) for d in iterator]
    +def format_device_list(iterator):
    +    return ["{:04x}:{:04x}".format(d.idVendor, d.idProduct) for d in iterator]
     
    -def format_gpu_device_list(iterator):
    -    def get_entries(iterator):
    +def format_gpu_device_list(iterator):
    +    def get_entries(iterator):
             for d in iterator:
                 if d.idClass == 0x030000:
    -                yield {"VendorName": vendor_dict.get(d.idVendor, "unknown"),
    -                       "VendorID": d.idVendor, "ProductID": d.idProduct}
    -    return [entry for entry in get_entries(iterator)]
    +                yield {"VendorName": vendor_dict.get(d.idVendor, "unknown"),
    +                       "VendorID": d.idVendor, "ProductID": d.idProduct}
    +    return [entry for entry in get_entries(iterator)]
     
    -def list_acpi_power_modes():
    -    acpi_power_modes = []
    +def list_acpi_power_modes():
    +    acpi_power_modes = []
         try:
    -        with open('/sys/power/state') as f:
    -            acpi_power_modes = [l for l in f.readline().split()]
    +        with open('/sys/power/state') as f:
    +            acpi_power_modes = [l for l in f.readline().split()]
         except IOError:
             pass
         return acpi_power_modes
     
    -arg_specs = {
    -    'usb': dict(default=True, type='bool', required=False),
    -    'pci': dict(default=True, type='bool', required=False),
    -    'modules': dict(default=True, type='bool', required=False),
    -    'gpus': dict(default=True, type='bool', required=False),
    -    'acpi_power_modes': dict(default=True, type='bool', required=False),
    -    }
    +arg_specs = {
    +    'usb': dict(default=True, type='bool', required=False),
    +    'pci': dict(default=True, type='bool', required=False),
    +    'modules': dict(default=True, type='bool', required=False),
    +    'gpus': dict(default=True, type='bool', required=False),
    +    'acpi_power_modes': dict(default=True, type='bool', required=False),
    +    }
     
     
    -def main():
    -    module = AnsibleModule(argument_spec=arg_specs, supports_check_mode=True,)
    -    collect_usb = module.params['usb']
    -    collect_pci = module.params['pci']
    -    collect_modules = module.params['modules']
    -    collect_gpus = module.params['gpus']
    -    collect_acpi_power_modes = module.params['acpi_power_modes']
    +def main():
    +    module = AnsibleModule(argument_spec=arg_specs, supports_check_mode=True,)
    +    collect_usb = module.params['usb']
    +    collect_pci = module.params['pci']
    +    collect_modules = module.params['modules']
    +    collect_gpus = module.params['gpus']
    +    collect_acpi_power_modes = module.params['acpi_power_modes']
     
    -    usb_devices = []
    -    pci_devices = []
    -    modules = []
    -    gpus = []
    +    usb_devices = []
    +    pci_devices = []
    +    modules = []
    +    gpus = []
         nvidia_detected = False
         intel_detected = False
         amd_detected = False
         virtualbox_detected = False
    -    acpi_power_modes = []
    +    acpi_power_modes = []
     
         if collect_usb:
    -        usb_devices = format_device_list(usb.core.find(find_all=True))
    +        usb_devices = format_device_list(usb.core.find(find_all=True))
     
         if collect_pci:
    -        pci_devices = format_device_list(get_pci_devices())
    +        pci_devices = format_device_list(get_pci_devices())
     
         if collect_modules:
    -        k = kmodpy.Kmod()
    -        modules = [m[0] for m in k.loaded()]
    +        k = kmodpy.Kmod()
    +        modules = [m[0] for m in k.loaded()]
     
         if collect_gpus:
    -        gpus = format_gpu_device_list(get_pci_devices())
    -        nvidia_detected = any((True for gpu in gpus if gpu['VendorName'] == 'nvidia'))
    -        intel_detected = any((True for gpu in gpus if gpu['VendorName'] == 'intel'))
    -        amd_detected = any((True for gpu in gpus if gpu['VendorName'] == 'amd'))
    -        virtualbox_detected = any((True for gpu in gpus if gpu['VendorName'] == 'virtualbox'))
    +        gpus = format_gpu_device_list(get_pci_devices())
    +        nvidia_detected = any((True for gpu in gpus if gpu['VendorName'] == 'nvidia'))
    +        intel_detected = any((True for gpu in gpus if gpu['VendorName'] == 'intel'))
    +        amd_detected = any((True for gpu in gpus if gpu['VendorName'] == 'amd'))
    +        virtualbox_detected = any((True for gpu in gpus if gpu['VendorName'] == 'virtualbox'))
     
         if collect_acpi_power_modes:
    -        acpi_power_modes = list_acpi_power_modes()
    +        acpi_power_modes = list_acpi_power_modes()
     
    -    data = {'usb': usb_devices, 'pci': pci_devices, 'modules': modules, 'gpus': gpus,
    +    data = {'usb': usb_devices, 'pci': pci_devices, 'modules': modules, 'gpus': gpus,
                 'acpi_power_modes': acpi_power_modes, 'nvidia_detected': nvidia_detected,
                 'intel_detected': intel_detected, 'amd_detected': amd_detected,
    -            'virtualbox_detected': virtualbox_detected}
    -    module.exit_json(changed=False, ansible_facts=data, msg=data)
    +            'virtualbox_detected': virtualbox_detected}
    +    module.exit_json(changed=False, ansible_facts=data, msg=data)
     
     
     if __name__ == '__main__':  
    -    main()
    +    main()
     
    -
    -

    8.2 satip_facts.py

    +
    +

    8.2 satip_facts.py

    DOCUMENTATION = '''
    @@ -6474,96 +7427,96 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
     SSDP_MX = 2
     SSDP_ST = "urn:ses-com:device:SatIPServer:1"
     
    -ssdpRequest = "\r\n".join((
    +ssdpRequest = "\r\n".join((
         "M-SEARCH * HTTP/1.1",
    -    "HOST: %s:%d" % (SSDP_ADDR, SSDP_PORT),
    +    "HOST: %s:%d" % (SSDP_ADDR, SSDP_PORT),
         "MAN: \"ssdp:discover\"",
    -    "MX: %d" % (SSDP_MX),
    -    "ST: %s" % (SSDP_ST),
    -    "\r\n"))
    +    "MX: %d" % (SSDP_MX),
    +    "ST: %s" % (SSDP_ST),
    +    "\r\n"))
     
     @contextmanager
    -def socket_manager(*args, **kwargs):
    +def socket_manager(*args, **kwargs):
         """provide a context manager for socket"""
    -    sock = socket.socket(*args, **kwargs)
    -    sock.setblocking(False)
    -    sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 2)
    -    sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
    +    sock = socket.socket(*args, **kwargs)
    +    sock.setblocking(False)
    +    sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, 2)
    +    sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
         try:
    -        sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
    +        sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
         except socket.error:
             pass
    -    sock.settimeout(SSDP_MX + 0.5)
    -    sock.bind((SSDP_BIND, SSDP_PORT))
    +    sock.settimeout(SSDP_MX + 0.5)
    +    sock.bind((SSDP_BIND, SSDP_PORT))
         try:
             yield sock
         finally:
    -        sock.close()
    +        sock.close()
     
     
    -def parse_satip_xml(data):
    +def parse_satip_xml(data):
         """ Parse SAT>IP XML data.
         Args:
             data (str): XML input data..
         Returns:
             dict: Parsed SAT>IP device name and frontend information.
         """
    -    result = {'name': '', 'frontends': {}}
    +    result = {'name': '', 'frontends': {}}
         if data:
    -        root = ET.fromstring(data)
    -        name = root.find('.//*/{urn:schemas-upnp-org:device-1-0}friendlyName')
    -        result['name'] = name.text
    -        satipcap = root.find('.//*/{urn:ses-com:satip}X_SATIPCAP')
    +        root = ET.fromstring(data)
    +        name = root.find('.//*/{urn:schemas-upnp-org:device-1-0}friendlyName')
    +        result['name'] = name.text
    +        satipcap = root.find('.//*/{urn:ses-com:satip}X_SATIPCAP')
             if satipcap is None:
    -            raise ValueError("Invalid SAT>IP device description")
    -        caps = {}
    -        for system in satipcap.text.split(","):
    -            cap = system.split("-")
    +            raise ValueError("Invalid SAT>IP device description")
    +        caps = {}
    +        for system in satipcap.text.split(","):
    +            cap = system.split("-")
                 if cap:
    -                count = int(cap[1])
    -                if cap[0] in caps:
    -                    count = count + caps[cap[0]]
    -                caps[cap[0]] = count
    -        result['frontends'] = caps
    +                count = int(cap[1])
    +                if cap[0] in caps:
    +                    count = count + caps[cap[0]]
    +                caps[cap[0]] = count
    +        result['frontends'] = caps
         return result
     
     
    -def main():
    -    description_urls = []
    -    device_list = []
    -    module = AnsibleModule(argument_spec={}, supports_check_mode=True,)
    -    with socket_manager(socket.AF_INET, socket.SOCK_DGRAM) as sock:
    +def main():
    +    description_urls = []
    +    device_list = []
    +    module = AnsibleModule(argument_spec={}, supports_check_mode=True,)
    +    with socket_manager(socket.AF_INET, socket.SOCK_DGRAM) as sock:
             # according to Sat>IP Specification 1.2.2, p. 20
             # a client should send three requests within 100 ms with a ttl of 2
     
    -        for _ in range(3):
    -            sock.sendto(ssdpRequest, (SSDP_ADDR, SSDP_PORT))
    -            time.sleep(0.03)
    +        for _ in range(3):
    +            sock.sendto(ssdpRequest, (SSDP_ADDR, SSDP_PORT))
    +            time.sleep(0.03)
             try:
    -            response = sock.recv(1024)
    +            response = sock.recv(1024)
                 if response and "SERVER:" in response:
    -                for line in response.splitlines():
    +                for line in response.splitlines():
                         if "LOCATION" in line:
    -                        url = line.split()[-1].strip()
    +                        url = line.split()[-1].strip()
                             if url not in description_urls:
    -                            description_urls.append(url)
    -                            info = requests.get(url, timeout=2)
    -                            device_list.append(parse_satip_xml(info.text))
    +                            description_urls.append(url)
    +                            info = requests.get(url, timeout=2)
    +                            device_list.append(parse_satip_xml(info.text))
                 else:
    -                raise ValueError('No satip server detected')
    -        except (socket.timeout, ValueError, ET.ParseError):
    +                raise ValueError('No satip server detected')
    +        except (socket.timeout, ValueError, ET.ParseError):
                 pass
     
    -    module.exit_json(changed=False, ansible_facts={'satip_devices': device_list})
    +    module.exit_json(changed=False, ansible_facts={'satip_devices': device_list})
     
     if __name__ == '__main__':
    -    main()
    +    main()
     
    -
    -

    8.3 xrandr_facts.py

    +
    +

    8.3 xrandr_facts.py

    • [ ] support multiple screens (-d :0.0 .. :0.n)
    • @@ -6627,139 +7580,139 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c var: xorg ''' -ARG_SPECS = { - 'display': dict(default=":0", type='str', required=False), - 'preferred_outputs': dict( - default=["HDMI", "DP", "DVI", "VGA", "TV"], type='list', required=False), - 'preferred_refreshrates': dict( - default=[50, 60, 75, 30, 25], type='list', required=False), - 'preferred_resolutions': dict( - default=[ - "7680x4320", "3840x2160", "1920x1080", "1280x720", "720x576"], - type='list', required=False), - 'write_edids': dict(default=True, type='bool', required=False), - } +ARG_SPECS = { + 'display': dict(default=":0", type='str', required=False), + 'preferred_outputs': dict( + default=["HDMI", "DP", "DVI", "VGA", "TV"], type='list', required=False), + 'preferred_refreshrates': dict( + default=[50, 60, 75, 30, 25], type='list', required=False), + 'preferred_resolutions': dict( + default=[ + "7680x4320", "3840x2160", "1920x1080", "1280x720", "720x576"], + type='list', required=False), + 'write_edids': dict(default=True, type='bool', required=False), + } -SCREEN_REGEX = re.compile("^(?P<screen>Screen\s\d+:)(?:.*)") -CONNECTOR_REGEX = re.compile( - "^(?P<connector>.*-\d+)\s(?P<connection_state>connected|disconnected)\s(?P<primary>primary)?") -MODE_REGEX = re.compile("^\s+(?P<resolution>\d{3,}x\d{3,}).*") +SCREEN_REGEX = re.compile("^(?P<screen>Screen\s\d+:)(?:.*)") +CONNECTOR_REGEX = re.compile( + "^(?P<connector>.*-\d+)\s(?P<connection_state>connected|disconnected)\s(?P<primary>primary)?") +MODE_REGEX = re.compile("^\s+(?P<resolution>\d{3,}x\d{3,}).*") -Mode = namedtuple('Mode', ['connection', 'resolution', 'refreshrate']) +Mode = namedtuple('Mode', ['connection', 'resolution', 'refreshrate']) -def check_for_screen(line): +def check_for_screen(line): """check line for screen information""" - match = re.match(SCREEN_REGEX, line) + match = re.match(SCREEN_REGEX, line) if match: - return match.groupdict()['screen'] + return match.groupdict()['screen'] -def check_for_connection(line): +def check_for_connection(line): """check line for connection name and state""" - match = re.match(CONNECTOR_REGEX, line) + match = re.match(CONNECTOR_REGEX, line) connector = None is_connected = False if match: - match = match.groupdict() - connector = match['connector'] - is_connected = True if match['connection_state'] == 'connected' else False + match = match.groupdict() + connector = match['connector'] + is_connected = True if match['connection_state'] == 'connected' else False return connector, is_connected -def get_indentation(line): +def get_indentation(line): """return the number of leading whitespace characters""" - return len(line) - len(line.lstrip()) + return len(line) - len(line.lstrip()) -def sort_mode(mode): +def sort_mode(mode): """rate modes by several criteria""" connection_score = 0 rrate_score = 0 resolution_score = 0 - preferred_rrates = module.params['preferred_refreshrates'] + preferred_rrates = module.params['preferred_refreshrates'] # [50, 60] - preferred_resolutions = module.params['preferred_resolutions'] + preferred_resolutions = module.params['preferred_resolutions'] # ["7680x4320", "3840x2160", "1920x1080", "1280x720", "720x576"] - preferred_outputs = module.params['preferred_outputs'] + preferred_outputs = module.params['preferred_outputs'] # ["HDMI", "DP", "DVI", "VGA"] if mode.refreshrate in preferred_rrates: - rrate_score = len(preferred_rrates) - preferred_rrates.index(mode.refreshrate) + rrate_score = len(preferred_rrates) - preferred_rrates.index(mode.refreshrate) if mode.resolution in preferred_resolutions: - resolution_score = len(preferred_resolutions) - preferred_resolutions.index(mode.resolution) - x_resolution, y_resolution = (int(n) for n in mode.resolution.split('x')) - connection = mode.connection.split('-')[0] + resolution_score = len(preferred_resolutions) - preferred_resolutions.index(mode.resolution) + x_resolution, y_resolution = (int(n) for n in mode.resolution.split('x')) + connection = mode.connection.split('-')[0] if connection in preferred_outputs: - connection_score = len(preferred_outputs) - preferred_outputs.index(connection) - return (rrate_score, resolution_score, x_resolution, y_resolution, connection_score) + connection_score = len(preferred_outputs) - preferred_outputs.index(connection) + return (rrate_score, resolution_score, x_resolution, y_resolution, connection_score) -def parse_xrandr_verbose(iterator): +def parse_xrandr_verbose(iterator): """parse the output of xrandr --verbose using an iterator delivering single lines""" - xorg = {} + xorg = {} is_connected = False for line in iterator: - if line.startswith('Screen'): - screen = check_for_screen(line) - xorg[screen] = {} + if line.startswith('Screen'): + screen = check_for_screen(line) + xorg[screen] = {} elif 'connected' in line: - connector, is_connected = check_for_connection(line) - xorg[screen][connector] = { + connector, is_connected = check_for_connection(line) + xorg[screen][connector] = { 'is_connected': is_connected, 'EDID': '', - 'modes': {}, + 'modes': {}, 'preferred': '', 'current': '', 'auto': '', - } + } elif is_connected and 'EDID:' in line: edid_str = "" - outer_indentation = get_indentation(line) + outer_indentation = get_indentation(line) while True: - line = next(iterator) - if get_indentation(line) > outer_indentation: - edid_str += line.strip() + line = next(iterator) + if get_indentation(line) > outer_indentation: + edid_str += line.strip() else: break - xorg[screen][connector]['EDID'] = edid_str + xorg[screen][connector]['EDID'] = edid_str elif is_connected and "MHz" in line and not "Interlace" in line: - match = re.match(MODE_REGEX, line) + match = re.match(MODE_REGEX, line) if match: - match = match.groupdict() - preferred = bool("+preferred" in line) - current = bool("*current" in line) + match = match.groupdict() + preferred = bool("+preferred" in line) + current = bool("*current" in line) while True: - line = next(iterator) - if line.strip().startswith('v:'): - refresh_rate = ast.literal_eval(line.split()[-1][:-2]) - rrate = int(round(refresh_rate)) - if xorg[screen][connector]['modes'].get(match['resolution']) is None: - xorg[screen][connector]['modes'][match['resolution']] = [] - if rrate not in xorg[screen][connector]['modes'][match['resolution']]: - xorg[screen][connector]['modes'][match['resolution']].append(rrate) + line = next(iterator) + if line.strip().startswith('v:'): + refresh_rate = ast.literal_eval(line.split()[-1][:-2]) + rrate = int(round(refresh_rate)) + if xorg[screen][connector]['modes'].get(match['resolution']) is None: + xorg[screen][connector]['modes'][match['resolution']] = [] + if rrate not in xorg[screen][connector]['modes'][match['resolution']]: + xorg[screen][connector]['modes'][match['resolution']].append(rrate) if preferred: - xorg[screen][connector]['preferred'] = "{}_{}".format( - match['resolution'], rrate) + xorg[screen][connector]['preferred'] = "{}_{}".format( + match['resolution'], rrate) if current: - xorg[screen][connector]['current'] = "{}_{}".format( - match['resolution'], rrate) + xorg[screen][connector]['current'] = "{}_{}".format( + match['resolution'], rrate) break return xorg -def parse_edid_data(edid): +def parse_edid_data(edid): vendor = "Unknown" model = "Unknown" try: - data = subprocess.check_output("parse-edid < {}".format(edid), - shell=True, universal_newlines=True) + data = subprocess.check_output("parse-edid < {}".format(edid), + shell=True, universal_newlines=True) except subprocess.CalledProcessError: pass else: - for line in data.splitlines(): + for line in data.splitlines(): if "VendorName" in line: - vendor = line.strip().split('"')[1] + vendor = line.strip().split('"')[1] if "ModelName" in line: - model = line.strip().split('"')[1] + model = line.strip().split('"')[1] return vendor, model -def collect_nvidia_data(): - BusID_RE = re.compile(( +def collect_nvidia_data(): + BusID_RE = re.compile(( '(?P<domain>[0-9a-fA-F]+)' ':' '(?P<bus>[0-9a-fA-F]+)' @@ -6767,91 +7720,91 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c '(?P<device>[0-9a-fA-F]+)' '\.' '(?P<function>[0-9a-fA-F]+)' - )) + )) try: - data = subprocess.check_output(["nvidia-smi", "--query-gpu=name,pci.bus_id", "--format=csv", "-i0"], - universal_newlines=True) + data = subprocess.check_output(["nvidia-smi", "--query-gpu=name,pci.bus_id", "--format=csv", "-i0"], + universal_newlines=True) except subprocess.CalledProcessError: pass except OSError: # nvidia-smi is not installed pass else: - for row in csv.DictReader(data.splitlines(), delimiter=',', skipinitialspace=True): - name = row['name'] - bus_id = row['pci.bus_id'] + for row in csv.DictReader(data.splitlines(), delimiter=',', skipinitialspace=True): + name = row['name'] + bus_id = row['pci.bus_id'] # pci.bus_id structure as reported by nvidia-smi: "domain:bus:device.function", in hex. - match = BusID_RE.search(bus_id) + match = BusID_RE.search(bus_id) if match: - domain, bus, device, function = (int(n, 16) for n in match.groups()) - bus_id = "PCI:{:d}@{:d}:{:d}:{:d}".format(bus, domain, device, function) + domain, bus, device, function = (int(n, 16) for n in match.groups()) + bus_id = "PCI:{:d}@{:d}:{:d}:{:d}".format(bus, domain, device, function) return name, bus_id raise ValueError -def output_data(data, write_edids=True): +def output_data(data, write_edids=True): if data: - modes = [] - for _, screen_data in data.items(): - for connector, connection_data in screen_data.items(): - if connection_data.get('EDID') and write_edids: - with open('/etc/X11/edid.{}.bin'.format(connector), 'wb') as edid: - edid.write(binascii.a2b_hex(connection_data['EDID'])) - for resolution, refreshrates in connection_data['modes'].items(): + modes = [] + for _, screen_data in data.items(): + for connector, connection_data in screen_data.items(): + if connection_data.get('EDID') and write_edids: + with open('/etc/X11/edid.{}.bin'.format(connector), 'wb') as edid: + edid.write(binascii.a2b_hex(connection_data['EDID'])) + for resolution, refreshrates in connection_data['modes'].items(): for refreshrate in refreshrates: - modes.append(Mode(connector, resolution, refreshrate)) + modes.append(Mode(connector, resolution, refreshrate)) if modes: - result = {} + result = {} try: - gpu_name, bus_id = collect_nvidia_data() + gpu_name, bus_id = collect_nvidia_data() except ValueError: gpu_name = None bus_id = None - def create_entry(my_dict, name, connector, resolution, refreshrate, vendor, model): - my_dict[name] = { + def create_entry(my_dict, name, connector, resolution, refreshrate, vendor, model): + my_dict[name] = { 'connector': connector, 'resolution': resolution, 'refreshrate': refreshrate, - 'edid': '/etc/X11/edid.{}.bin'.format(connector), - 'mode': "{}_{}".format(resolution, refreshrate), + 'edid': '/etc/X11/edid.{}.bin'.format(connector), + 'mode': "{}_{}".format(resolution, refreshrate), 'vendor': vendor, 'model': model, - } + } if gpu_name and bus_id: - result[name]['gpu_name'] = gpu_name - result[name]['bus_id'] = bus_id + result[name]['gpu_name'] = gpu_name + result[name]['bus_id'] = bus_id - connector_0, resolution_0, refreshrate_0 = max(modes, key=sort_mode)[:3] - vendor_0, model_0 = parse_edid_data('/etc/X11/edid.{}.bin'.format(connector_0)) - create_entry(result, 'primary', connector_0, resolution_0, refreshrate_0, vendor_0, model_0) + connector_0, resolution_0, refreshrate_0 = max(modes, key=sort_mode)[:3] + vendor_0, model_0 = parse_edid_data('/etc/X11/edid.{}.bin'.format(connector_0)) + create_entry(result, 'primary', connector_0, resolution_0, refreshrate_0, vendor_0, model_0) # check if additional monitors exist - other_modes = [mode for mode in modes if mode[0] != connector_0] + other_modes = [mode for mode in modes if mode[0] != connector_0] if other_modes: - connector_1, resolution_1, refreshrate_1 = max(other_modes, key=sort_mode)[:3] - vendor_1, model_1 = parse_edid_data('/etc/X11/edid.{}.bin'.format(connector_1)) - create_entry(result, 'secondary', connector_1, resolution_1, refreshrate_1, vendor_1, model_1) + connector_1, resolution_1, refreshrate_1 = max(other_modes, key=sort_mode)[:3] + vendor_1, model_1 = parse_edid_data('/etc/X11/edid.{}.bin'.format(connector_1)) + create_entry(result, 'secondary', connector_1, resolution_1, refreshrate_1, vendor_1, model_1) #print(json.dumps(data, sort_keys=True, indent=4)) - module.exit_json(changed=True if write_edids else False, ansible_facts={'xrandr': data, 'xorg': result}) + module.exit_json(changed=True if write_edids else False, ansible_facts={'xrandr': data, 'xorg': result}) if __name__ == '__main__': - module = AnsibleModule(argument_spec=ARG_SPECS, supports_check_mode=False,) + module = AnsibleModule(argument_spec=ARG_SPECS, supports_check_mode=False,) try: - d = subprocess.check_output(['xrandr', '-d', module.params['display'], '--verbose'], universal_newlines=True).splitlines() + d = subprocess.check_output(['xrandr', '-d', module.params['display'], '--verbose'], universal_newlines=True).splitlines() except subprocess.CalledProcessError: - xorg_data = {} + xorg_data = {} else: - xorg_data = parse_xrandr_verbose(iter(d)) - output_data(xorg_data, module.params['write_edids']) + xorg_data = parse_xrandr_verbose(iter(d)) + output_data(xorg_data, module.params['write_edids'])
    -
    -

    9 Handlers

    +
    +

    9 Handlers

    - name: Reconfigure unattended upgrades with dpkg
    @@ -6933,6 +7886,10 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
         name: x@vt7.service
         state: stopped
       register: x_stop
    +
    +- name: reboot required
    +  debug:
    +    msg: PLEASE REBOOT YOUR SYSTEM.
     
    @@ -6940,7 +7897,7 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c

    Autor: Alexander Grothe <seahawk1986@gmx.de>

    -

    Created: 2018-06-02 Sa 20:04

    +

    Created: 2018-08-10 Fr 08:10

    Validate

    diff --git a/Manual.org b/Manual.org index 37bc587..dd139f6 100644 --- a/Manual.org +++ b/Manual.org @@ -4879,19 +4879,35 @@ dependencies: # This role provides easyily downloadable firmware files -- name: Firmware for Hauppauge WinTV HD Solo/Duo, PCTV 292e +- name: Firmware dvb-demod-si2168-b40-01.fw for Hauppauge WinTV HD Solo/Duo, PCTV 292e get_url: url: https://github.com/OpenELEC/dvb-firmware/raw/master/firmware/dvb-demod-si2168-b40-01.fw checksum: sha256:8507536630d75a316d0719d6b95c04b90c36baa5b457ad457c9bacadafcef134 dest: /lib/firmware/dvb-demod-si2168-b40-01.fw when: '"2040:0264" in usb or "2013:025f" in usb' -- name: Firmware for Hauppauge WinTV-HVR-930C +- name: Firmware dvb-fe-xc5000-1.6.114.fw for Hauppauge WinTV-HVR-930C get_url: url: https://github.com/OpenELEC/dvb-firmware/raw/master/firmware/dvb-fe-xc5000-1.6.114.fw checksum: sha256:7104bda8df301fe1bd4c09de1708aeb6d0d8e1f9d55505449fecfad82639235f dest: /lib/firmware/dvb-fe-xc5000-1.6.114.fw when: '"2040:1605" in usb' + +- name: Firmware ngenge_18.fw for ngene cards + get_url: + url: http://l4m-daten.de/downloads/firmware/dvb-s2/linux/all/ngene_18.fw + checksum: sha256:213d98ec2cd575eba15d82ee79fed7098e670de43792f8aa773a95cfb7c32060 + dest: /lib/firmware/ngene_18.fw + when: '"ngene" in modules' + notify: reboot required + +- name: Firmware drxk_a3.mc for drxk + get_url: + url: https://github.com/OpenELEC/dvb-firmware/raw/master/firmware/drxk_a3.mc + checksum: sha256:f8956ad6f92a4ce90a6ab94ed23e2f9a27e9317e936fd3e0119778dd28e7e294 + dest: /lib/firmware/drxk_a3.mc + when: '"ngene" in modules or "drxk" in modules' + notify: reboot required #+END_SRC ** autoinstall-dvbsky-firmware *** dependencies @@ -6153,4 +6169,8 @@ if __name__ == '__main__': name: x@vt7.service state: stopped register: x_stop + +- name: reboot required + debug: + msg: PLEASE REBOOT YOUR SYSTEM. #+END_SRC From 5035437aa26ecdda8d0bff4b4356c9827f7bc50e Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Fri, 10 Aug 2018 08:59:46 +0200 Subject: [PATCH 08/20] Fix shebang --- Manual.org | 2 +- library/hardware_facts.py | 2 +- library/pci_facts.py | 69 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 2 deletions(-) create mode 100755 library/pci_facts.py diff --git a/Manual.org b/Manual.org index dd139f6..d8f4ac1 100644 --- a/Manual.org +++ b/Manual.org @@ -5515,7 +5515,7 @@ fi * Modules This section contains custom modules for the yaVDR Playbooks. They are used to collect facts about the system and configure applications and daemons. ** hardware_facts.py -#+BEGIN_SRC python :tangle library/hardware_facts.py :shebang #!/usr/bin/env/python +#+BEGIN_SRC python :tangle library/hardware_facts.py :shebang "#!/usr/bin/env python" # This Module collects the vendor- and device ids for USB- and PCI(e)-devices and currently loaded kernel modules. DOCUMENTATION = ''' --- diff --git a/library/hardware_facts.py b/library/hardware_facts.py index c9f0693..115aeb8 100755 --- a/library/hardware_facts.py +++ b/library/hardware_facts.py @@ -1,4 +1,4 @@ -#!/usr/bin/env/python +#!/usr/bin/env python # This Module collects the vendor- and device ids for USB- and PCI(e)-devices and currently loaded kernel modules. DOCUMENTATION = ''' --- diff --git a/library/pci_facts.py b/library/pci_facts.py new file mode 100755 index 0000000..5cc0e0c --- /dev/null +++ b/library/pci_facts.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python +# This module parses the output of lspci for detailed information about available (sub) devices. +DOCUMENTATION = ''' + --- + module: pci_facts + short_description: parses lspci output for detailed (sub) devices data + description: + - This module parses the output of lspci for detailed information about available (sub) devices. + - returns a list with a dict for each device + +notes: + - requires lspci (package pciutils) + +''' + +EXAMPLES = ''' +- name: get detailled pci device infos + pci_facts: + +- debug: + var: pci_devices +''' + + +import argparse +import shlex +import subprocess +from collections import namedtuple + +from ansible.module_utils.basic import * + +def convert2hex(arg): + arg = arg.strip('"') + if arg: + return int(arg, 16) + else: + return None + +def parse_lspci_data(): + parser = argparse.ArgumentParser() + parser.add_argument('-r', '--revision', help='revision', type=convert2hex) + parser.add_argument('-p', '--progif', help='proginf', type=convert2hex) + parser.add_argument('slot') + parser.add_argument('device_class', type=convert2hex) + parser.add_argument('vendor_id', type=convert2hex) + parser.add_argument('device_id', type=convert2hex) + parser.add_argument('sub_vendor_id', type=convert2hex) + parser.add_argument('sub_device_id', type=convert2hex) + parser.add_argument('other', nargs='*', default=[]) + + devices = [] + for line in subprocess.check_output(['lspci', '-nm'], universal_newlines=True).splitlines(): + args = parser.parse_args(args=shlex.split(line)) + devices.append(vars(args)) + return devices + + +def main(): + arg_specs = {} + module = AnsibleModule(argument_spec=arg_specs, supports_check_mode=True,) + try: + pci_devices = parse_lspci_data() + except: + module.fail_json(msg="Something fatal happened") + data = {'pci_devices': pci_devices} + module.exit_json(changed=False, ansible_facts=data, msg=data) + +if __name__ == '__main__': + main() From 48710c22c6aea5dcb8c3cfe2f40e3f8563812e6e Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Fri, 10 Aug 2018 09:01:53 +0200 Subject: [PATCH 09/20] Add pci_facts.py module for detailed PCI device descriptions --- Manual.org | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/Manual.org b/Manual.org index d8f4ac1..850d6b0 100644 --- a/Manual.org +++ b/Manual.org @@ -5688,6 +5688,78 @@ def main(): if __name__ == '__main__': main() #+END_SRC +** pci_facts.py +#+BEGIN_SRC python :tangle library/pci_facts.py :shebang "#!/usr/bin/env python" + +# This module parses the output of lspci for detailed information about available (sub) devices. +DOCUMENTATION = ''' + --- + module: pci_facts + short_description: parses lspci output for detailed (sub) devices data + description: + - This module parses the output of lspci for detailed information about available (sub) devices. + - returns a list with a dict for each device + +notes: + - requires lspci (package pciutils) + +''' + +EXAMPLES = ''' +- name: get detailled pci device infos + pci_facts: + +- debug: + var: pci_devices +''' + + +import argparse +import shlex +import subprocess +from collections import namedtuple + +from ansible.module_utils.basic import * + +def convert2hex(arg): + arg = arg.strip('"') + if arg: + return int(arg, 16) + else: + return None + +def parse_lspci_data(): + parser = argparse.ArgumentParser() + parser.add_argument('-r', '--revision', help='revision', type=convert2hex) + parser.add_argument('-p', '--progif', help='proginf', type=convert2hex) + parser.add_argument('slot') + parser.add_argument('device_class', type=convert2hex) + parser.add_argument('vendor_id', type=convert2hex) + parser.add_argument('device_id', type=convert2hex) + parser.add_argument('sub_vendor_id', type=convert2hex) + parser.add_argument('sub_device_id', type=convert2hex) + parser.add_argument('other', nargs='*', default=[]) + + devices = [] + for line in subprocess.check_output(['lspci', '-nm'], universal_newlines=True).splitlines(): + args = parser.parse_args(args=shlex.split(line)) + devices.append(vars(args)) + return devices + + +def main(): + arg_specs = {} + module = AnsibleModule(argument_spec=arg_specs, supports_check_mode=True,) + try: + pci_devices = parse_lspci_data() + except: + module.fail_json(msg="Something fatal happened") + data = {'pci_devices': pci_devices} + module.exit_json(changed=False, ansible_facts=data, msg=data) + +if __name__ == '__main__': + main() +#+END_SRC ** satip_facts.py #+BEGIN_SRC python :tangle library/satip_facts.py :shebang #!/usr/bin/env python2 DOCUMENTATION = ''' From 057411cec8da2b4ffd92446bf55294554c4d819a Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Fri, 10 Aug 2018 09:06:15 +0200 Subject: [PATCH 10/20] Collect detailed pci device information in variable pci_devices --- Manual.org | 8 ++++++++ roles/collect-facts/tasks/main.yml | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/Manual.org b/Manual.org index 850d6b0..d62eaad 100644 --- a/Manual.org +++ b/Manual.org @@ -621,6 +621,14 @@ first_run: False - amd_detected - virtualbox_detected +- name: get detailed PCI device information + pci_facts: + tags: + - always + +- debug: + var: pci_devices + - name: known vdr output plugins set_fact: vdr_output_plugins: diff --git a/roles/collect-facts/tasks/main.yml b/roles/collect-facts/tasks/main.yml index 437f68e..4bd6233 100644 --- a/roles/collect-facts/tasks/main.yml +++ b/roles/collect-facts/tasks/main.yml @@ -22,6 +22,14 @@ - amd_detected - virtualbox_detected +- name: get detailed PCI device information + pci_facts: + tags: + - always + +- debug: + var: pci_devices + - name: known vdr output plugins set_fact: vdr_output_plugins: From 8a91c4f7cdf017702857688043f9d32fb5fbe63b Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Fri, 10 Aug 2018 09:09:34 +0200 Subject: [PATCH 11/20] only show output when ansible is called with -v --- Manual.org | 1 + roles/collect-facts/tasks/main.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/Manual.org b/Manual.org index d62eaad..e474362 100644 --- a/Manual.org +++ b/Manual.org @@ -628,6 +628,7 @@ first_run: False - debug: var: pci_devices + verbosity: 1 - name: known vdr output plugins set_fact: diff --git a/roles/collect-facts/tasks/main.yml b/roles/collect-facts/tasks/main.yml index 4bd6233..578ac21 100644 --- a/roles/collect-facts/tasks/main.yml +++ b/roles/collect-facts/tasks/main.yml @@ -29,6 +29,7 @@ - debug: var: pci_devices + verbosity: 1 - name: known vdr output plugins set_fact: From 4c6c77ccc55496f51fb289985e7fe4097add088f Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Fri, 10 Aug 2018 10:52:10 +0200 Subject: [PATCH 12/20] Add python-jmespath for the json_filter functionality provied by ansible --- Manual.org | 2 +- install-yavdr.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Manual.org b/Manual.org index e474362..f84f30b 100644 --- a/Manual.org +++ b/Manual.org @@ -150,7 +150,7 @@ apt-get -y install software-properties-common # update packages apt-get update # install required packages -apt-get -y install --no-install-recommends ansible +apt-get -y install --no-install-recommends ansible python-jmespath # TODO: run ansible on local host ansible-playbook yavdr07.yml -b -i 'localhost_inventory' --connection=local --tags="all" --extra-vars "first_run=True" diff --git a/install-yavdr.sh b/install-yavdr.sh index 103214f..5c1d0ad 100755 --- a/install-yavdr.sh +++ b/install-yavdr.sh @@ -8,7 +8,7 @@ apt-get -y install software-properties-common # update packages apt-get update # install required packages -apt-get -y install --no-install-recommends ansible +apt-get -y install --no-install-recommends ansible python-jmespath # TODO: run ansible on local host ansible-playbook yavdr07.yml -b -i 'localhost_inventory' --connection=local --tags="all" --extra-vars "first_run=True" From 73a7e75db94103bcdbd1acf566fb98fd027a961f Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Fri, 10 Aug 2018 11:53:28 +0200 Subject: [PATCH 13/20] improve installation of kodi-send install kodi-eventclients-xmbc-send if available, else install kodi-eventclients-kodi-send --- roles/kodi/tasks/install-kodi.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/roles/kodi/tasks/install-kodi.yml b/roles/kodi/tasks/install-kodi.yml index 1eb182b..5897541 100644 --- a/roles/kodi/tasks/install-kodi.yml +++ b/roles/kodi/tasks/install-kodi.yml @@ -8,4 +8,15 @@ with_items: - kodi - kodi-pvr-vdr-vnsi - - kodi-eventclients-kodi-send # for ubuntu packages, team-xbmc uses "kodi-eventclients-xbmc-send for some reason + +- name: apt | install kodi-send + block: + - apt: + name: "kodi-eventclients-xbmc-send" # team-xbmc uses "kodi-eventclients-xbmc-send for some reason + state: present + install_recommends: no + rescue: + - apt: + name: "kodi-eventclients-kodi-send" # fallback to ubuntu package + state: present + install_recommends: no From 3a349fd6ed12afdfa5338133e28e977102f50a11 Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Fri, 10 Aug 2018 14:40:22 +0200 Subject: [PATCH 14/20] Prevent increasing failed status count when package is not available --- roles/kodi/tasks/install-kodi.yml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/roles/kodi/tasks/install-kodi.yml b/roles/kodi/tasks/install-kodi.yml index 5897541..fa2f47b 100644 --- a/roles/kodi/tasks/install-kodi.yml +++ b/roles/kodi/tasks/install-kodi.yml @@ -9,14 +9,17 @@ - kodi - kodi-pvr-vdr-vnsi -- name: apt | install kodi-send - block: - - apt: - name: "kodi-eventclients-xbmc-send" # team-xbmc uses "kodi-eventclients-xbmc-send for some reason - state: present - install_recommends: no - rescue: - - apt: - name: "kodi-eventclients-kodi-send" # fallback to ubuntu package - state: present - install_recommends: no +- name: apt | install kodi-send (team-xbmc PPA) + apt: + name: "kodi-eventclients-xbmc-send" # team-xbmc uses "kodi-eventclients-xbmc-send for some reason + state: present + install_recommends: no + register: team_xbmc_ppa + ignore_errors: True + +- name: apt | install kodi-send (Ubuntu package) + apt: + name: "kodi-eventclients-kodi-send" # fallback to ubuntu package + state: present + install_recommends: no + when: team_xbmc_ppa.failed From 171bdd2eff93cc13c3c17539d9b817ab69aa7e96 Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Fri, 10 Aug 2018 16:03:57 +0200 Subject: [PATCH 15/20] Add SIGKILL to "normal" exit codes --- roles/kodi/templates/kodi.service.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kodi/templates/kodi.service.j2 b/roles/kodi/templates/kodi.service.j2 index 87ec8f6..d200cf0 100644 --- a/roles/kodi/templates/kodi.service.j2 +++ b/roles/kodi/templates/kodi.service.j2 @@ -8,5 +8,5 @@ ExecStartPre=-/usr/bin/set-kodi-display ExecStart=/usr/bin/kodi -l /run/lirc/lircd ExecStop=/bin/bash -c "/usr/bin/kodi-send --action=QUIT; while ps -p $MAINPID -o comm=; do sleep .25; done" TimeoutStopSec=10 -SuccessExitStatus=0 127 +SuccessExitStatus=0 127 SIGKILL Restart=on-failure From 468de0a2f3ca133fb92d9af8d8e3f50a76f5f670 Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Sat, 25 Aug 2018 15:57:15 +0200 Subject: [PATCH 16/20] Disable warning when running shell command --- roles/dvd/tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/roles/dvd/tasks/main.yml b/roles/dvd/tasks/main.yml index ebbb462..1ab5b0e 100644 --- a/roles/dvd/tasks/main.yml +++ b/roles/dvd/tasks/main.yml @@ -29,3 +29,4 @@ shell: sed 's/--lock-media //' /lib/udev/rules.d/60-cdrom_id.rules > /etc/udev/rules.d/60-cdrom_id.rules args: creates: /etc/udev/rules.d/60-cdrom_id.rules + warn: false From 804f9f172faf53b0f63b5bed67068a071ad01a13 Mon Sep 17 00:00:00 2001 From: seahawk1986 Date: Mon, 3 Sep 2018 11:11:48 +0200 Subject: [PATCH 17/20] create empty result if no data have been found --- library/xrandr_facts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/xrandr_facts.py b/library/xrandr_facts.py index 735d8a9..d793579 100755 --- a/library/xrandr_facts.py +++ b/library/xrandr_facts.py @@ -219,6 +219,7 @@ def collect_nvidia_data(): def output_data(data, write_edids=True): + result = {} if data: modes = [] for _, screen_data in data.items(): @@ -230,7 +231,6 @@ def output_data(data, write_edids=True): for refreshrate in refreshrates: modes.append(Mode(connector, resolution, refreshrate)) if modes: - result = {} try: gpu_name, bus_id = collect_nvidia_data() except ValueError: From 260653229b880b9b2def2b93b01594b616e042d7 Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Tue, 4 Sep 2018 13:21:32 +0200 Subject: [PATCH 18/20] Rearrange Installation of xineliboutput when a VM is detected --- Manual.org | 4 ++-- roles/autoinstall-virtualbox-guest/tasks/main.yml | 2 +- yavdr07.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Manual.org b/Manual.org index f84f30b..11fe1a1 100644 --- a/Manual.org +++ b/Manual.org @@ -171,9 +171,9 @@ The ~yavdr07.yml~ playbook sets up a fully-featured yaVDR installation: - collect-facts # query system facts - autoinstall-ubuntu-drivers # use ubuntu-drivers to install proprietary dirvers # (e.g. nvidia, virtualbox) - - autoinstall-virtualbox-guest # - nvidia-experimental # install very recent nvidia dirver from ppa:graphics-drivers/ppa - vdr # install vdr and related packages + - autoinstall-virtualbox-guest - yavdr-network # enable network client capabilities - samba-install # install samba server - samba-config # configure samba server @@ -4650,7 +4650,7 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04 - vdrctl enable xineliboutput ignore_errors: yes when: - - ansible_virtualization_type == "virtualbox" + - ansible_virtualization_type == "virtualbox" or ansible_virtualization_type == "VMware" - ansible_virtualization_role == "guest" #+END_SRC ** autoinstall-atric-usb diff --git a/roles/autoinstall-virtualbox-guest/tasks/main.yml b/roles/autoinstall-virtualbox-guest/tasks/main.yml index cea1b7e..e240502 100644 --- a/roles/autoinstall-virtualbox-guest/tasks/main.yml +++ b/roles/autoinstall-virtualbox-guest/tasks/main.yml @@ -36,5 +36,5 @@ - vdrctl enable xineliboutput ignore_errors: yes when: - - ansible_virtualization_type == "virtualbox" + - ansible_virtualization_type == "virtualbox" or ansible_virtualization_type == "VMware" - ansible_virtualization_role == "guest" diff --git a/yavdr07.yml b/yavdr07.yml index e171680..947144a 100644 --- a/yavdr07.yml +++ b/yavdr07.yml @@ -10,9 +10,9 @@ - collect-facts # query system facts - autoinstall-ubuntu-drivers # use ubuntu-drivers to install proprietary dirvers # (e.g. nvidia, virtualbox) - - autoinstall-virtualbox-guest # - nvidia-experimental # install very recent nvidia dirver from ppa:graphics-drivers/ppa - vdr # install vdr and related packages + - autoinstall-virtualbox-guest - yavdr-network # enable network client capabilities - samba-install # install samba server - samba-config # configure samba server From 4c78cdf79aae9c76f14574012192786d9a15382e Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Tue, 4 Sep 2018 13:22:41 +0200 Subject: [PATCH 19/20] Update Manual.html --- Manual.html | 1046 ++++++++++++++++++++++++++++----------------------- 1 file changed, 574 insertions(+), 472 deletions(-) diff --git a/Manual.html b/Manual.html index 41263e1..cc976a5 100644 --- a/Manual.html +++ b/Manual.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Ansible Playbooks for yaVDR 0.7 @@ -240,261 +240,262 @@ for the JavaScript code in this tag.

    Inhaltsverzeichnis

    -
    -

    1 User Stories

    +
    +

    1 User Stories

    -
    -

    1.1 yavdr-full

    +
    +

    1.1 yavdr-full

    A User wants to install yaVDR without customization and relies on full automation. @@ -527,22 +528,22 @@ Several roles are used to tie everything together:

    -
    -

    1.1.1 Using vdr, pulseaudio and xorg together

    +
    +

    1.1.1 Using vdr, pulseaudio and xorg together

    -
    -

    2 Introduction

    +
    +

    2 Introduction

    One of the major problems we faced with customized Ubuntu ISO files as installation media for prior yaVDR versions has been the limited hardware support and the time consuming process to create and update them. An interesting alternative to this approach is to enable the user to choose the installation medium by himself, so point releases, kernel versions and additional drivers can be chosen deliberately. After the basic setup is complete (and a working internet connection is available), a fully customizable install script completes the yaVDR installation.

    -
    -

    3 Installing and configuring yaVDR with Ansible

    +
    +

    3 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 Ansible. @@ -577,8 +578,8 @@ We use a callback to generate tags for all roles autmatically:

    -
    -

    3.1 Install script for local usage

    +
    +

    3.1 Install script for local usage

    if (( $EUID != 0 )); then
    @@ -590,7 +591,7 @@ apt-get -y install software-properties-common
     # update packages
     apt-get update
     # install required packages
    -apt-get -y install --no-install-recommends ansible
    +apt-get -y install --no-install-recommends ansible python-jmespath
     
     # TODO: run ansible on local host
     ansible-playbook yavdr07.yml -b -i 'localhost_inventory' --connection=local --tags="all" --extra-vars "first_run=True"
    @@ -599,12 +600,12 @@ ansible-playbook yavdr07.yml -b -i 'localhost_inventory
     
    -
    -

    4 Playbooks

    +
    +

    4 Playbooks

    -
    -

    4.1 yavdr07.yml

    +
    +

    4.1 yavdr07.yml

    The yavdr07.yml playbook sets up a fully-featured yaVDR installation: @@ -622,9 +623,9 @@ The yavdr07.yml playbook sets up a fully-featured yaVDR installatio - collect-facts # query system facts - autoinstall-ubuntu-drivers # use ubuntu-drivers to install proprietary dirvers # (e.g. nvidia, virtualbox) - - autoinstall-virtualbox-guest # - nvidia-experimental # install very recent nvidia dirver from ppa:graphics-drivers/ppa - vdr # install vdr and related packages + - autoinstall-virtualbox-guest - yavdr-network # enable network client capabilities - samba-install # install samba server - samba-config # configure samba server @@ -656,8 +657,8 @@ The yavdr07.yml playbook sets up a fully-featured yaVDR installatio

    -
    -

    4.2 yavdr07-headless.yml

    +
    +

    4.2 yavdr07-headless.yml

    For a headless server installation yavdr07-headless.yml is a good choice @@ -695,8 +696,8 @@ For a headless server installation yavdr07-headless.yml is a good c

    -
    -

    5 Hosts

    +
    +

    5 Hosts

    This playbook can either be used to run the installation on the localhost or any other PC in the network that can be accessed via ssh. Simply add the host names or IP addresses to the hosts file in the respective section: @@ -710,12 +711,12 @@ This playbook can either be used to run the installation on the localhost or any

    -
    -

    6 Group Variables

    +
    +

    6 Group Variables

    -
    -

    6.1 PPAs

    +
    +

    6.1 PPAs

    ---
    @@ -733,8 +734,8 @@ This playbook can either be used to run the installation on the localhost or any
     
    -
    -

    6.2 VDR user, directories, special configuration and plugins

    +
    +

    6.2 VDR user, directories, special configuration and plugins

    # properties of the user vdr and vdr-related options
    @@ -760,8 +761,8 @@ This playbook can either be used to run the installation on the localhost or any
     
    -
    -

    6.3 Media directories

    +
    +

    6.3 Media directories

    # dictionary of directories for (shared) files. Automatically exported via NFS and Samba if those roles are enabled
    @@ -776,8 +777,8 @@ This playbook can either be used to run the installation on the localhost or any
     
    -
    -

    6.4 NFS

    +
    +

    6.4 NFS

    nfs:
    @@ -786,8 +787,8 @@ This playbook can either be used to run the installation on the localhost or any
     
    -
    -

    6.5 Samba

    +
    +

    6.5 Samba

    samba:
    @@ -797,8 +798,8 @@ This playbook can either be used to run the installation on the localhost or any
     
    -
    -

    6.6 Additional packages

    +
    +

    6.6 Additional packages

    # additional packages you want to install
    @@ -814,8 +815,8 @@ This playbook can either be used to run the installation on the localhost or any
     
    -
    -

    6.7 System pre-configuration

    +
    +

    6.7 System pre-configuration

    frontend: vdr
    @@ -830,20 +831,20 @@ This playbook can either be used to run the installation on the localhost or any
     
    -
    -

    7 Roles

    +
    +

    7 Roles

    -
    -

    7.1 install-dependencies

    +
    +

    7.1 install-dependencies

    -
    -

    7.1.1 tasks

    +
    +

    7.1.1 tasks

      -
    1. main.yml
      +
    2. main.yml
      ---
      @@ -864,19 +865,19 @@ This playbook can either be used to run the installation on the localhost or any
       
      -
      -

      7.2 nvidia experimental drivers

      +
      +

      7.2 nvidia experimental drivers

      install nvidia-396 from ppa:graphics-drivers/ppa

      -
      -

      7.2.1 tasks

      +
      +

      7.2.1 tasks

        -
      1. main.yml
        +
      2. main.yml
        ---
        @@ -906,15 +907,15 @@ install nvidia-396 from ppa:graphics-drivers/ppa
         
      -
      -

      7.3 yavdr-common

      +
      +

      7.3 yavdr-common

      This role is used to set up a basic yaVDR installation. It creates the directories, installs the vdr and other useful packages.

      -
      -

      7.3.1 default variables

      +
      +

      7.3.1 default variables

      This section is for reference only, please use the files in global_vars for customizations. @@ -927,7 +928,7 @@ This section is for reference only, please use the files in global_vars

        -
      1. Repositories
        +
      2. Repositories

        You can set a list of package repositories which provide the necessary packages. Feel free to use own PPAs if you need special customization to the VDR and it’s plugins. @@ -944,7 +945,7 @@ You can set a list of package repositories which provide the necessary packages.

    3. -
    4. Drivers
      +
    5. Drivers

      Automatically installed drivers can be very useful, but if you know you need a certain driver, you can simply set it’s value to true. If you don’t want a driver to be installed, set it’s value to false. @@ -957,7 +958,7 @@ Automatically installed drivers can be very useful, but if you know you need a c

    -
  • Additional Packages
    +
  • Additional Packages

    Add additional packages you would like to have on your installation to this list @@ -971,7 +972,7 @@ Add additional packages you would like to have on your installation to this list

  • -
  • VDR
    +
  • VDR

    This section allows you to set the recording directory, the user and group that runs the vdr and it’s home directory. @@ -1004,15 +1005,15 @@ This section allows you to set the recording directory, the user and group that

  • -
    -

    7.3.2 tasks

    +
    +

    7.3.2 tasks

    yavdr-common executes the following tasks:

      -
    1. main.yml
      +
    2. main.yml
      ---
      @@ -1029,7 +1030,7 @@ yavdr-common executes the following tasks:
       
        -
      1. Disable default installation of recommended packages
        +
      2. Disable default installation of recommended packages

        This task prevents apt to automatically install all recommended dependencies for packages: @@ -1046,7 +1047,7 @@ This task prevents apt to automatically install all recommended dependencies for

    -
  • Set up package repositories
    +
  • Set up package repositories
    - name: add PPAs
    @@ -1066,7 +1067,7 @@ This task prevents apt to automatically install all recommended dependencies for
     
  • -
  • Use bash instead of dash
    +
  • Use bash instead of dash
    - name: use bash instead of dash
    @@ -1078,10 +1079,10 @@ This task prevents apt to automatically install all recommended dependencies for
     
  • -
  • create user vdr
  • -
  • Disable release-upgrade notifications
    +
  • create user vdr
  • +
  • Disable release-upgrade notifications
      -
    1. SOMEDAY move from lineinfile to template
      +
    2. SOMEDAY move from lineinfile to template
      - name: disable release-upgrade notifications
      @@ -1103,7 +1104,7 @@ This task prevents apt to automatically install all recommended dependencies for
       
  • -
  • Install essential packages
    +
  • Install essential packages
    - name: apt | install basic packages
    @@ -1135,7 +1136,7 @@ This task prevents apt to automatically install all recommended dependencies for
     
  • -
  • Install additional packages (user defined)
    +
  • Install additional packages (user defined)
    - name: apt | install extra packages
    @@ -1149,14 +1150,14 @@ This task prevents apt to automatically install all recommended dependencies for
     
  • -
  • create directories
  • -
  • create sudoers drop-in for vdr
  • +
  • create directories
  • +
  • create sudoers drop-in for vdr
  • -
    -

    7.3.3 templates

    +
    +

    7.3.3 templates

    {{ ansible_managed | comment('c') }}
    @@ -1167,7 +1168,7 @@ APT::Install-Suggests "0";
     
      -
    1. yavdr sudoers drop-in
      +
    2. yavdr sudoers drop-in

      Allow the vdr user to restart vdr.service and reboot the system @@ -1182,12 +1183,12 @@ Allow the vdr user to restart vdr.service and reboot the system

    -
    -

    7.4 collect facts about the system with custom modules

    +
    +

    7.4 collect facts about the system with custom modules

    -
    -

    7.4.1 variables

    +
    +

    7.4.1 variables

    first_run: False
    @@ -1195,12 +1196,12 @@ Allow the vdr user to restart vdr.service and reboot the system
     
    -
    -

    7.4.2 tasks

    +
    +

    7.4.2 tasks

      -
    1. main.yml
      +
    2. main.yml
      - name: get information about usb and pci hardware and loaded kernel modules
      @@ -1227,6 +1228,15 @@ Allow the vdr user to restart vdr.service and reboot the system
           - amd_detected
           - virtualbox_detected
       
      +- name: get detailed PCI device information
      +  pci_facts:
      +  tags:
      +    - always
      +
      +- debug:
      +    var: pci_devices
      +    verbosity: 1
      +
       - name: known vdr output plugins
         set_fact:
           vdr_output_plugins:    
      @@ -1240,16 +1250,16 @@ Allow the vdr user to restart vdr.service and reboot the system
       
    -
    -

    7.5 vdr

    +
    +

    7.5 vdr

    -
    -

    7.5.1 tasks

    +
    +

    7.5.1 tasks

      -
    1. install the basic vdr packages
      +
    2. install the basic vdr packages
      ---
      @@ -1268,7 +1278,7 @@ Allow the vdr user to restart vdr.service and reboot the system
       
    3. -
    4. Add svdrp/svdrp-disc to /etc/services
      +
    5. Add svdrp/svdrp-disc to /etc/services
      - name: add svdrp and svdrp-disc to /etc/services
      @@ -1283,7 +1293,7 @@ Allow the vdr user to restart vdr.service and reboot the system
       
    6. -
    7. Set up the recording directory for the vdr user
      +
    8. Set up the recording directory for the vdr user
      - name: create vdr recdir
      @@ -1318,7 +1328,7 @@ Allow the vdr user to restart vdr.service and reboot the system
       
    9. -
    10. Install additional vdr plugins
      +
    11. Install additional vdr plugins

      The additional plugins to install can be set in the variable {{vdr_plugins}} in the group variables @@ -1336,7 +1346,7 @@ The additional plugins to install can be set in the variable {{vdr_plugins

    -
  • copy vdr configuration files (if they don’t exist yet)
    +
  • copy vdr configuration files (if they don’t exist yet)
    - name: ensure vdr is stopped
    @@ -1367,7 +1377,7 @@ The additional plugins to install can be set in the variable {{vdr_plugins
     
  • -
  • start vdr after network-online.target
    +
  • start vdr after network-online.target
    - name: create directory for vdr.service systemd drop-in files
    @@ -1388,8 +1398,8 @@ The additional plugins to install can be set in the variable {{vdr_plugins
     
     
    -
    -

    7.5.2 templates

    +
    +

    7.5.2 templates

    Start after network-online.target @@ -1401,12 +1411,12 @@ Start after network-online.target

    -
    -

    7.5.3 files

    +
    +

    7.5.3 files

      -
    1. remote.conf
      +
    2. remote.conf
      LIRC.Up KEY_UP
      @@ -1541,7 +1551,7 @@ XKeySym.Next       XF86AudioNext
       
    3. -
    4. keymacros.conf
      +
    5. keymacros.conf
      # Remote control key macros for VDR
      @@ -1567,12 +1577,12 @@ User0     @osdteletext
       
    -
    -

    7.6 STARTED yavdr-network

    +
    +

    7.6 STARTED yavdr-network

    -
    -

    7.6.1 default variables

    +
    +

    7.6.1 default variables

    install_avahi: true
    @@ -1580,8 +1590,8 @@ User0     @osdteletext
     
    -
    -

    7.6.2 tasks

    +
    +

    7.6.2 tasks

    ---
    @@ -1651,15 +1661,15 @@ User0     @osdteletext
     
    -
    -

    7.7 nfs-server

    +
    +

    7.7 nfs-server

    -
    -

    7.7.1 TODO avahi-services für NFS beim Stoppen des nfs-kernel-servers depublizieren, beim Start wieder announcen

    +
    +

    7.7.1 TODO avahi-services für NFS beim Stoppen des nfs-kernel-servers depublizieren, beim Start wieder announcen

    -
    -

    7.7.2 tasks

    +
    +

    7.7.2 tasks

    ---
    @@ -1688,12 +1698,12 @@ User0     @osdteletext
     
    -
    -

    7.7.3 templates

    +
    +

    7.7.3 templates

      -
    1. /etc/exports
      +
    2. /etc/exports
      /srv *(rw,fsid=0,sync,no_subtree_check,all_squash,anongid={{ vdr.gid }},anonuid={{ vdr.uid }})
      @@ -1704,7 +1714,7 @@ User0     @osdteletext
       
    3. -
    4. avahi services
      +
    5. avahi services
      <?xml version="1.0" standalone='no'?>
      @@ -1726,12 +1736,12 @@ User0     @osdteletext
       
      -
      -

      7.8 STARTED yavdr-remote

      +
      +

      7.8 STARTED yavdr-remote

      -
      -

      7.8.1 default variables

      +
      +

      7.8.1 default variables

      lircd0_socket: /var/run/lirc/lircd0
      @@ -1739,8 +1749,8 @@ User0     @osdteletext
       
      -
      -

      7.8.2 tasks

      +
      +

      7.8.2 tasks

      ---
      @@ -1813,12 +1823,12 @@ User0     @osdteletext
       
      -
      -

      7.8.3 templates

      +
      +

      7.8.3 templates

        -
      1. Systemd Drop-in to start vdr with lirc support
        +
      2. Systemd Drop-in to start vdr with lirc support
        {% if frontend != 'kodi' %}
        @@ -1829,7 +1839,7 @@ User0     @osdteletext
         
      3. -
      4. Systemd Drop-in to start lircd2uinput with lircd
        +
      5. Systemd Drop-in to start lircd2uinput with lircd
        [Service]
        @@ -1839,7 +1849,7 @@ User0     @osdteletext
         
      6. -
      7. create /etc/rc_maps.cfg
        +
      8. create /etc/rc_maps.cfg
        {{ ansible_managed | comment }}
        @@ -2031,17 +2041,17 @@ ati_remote    rc-medion-x10-digitainer   /lib/udev/rc_keymaps/rc-medion-x10-digi
         
      -
      -

      7.8.4 files

      +
      +

      7.8.4 files

      -
      -

      7.9 pulseaudio

      +
      +

      7.9 pulseaudio

      -
      -

      7.9.1 tasks

      +
      +

      7.9.1 tasks

      ---
      @@ -2064,8 +2074,8 @@ ati_remote    rc-medion-x10-digitainer   /lib/udev/rc_keymaps/rc-medion-x10-digi
       
      -
      -

      7.9.2 templates

      +
      +

      7.9.2 templates

      # Use PulseAudio by default
      @@ -2088,12 +2098,12 @@ ati_remote    rc-medion-x10-digitainer   /lib/udev/rc_keymaps/rc-medion-x10-digi
       
      -
      -

      7.10 yavdr-xorg

      +
      +

      7.10 yavdr-xorg

      -
      -

      7.10.1 About the GUI session

      +
      +

      7.10.1 About the GUI session

      The X-Server is started by using the two systemd units xlogin@.service and x@.service provided by the package xlogin. The former is enabled (and started) for the vdr user - which results (using the default settings for the user vdr with the uid 666) in the activation of xlogin@vdr.service when reaching the graphical.target. To simplify starting and stopping the X-server and the desktop session a yavdr-xorg.service is provided by the package yavdr-xorg, which depends on the two units mentioned before. @@ -2122,8 +2132,8 @@ In order to achive a clean shutdown of the session, x@t7.service is

      -
      -

      7.10.2 default variables

      +
      +

      7.10.2 default variables

      first_run: False
      @@ -2146,12 +2156,12 @@ In order to achive a clean shutdown of the session, x@t7.service is
       
      -
      -

      7.10.3 tasks

      +
      +

      7.10.3 tasks

        -
      1. main.yml
        +
      2. main.yml
        ---
        @@ -2164,7 +2174,7 @@ In order to achive a clean shutdown of the session, x@t7.service is
         
      3. -
      4. setup-xorg.yml
        +
      5. setup-xorg.yml
        ---
        @@ -2285,7 +2295,7 @@ In order to achive a clean shutdown of the session, x@t7.service is
         
      6. -
      7. detect-xorg.yml
        +
      8. detect-xorg.yml
        ---
        @@ -2445,7 +2455,7 @@ In order to achive a clean shutdown of the session, x@t7.service is
         
      9. -
      10. intel.yml
        +
      11. intel.yml

        KMS drivers (like for intel (i915) and amd (radeon)) require additional configuration beneath a customized xorg.conf - for a „static“ output configuration (which works if the TV or AV receiver is not turned on) we need to force loading the display(s) EDID early during the boot process. @@ -2492,12 +2502,12 @@ Please note that rescanning the connected displays works only after removing the

      -
      -

      7.10.4 templates

      +
      +

      7.10.4 templates

        -
      1. grub
        +
      2. grub
        {% set output_flag = 'D' if ("HDMI" in xorg.primary.connector or "DVI" in xorg.primary.connector or "DP" in xorg.primary.connector) else 'e' %} 
        @@ -2507,9 +2517,9 @@ Please note that rescanning the connected displays works only after removing the
         
      3. -
      4. xorg
        +
      5. xorg
          -
        1. x-verbose@.service
          +
        2. x-verbose@.service
          # file: roles/yavdr-xorg/templates/systemd/system/x-verbose@.service.j2
          @@ -2525,7 +2535,7 @@ Please note that rescanning the connected displays works only after removing the
           
        3. -
        4. Drop-in snippet for x@.service
          +
        5. Drop-in snippet for x@.service
          [Unit]
          @@ -2551,7 +2561,7 @@ Please note that rescanning the connected displays works only after removing the
           
        6. -
        7. Drop-in snippet for vdr.service
          +
        8. Drop-in snippet for vdr.service
          {{ ansible_managed | comment }}
          @@ -2563,7 +2573,7 @@ Please note that rescanning the connected displays works only after removing the
           
        9. -
        10. xorg.conf snippets
          +
        11. xorg.conf snippets
          {{ ansible_managed | comment }}
          @@ -2577,7 +2587,7 @@ EndSection
           
        12. -
        13. xorg.conf
          +
        14. xorg.conf
          Section "Device"
          @@ -2903,7 +2913,7 @@ EndSection
           
      6. -
      7. vdr
        +
      8. vdr

        Set environment variables for system locale and user session on startup @@ -2919,12 +2929,12 @@ Set environment variables for system locale and user session on startup

      -
      -

      7.10.5 files

      +
      +

      7.10.5 files

        -
      1. initramfs EDID hook
        +
      2. initramfs EDID hook
        #!/bin/bash
        @@ -2950,16 +2960,16 @@ manual_add_modules i915 radeon
         
        -
        -

        7.11 yavdr-desktop

        +
        +

        7.11 yavdr-desktop

        -
        -

        7.11.1 Tasks

        +
        +

        7.11.1 Tasks

          -
        1. main.yml
          +
        2. main.yml
          ---
          @@ -3108,14 +3118,14 @@ manual_add_modules i915 radeon
           
        -
        -

        7.11.2 Templates

        +
        +

        7.11.2 Templates

          -
        1. xorg configuration
          +
        2. xorg configuration
            -
          1. .Xresources
            +
          2. .Xresources
            xterm*background: Black
            @@ -3138,7 +3148,7 @@ XTerm.vt100.font: 7x13
             
          3. -
          4. .xinitrc
            +
          5. .xinitrc
            #!/bin/bash
            @@ -3150,9 +3160,9 @@ XTerm.vt100.font: 7x13
             
        3. -
        4. openbox
          +
        5. openbox
            -
          1. autostart
            +
          2. autostart
            # forward environment variables to an environment file and the systemd user session
            @@ -3188,7 +3198,7 @@ systemctl --user isolate yavdr-desktop.target
             
          3. -
          4. rc.xml
            +
          5. rc.xml
            <?xml version="1.0" encoding="UTF-8"?>
            @@ -4008,7 +4018,7 @@ systemctl --user isolate yavdr-desktop.target
             
          6. -
          7. rc2.xml
            +
          8. rc2.xml
            <?xml version="1.0" encoding="UTF-8"?>
            @@ -4831,9 +4841,9 @@ systemctl --user isolate yavdr-desktop.target
             
        6. -
        7. Systemd User Session
          +
        8. Systemd User Session
            -
          1. yavdr-desktop.target
            +
          2. yavdr-desktop.target
            [Unit]
            @@ -4846,7 +4856,7 @@ systemctl --user isolate yavdr-desktop.target
             
          3. -
          4. detect-second-display
            +
          5. detect-second-display
            [Unit]
            @@ -4862,7 +4872,7 @@ systemctl --user isolate yavdr-desktop.target
             
          6. -
          7. openbox-second.service
            +
          8. openbox-second.service
            [Unit]
            @@ -4884,7 +4894,7 @@ systemctl --user isolate yavdr-desktop.target
             
          9. -
          10. osd2web.service
            +
          11. osd2web.service
            [Unit]
            @@ -4907,7 +4917,7 @@ systemctl --user isolate yavdr-desktop.target
             
          12. -
          13. tmux.service
            +
          14. tmux.service
            [Unit]
            @@ -4926,7 +4936,7 @@ systemctl --user isolate yavdr-desktop.target
             
          15. -
          16. wm-exit.service
            +
          17. wm-exit.service
            [Unit]
            @@ -4945,7 +4955,7 @@ systemctl --user isolate yavdr-desktop.target
             
        9. -
        10. irexec
          +
        11. irexec

          irexec.service starts irexec for the user session @@ -4979,12 +4989,12 @@ end

        -
        -

        7.12 samba-install

        +
        +

        7.12 samba-install

        -
        -

        7.12.1 tasks

        +
        +

        7.12.1 tasks

        ---
        @@ -5006,12 +5016,12 @@ end
         
        -
        -

        7.13 samba-config

        +
        +

        7.13 samba-config

        -
        -

        7.13.1 tasks

        +
        +

        7.13.1 tasks

        ---
        @@ -5036,14 +5046,14 @@ end
         
        -
        -

        7.13.2 templates

        +
        +

        7.13.2 templates

          -
        1. smb.conf
          +
        2. smb.conf
            -
          1. global settings
            +
          2. global settings
            {{ ansible_managed | comment }}
            @@ -5129,7 +5139,7 @@ end
             
          3. -
          4. media directories
            +
          5. media directories
            {% for name, path in media_dirs.iteritems() %}
            @@ -5151,7 +5161,7 @@ end
             
          6. -
          7. include custom samba exports
            +
          8. include custom samba exports
            include = /etc/samba/smb.conf.custom
            @@ -5164,15 +5174,15 @@ end
             
        -
        -

        7.14 STARTED autoinstall-drivers

        +
        +

        7.14 STARTED autoinstall-drivers

        It would be nice to be able to detect if it is suitable to install those drivers:

        -
        -

        7.14.1 TODO sundtek for Sundtek devices (local or network connection)

        +
        +

        7.14.1 TODO sundtek for Sundtek devices (local or network connection)

        Vendor-IDs: @@ -5183,7 +5193,7 @@ Vendor-IDs:

          -
        1. planned packages
          +
        2. planned packages
          • yavdr-hardware-sundtek
          • @@ -5194,8 +5204,8 @@ Vendor-IDs:
        -
        -

        7.14.2 TODO drivers for TT S2-6400 FF

        +
        +

        7.14.2 TODO drivers for TT S2-6400 FF

        https://github.com/s-moch/linux-saa716x - kann man den relevanten Teil als dkms-Paket bauen? @@ -5203,15 +5213,15 @@ Vendor-IDs:

        -
        -

        7.15 autoinstall-ubuntu-drivers

        +
        +

        7.15 autoinstall-ubuntu-drivers

        The tool ubuntu-drivers is used to install the matching driver version for nvidia graphics cards, virtualbox guest additions and Intel and AMD microcode updates.

        -
        -

        7.15.1 tasks

        +
        +

        7.15.1 tasks

        ---
        @@ -5234,8 +5244,8 @@ The tool ubuntu-drivers is used to install the matching driver version for nvidi
         
        -
        -

        7.16 autoinstall-virtualbox-guest

        +
        +

        7.16 autoinstall-virtualbox-guest

        This role installs the guest additions for virtualbox guests on Ubuntu 16.04 @@ -5280,18 +5290,18 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04 - vdrctl enable xineliboutput ignore_errors: yes when: - - ansible_virtualization_type == "virtualbox" + - ansible_virtualization_type == "virtualbox" or ansible_virtualization_type == "VMware" - ansible_virtualization_role == "guest"

        -
        -

        7.17 autoinstall-atric-usb

        +
        +

        7.17 autoinstall-atric-usb

        -
        -

        7.17.1 dependencies

        +
        +

        7.17.1 dependencies

        ---
        @@ -5303,8 +5313,8 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04
         
        -
        -

        7.17.2 tasks

        +
        +

        7.17.2 tasks

        ---
        @@ -5346,8 +5356,8 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04
         
        -
        -

        7.17.3 templates

        +
        +

        7.17.3 templates

        {{ ansible_managed | comment }}
        @@ -5376,12 +5386,12 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04
         
        -
        -

        7.18 autoinstall-yausbir

        +
        +

        7.18 autoinstall-yausbir

        -
        -

        7.18.1 dependencies

        +
        +

        7.18.1 dependencies

        ---
        @@ -5392,8 +5402,8 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04
         
        -
        -

        7.18.2 tasks

        +
        +

        7.18.2 tasks

        ---
        @@ -5435,8 +5445,8 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04
         
        -
        -

        7.18.3 templates

        +
        +

        7.18.3 templates

        {{ ansible_managed | comment }}
        @@ -5464,15 +5474,15 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04
         
        -
        -

        7.19 autoinstall-satip

        +
        +

        7.19 autoinstall-satip

        If a Sat>IP Server responds to a discovery request, the package vdr-plugin-satip is installed.

        -
        -

        7.19.1 tasks

        +
        +

        7.19.1 tasks

        ---
        @@ -5497,12 +5507,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.20 autoinstall-targavfd

        +
        +

        7.20 autoinstall-targavfd

        -
        -

        7.20.1 tasks

        +
        +

        7.20.1 tasks

        ---
        @@ -5518,12 +5528,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.21 autoinstall-imonlcd

        +
        +

        7.21 autoinstall-imonlcd

        -
        -

        7.21.1 tasks

        +
        +

        7.21.1 tasks

        ---
        @@ -5539,12 +5549,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.22 autoinstall-libcecdaemon

        +
        +

        7.22 autoinstall-libcecdaemon

        -
        -

        7.22.1 tasks

        +
        +

        7.22.1 tasks

        ---
        @@ -5560,12 +5570,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.23 autoinstall-pvr350

        +
        +

        7.23 autoinstall-pvr350

        -
        -

        7.23.1 tasks

        +
        +

        7.23.1 tasks

        ---
        @@ -5581,8 +5591,8 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.24 autoinstall-hauppauge-pvr

        +
        +

        7.24 autoinstall-hauppauge-pvr

        ---
        @@ -5597,12 +5607,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.25 autoinstall-firmware

        +
        +

        7.25 autoinstall-firmware

        -
        -

        7.25.1 dependencies

        +
        +

        7.25.1 dependencies

        ---
        @@ -5613,8 +5623,8 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.25.2 tasks

        +
        +

        7.25.2 tasks

        ---
        @@ -5655,12 +5665,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.26 autoinstall-dvbsky-firmware

        +
        +

        7.26 autoinstall-dvbsky-firmware

        -
        -

        7.26.1 dependencies

        +
        +

        7.26.1 dependencies

        ---
        @@ -5671,8 +5681,8 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.26.2 defaults

        +
        +

        7.26.2 defaults

        ---
        @@ -5682,8 +5692,8 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.26.3 tasks

        +
        +

        7.26.3 tasks

        ---
        @@ -5733,15 +5743,15 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.27 TODO autoinstall-dvbhddevice

        +
        +

        7.27 TODO autoinstall-dvbhddevice

        Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware sollte in yavdr-firmware stecken

        -
        -

        7.27.1 dependencies

        +
        +

        7.27.1 dependencies

        ---
        @@ -5752,8 +5762,8 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
         
        -
        -

        7.27.2 tasks

        +
        +

        7.27.2 tasks

        ---
        @@ -5770,12 +5780,12 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
         
        -
        -

        7.28 autoinstall-dvbsddevice

        +
        +

        7.28 autoinstall-dvbsddevice

        -
        -

        7.28.1 dependencies

        +
        +

        7.28.1 dependencies

        ---
        @@ -5786,8 +5796,8 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
         
        -
        -

        7.28.2 tasks

        +
        +

        7.28.2 tasks

        ---
        @@ -5805,12 +5815,12 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
         
        -
        -

        7.29 autoinstall-hardware-irmp

        +
        +

        7.29 autoinstall-hardware-irmp

        -
        -

        7.29.1 dependencies

        +
        +

        7.29.1 dependencies

        ---
        @@ -5821,8 +5831,8 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
         
        -
        -

        7.29.2 tasks

        +
        +

        7.29.2 tasks

        ---
        @@ -5838,19 +5848,19 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
         
        -
        -

        7.30 kodi

        +
        +

        7.30 kodi

        -
        -

        7.30.1 tasks

        +
        +

        7.30.1 tasks

          -
        1. Install KODI
          +
        2. Install KODI
            -
          • main.yml
            -
            +
          • main.yml
            +
            - import_tasks: install-kodi.yml tags=install,update,kodi:install
             - import_tasks: configure-kodi.yml tags=install,update,kodi:configure
            @@ -5858,7 +5868,7 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
             
          • -
          • install-kodi.yml
            +
          • install-kodi.yml
            ---
            @@ -5871,12 +5881,26 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
               with_items:
                 - kodi
                 - kodi-pvr-vdr-vnsi
            -    - kodi-eventclients-kodi-send # for ubuntu packages, team-xbmc uses "kodi-eventclients-xbmc-send for some reason
            +
            +- name: apt | install kodi-send (team-xbmc PPA)
            +  apt:
            +    name: "kodi-eventclients-xbmc-send" # team-xbmc uses "kodi-eventclients-xbmc-send for some reason
            +    state: present
            +    install_recommends: no
            +  register: team_xbmc_ppa
            +  ignore_errors: True
            +
            +- name: apt | install kodi-send (Ubuntu package)
            +  apt:
            +    name: "kodi-eventclients-kodi-send" # fallback to ubuntu package
            +    state: present
            +    install_recommends: no
            +  when: team_xbmc_ppa.failed
             
          • -
          • configure-kodi.yml
            +
          • configure-kodi.yml
            - name: create kodi.service for the user session
            @@ -5925,12 +5949,12 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
             
        -
        -

        7.30.2 templates

        +
        +

        7.30.2 templates

          -
        1. kodi.service
          +
        2. kodi.service

          This systemd unit for the user session starts (and stops) kodi. @@ -5946,7 +5970,7 @@ This systemd unit for the user session starts (and stops) kodi. ExecStart=/usr/bin/kodi -l /run/lirc/lircd ExecStop=/bin/bash -c "/usr/bin/kodi-send --action=QUIT; while ps -p $MAINPID -o comm=; do sleep .25; done" TimeoutStopSec=10 -SuccessExitStatus=0 127 +SuccessExitStatus=0 127 SIGKILL Restart=on-failure

          @@ -5955,15 +5979,15 @@ This systemd unit for the user session starts (and stops) kodi.
        -
        -

        7.30.3 files

        +
        +

        7.30.3 files

        Those configuration files provide a preconfiguration for kodi which overrides the system wide configuration

          -
        1. Lircmap.xml
          +
        2. Lircmap.xml

          This file allows to map keys sent by remotes via eventlircd (which uses the name devinput) to kodi key names. @@ -6034,14 +6058,14 @@ This file allows to map keys sent by remotes via eventlircd (which uses the name

      3. -
      4. keymaps
        +
      5. keymaps

        This file maps the keys defined in Lircmap.xml to actions within kodi.

          -
        1. remote.xml
          +
        2. remote.xml
          <?xml version="1.0" encoding="UTF-8"?>
          @@ -6593,17 +6617,17 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
           
      -
      -

      7.31 dvd

      +
      +

      7.31 dvd

      -
      -

      7.31.1 tasks

      +
      +

      7.31.1 tasks

        -
      • install libdvd-pkg, allow programs to eject optical media
        -
        +
      • install libdvd-pkg, allow programs to eject optical media
        +
        ---
         # file: roles/dvd/tasks/main.yml
        @@ -6636,6 +6660,7 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
           shell: sed 's/--lock-media //' /lib/udev/rules.d/60-cdrom_id.rules > /etc/udev/rules.d/60-cdrom_id.rules
           args:
             creates: /etc/udev/rules.d/60-cdrom_id.rules
        +    warn: false
         
        @@ -6643,15 +6668,15 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
      -
      -

      7.32 install-sundtek

      +
      +

      7.32 install-sundtek

      -
      -

      7.32.1 variables

      +
      +

      7.32.1 variables

      -
      -

      7.32.2 tasks

      +
      +

      7.32.2 tasks

      ---
      @@ -6700,8 +6725,8 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
       
      -
      -

      7.32.3 templates

      +
      +

      7.32.3 templates

      # ----- GLOBAL SECTION -----
      @@ -6807,8 +6832,8 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
       
      -
      -

      7.33 template-test

      +
      +

      7.33 template-test

      ---
      @@ -7049,12 +7074,12 @@ EndSection
       
      -
      -

      7.34 wakeup

      +
      +

      7.34 wakeup

      -
      -

      7.34.1 defaults

      +
      +

      7.34.1 defaults

      ---
      @@ -7064,8 +7089,8 @@ EndSection
       
      -
      -

      7.34.2 tasks

      +
      +

      7.34.2 tasks

      ---
      @@ -7086,8 +7111,8 @@ EndSection
       
      -
      -

      7.34.3 templates

      +
      +

      7.34.3 templates

      {{ ansible_managed | comment }}
      @@ -7113,12 +7138,12 @@ ACPI_START_AHEAD=5
       
      -
      -

      7.35 grub-config

      +
      +

      7.35 grub-config

      -
      -

      7.35.1 default variables

      +
      +

      7.35.1 default variables

      system:
      @@ -7130,8 +7155,8 @@ ACPI_START_AHEAD=5
       
      -
      -

      7.35.2 tasks

      +
      +

      7.35.2 tasks

      ---
      @@ -7156,8 +7181,8 @@ ACPI_START_AHEAD=5
       
      -
      -

      7.35.3 templates

      +
      +

      7.35.3 templates

      #!/bin/sh
      @@ -7180,8 +7205,8 @@ menuentry "PowerOff" 
      -

      7.35.4 handlers

      +
      +

      7.35.4 handlers

      ---
      @@ -7204,15 +7229,15 @@ menuentry "PowerOff" 
      -

      8 Modules

      +
      +

      8 Modules

      This section contains custom modules for the yaVDR Playbooks. They are used to collect facts about the system and configure applications and daemons.

      -
      -

      8.1 hardware_facts.py

      +
      +

      8.1 hardware_facts.py

      # This Module collects the vendor- and device ids for USB- and PCI(e)-devices and currently loaded kernel modules.
      @@ -7390,10 +7415,87 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
       
      -
      -

      8.2 satip_facts.py

      +
      +

      8.2 pci_facts.py

      +
      +# This module parses the output of lspci for detailed information about available (sub) devices.
      +DOCUMENTATION = '''
      +  ---
      +  module: pci_facts
      +  short_description: parses lspci output for detailed (sub) devices data
      +  description:
      +      - This module parses the output of lspci for detailed information about available (sub) devices.
      +      - returns a list with a dict for each device
      +
      +notes:
      +    - requires lspci (package pciutils)
      +
      +'''
      +
      +EXAMPLES = '''
      +- name: get detailled pci device infos
      +  pci_facts:
      +
      +- debug:
      +    var: pci_devices
      +'''
      +
      +
      +import argparse
      +import shlex
      +import subprocess
      +from collections import namedtuple
      +
      +from ansible.module_utils.basic import *
      +
      +def convert2hex(arg):
      +    arg = arg.strip('"')
      +    if arg:
      +        return int(arg, 16)
      +    else:
      +        return None
      +
      +def parse_lspci_data():
      +    parser = argparse.ArgumentParser()
      +    parser.add_argument('-r', '--revision', help='revision', type=convert2hex)
      +    parser.add_argument('-p', '--progif', help='proginf', type=convert2hex)
      +    parser.add_argument('slot')
      +    parser.add_argument('device_class', type=convert2hex)
      +    parser.add_argument('vendor_id', type=convert2hex)
      +    parser.add_argument('device_id', type=convert2hex)
      +    parser.add_argument('sub_vendor_id', type=convert2hex)
      +    parser.add_argument('sub_device_id', type=convert2hex)
      +    parser.add_argument('other', nargs='*', default=[])
      +
      +    devices = []
      +    for line in subprocess.check_output(['lspci', '-nm'], universal_newlines=True).splitlines():
      +        args = parser.parse_args(args=shlex.split(line))
      +        devices.append(vars(args))
      +    return devices
      +
      +
      +def main():
      +    arg_specs = {}
      +    module = AnsibleModule(argument_spec=arg_specs, supports_check_mode=True,)
      +    try:
      +        pci_devices = parse_lspci_data()
      +    except:
      +        module.fail_json(msg="Something fatal happened")
      +    data = {'pci_devices': pci_devices}
      +    module.exit_json(changed=False, ansible_facts=data, msg=data)
      +
      +if __name__ == '__main__':
      +    main()
      +
      +
      +
      +
      +
      +

      8.3 satip_facts.py

      +
      +
      DOCUMENTATION = '''
       ---
       module: hardware_facts
      @@ -7515,9 +7617,9 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
       
      -
      -

      8.3 xrandr_facts.py

      -
      +
      +

      8.4 xrandr_facts.py

      +
      • [ ] support multiple screens (-d :0.0 .. :0.n)
      @@ -7803,8 +7905,8 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
      -
      -

      9 Handlers

      +
      +

      9 Handlers

      - name: Reconfigure unattended upgrades with dpkg
      @@ -7897,7 +7999,7 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
       

      Autor: Alexander Grothe <seahawk1986@gmx.de>

      -

      Created: 2018-08-10 Fr 08:10

      +

      Created: 2018-09-04 Di 13:22

      Validate

      From f6f5dc59ca8d334c3fd2f094681ae2f95ed1d52f Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Wed, 5 Sep 2018 12:23:30 +0200 Subject: [PATCH 20/20] Add PPA for Ansible 2.6 so ansible_virtualization_type and ansible_virtualization_role are always defined. This ist important on older Hardware (e.g. AMD64 3000+). --- Manual.html | 949 ++++++++++++++++++++++++----------------------- Manual.org | 9 +- install-yavdr.sh | 7 +- 3 files changed, 487 insertions(+), 478 deletions(-) diff --git a/Manual.html b/Manual.html index cc976a5..15a1432 100644 --- a/Manual.html +++ b/Manual.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Ansible Playbooks for yaVDR 0.7 @@ -240,262 +240,262 @@ for the JavaScript code in this tag.

      Inhaltsverzeichnis

      -
      -

      1 User Stories

      +
      +

      1 User Stories

      -
      -

      1.1 yavdr-full

      +
      +

      1.1 yavdr-full

      A User wants to install yaVDR without customization and relies on full automation. @@ -528,22 +528,22 @@ Several roles are used to tie everything together:

      -
      -

      1.1.1 Using vdr, pulseaudio and xorg together

      +
      +

      1.1.1 Using vdr, pulseaudio and xorg together

      -
      -

      2 Introduction

      +
      +

      2 Introduction

      One of the major problems we faced with customized Ubuntu ISO files as installation media for prior yaVDR versions has been the limited hardware support and the time consuming process to create and update them. An interesting alternative to this approach is to enable the user to choose the installation medium by himself, so point releases, kernel versions and additional drivers can be chosen deliberately. After the basic setup is complete (and a working internet connection is available), a fully customizable install script completes the yaVDR installation.

      -
      -

      3 Installing and configuring yaVDR with Ansible

      +
      +

      3 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 Ansible. @@ -578,18 +578,21 @@ We use a callback to generate tags for all roles autmatically:

      -
      -

      3.1 Install script for local usage

      +
      +

      3.1 Install script for local usage

      -
      if (( $EUID != 0 )); then
      +
      set -e
      +if (( $EUID != 0 )); then
           echo "This script must be run using sudo -H or as root"
           exit
       fi
       
      -apt-get -y install software-properties-common
       # update packages
      -apt-get update
      +apt update
      +apt -y install software-properties-common
      +add-apt-repository -y ppa:ansible/ansible-2.6
      +
       # install required packages
       apt-get -y install --no-install-recommends ansible python-jmespath
       
      @@ -600,12 +603,12 @@ ansible-playbook yavdr07.yml -b -i 'localhost_inventory
       
      -
      -

      4 Playbooks

      +
      +

      4 Playbooks

      -
      -

      4.1 yavdr07.yml

      +
      +

      4.1 yavdr07.yml

      The yavdr07.yml playbook sets up a fully-featured yaVDR installation: @@ -657,8 +660,8 @@ The yavdr07.yml playbook sets up a fully-featured yaVDR installatio

      -
      -

      4.2 yavdr07-headless.yml

      +
      +

      4.2 yavdr07-headless.yml

      For a headless server installation yavdr07-headless.yml is a good choice @@ -696,8 +699,8 @@ For a headless server installation yavdr07-headless.yml is a good c

      -
      -

      5 Hosts

      +
      +

      5 Hosts

      This playbook can either be used to run the installation on the localhost or any other PC in the network that can be accessed via ssh. Simply add the host names or IP addresses to the hosts file in the respective section: @@ -711,12 +714,12 @@ This playbook can either be used to run the installation on the localhost or any

      -
      -

      6 Group Variables

      +
      +

      6 Group Variables

      -
      -

      6.1 PPAs

      +
      +

      6.1 PPAs

      ---
      @@ -734,8 +737,8 @@ This playbook can either be used to run the installation on the localhost or any
       
      -
      -

      6.2 VDR user, directories, special configuration and plugins

      +
      +

      6.2 VDR user, directories, special configuration and plugins

      # properties of the user vdr and vdr-related options
      @@ -761,8 +764,8 @@ This playbook can either be used to run the installation on the localhost or any
       
      -
      -

      6.3 Media directories

      +
      +

      6.3 Media directories

      # dictionary of directories for (shared) files. Automatically exported via NFS and Samba if those roles are enabled
      @@ -777,8 +780,8 @@ This playbook can either be used to run the installation on the localhost or any
       
      -
      -

      6.4 NFS

      +
      +

      6.4 NFS

      nfs:
      @@ -787,8 +790,8 @@ This playbook can either be used to run the installation on the localhost or any
       
      -
      -

      6.5 Samba

      +
      +

      6.5 Samba

      samba:
      @@ -798,8 +801,8 @@ This playbook can either be used to run the installation on the localhost or any
       
      -
      -

      6.6 Additional packages

      +
      +

      6.6 Additional packages

      # additional packages you want to install
      @@ -815,8 +818,8 @@ This playbook can either be used to run the installation on the localhost or any
       
      -
      -

      6.7 System pre-configuration

      +
      +

      6.7 System pre-configuration

      frontend: vdr
      @@ -831,20 +834,20 @@ This playbook can either be used to run the installation on the localhost or any
       
      -
      -

      7 Roles

      +
      +

      7 Roles

      -
      -

      7.1 install-dependencies

      +
      +

      7.1 install-dependencies

      -
      -

      7.1.1 tasks

      +
      +

      7.1.1 tasks

        -
      1. main.yml
        +
      2. main.yml
        ---
        @@ -865,19 +868,19 @@ This playbook can either be used to run the installation on the localhost or any
         
        -
        -

        7.2 nvidia experimental drivers

        +
        +

        7.2 nvidia experimental drivers

        install nvidia-396 from ppa:graphics-drivers/ppa

        -
        -

        7.2.1 tasks

        +
        +

        7.2.1 tasks

          -
        1. main.yml
          +
        2. main.yml
          ---
          @@ -907,15 +910,15 @@ install nvidia-396 from ppa:graphics-drivers/ppa
           
        -
        -

        7.3 yavdr-common

        +
        +

        7.3 yavdr-common

        This role is used to set up a basic yaVDR installation. It creates the directories, installs the vdr and other useful packages.

        -
        -

        7.3.1 default variables

        +
        +

        7.3.1 default variables

        This section is for reference only, please use the files in global_vars for customizations. @@ -928,7 +931,7 @@ This section is for reference only, please use the files in global_vars

          -
        1. Repositories
          +
        2. Repositories

          You can set a list of package repositories which provide the necessary packages. Feel free to use own PPAs if you need special customization to the VDR and it’s plugins. @@ -945,7 +948,7 @@ You can set a list of package repositories which provide the necessary packages.

      3. -
      4. Drivers
        +
      5. Drivers

        Automatically installed drivers can be very useful, but if you know you need a certain driver, you can simply set it’s value to true. If you don’t want a driver to be installed, set it’s value to false. @@ -958,7 +961,7 @@ Automatically installed drivers can be very useful, but if you know you need a c

    6. -
    7. Additional Packages
      +
    8. Additional Packages

      Add additional packages you would like to have on your installation to this list @@ -972,7 +975,7 @@ Add additional packages you would like to have on your installation to this list

  • -
  • VDR
    +
  • VDR

    This section allows you to set the recording directory, the user and group that runs the vdr and it’s home directory. @@ -1005,15 +1008,15 @@ This section allows you to set the recording directory, the user and group that

  • -
    -

    7.3.2 tasks

    +
    +

    7.3.2 tasks

    yavdr-common executes the following tasks:

      -
    1. main.yml
      +
    2. main.yml
      ---
      @@ -1030,7 +1033,7 @@ yavdr-common executes the following tasks:
       
        -
      1. Disable default installation of recommended packages
        +
      2. Disable default installation of recommended packages

        This task prevents apt to automatically install all recommended dependencies for packages: @@ -1047,7 +1050,7 @@ This task prevents apt to automatically install all recommended dependencies for

    -
  • Set up package repositories
    +
  • Set up package repositories
    - name: add PPAs
    @@ -1067,7 +1070,7 @@ This task prevents apt to automatically install all recommended dependencies for
     
  • -
  • Use bash instead of dash
    +
  • Use bash instead of dash
    - name: use bash instead of dash
    @@ -1079,10 +1082,10 @@ This task prevents apt to automatically install all recommended dependencies for
     
  • -
  • create user vdr
  • -
  • Disable release-upgrade notifications
    +
  • create user vdr
  • +
  • Disable release-upgrade notifications
      -
    1. SOMEDAY move from lineinfile to template
      +
    2. SOMEDAY move from lineinfile to template
      - name: disable release-upgrade notifications
      @@ -1104,7 +1107,7 @@ This task prevents apt to automatically install all recommended dependencies for
       
  • -
  • Install essential packages
    +
  • Install essential packages
    - name: apt | install basic packages
    @@ -1136,7 +1139,7 @@ This task prevents apt to automatically install all recommended dependencies for
     
  • -
  • Install additional packages (user defined)
    +
  • Install additional packages (user defined)
    - name: apt | install extra packages
    @@ -1150,14 +1153,14 @@ This task prevents apt to automatically install all recommended dependencies for
     
  • -
  • create directories
  • -
  • create sudoers drop-in for vdr
  • +
  • create directories
  • +
  • create sudoers drop-in for vdr
  • -
    -

    7.3.3 templates

    +
    +

    7.3.3 templates

    {{ ansible_managed | comment('c') }}
    @@ -1168,7 +1171,7 @@ APT::Install-Suggests "0";
     
      -
    1. yavdr sudoers drop-in
      +
    2. yavdr sudoers drop-in

      Allow the vdr user to restart vdr.service and reboot the system @@ -1183,12 +1186,12 @@ Allow the vdr user to restart vdr.service and reboot the system

    -
    -

    7.4 collect facts about the system with custom modules

    +
    +

    7.4 collect facts about the system with custom modules

    -
    -

    7.4.1 variables

    +
    +

    7.4.1 variables

    first_run: False
    @@ -1196,12 +1199,12 @@ Allow the vdr user to restart vdr.service and reboot the system
     
    -
    -

    7.4.2 tasks

    +
    +

    7.4.2 tasks

      -
    1. main.yml
      +
    2. main.yml
      - name: get information about usb and pci hardware and loaded kernel modules
      @@ -1250,16 +1253,16 @@ Allow the vdr user to restart vdr.service and reboot the system
       
    -
    -

    7.5 vdr

    +
    +

    7.5 vdr

    -
    -

    7.5.1 tasks

    +
    +

    7.5.1 tasks

      -
    1. install the basic vdr packages
      +
    2. install the basic vdr packages
      ---
      @@ -1278,7 +1281,7 @@ Allow the vdr user to restart vdr.service and reboot the system
       
    3. -
    4. Add svdrp/svdrp-disc to /etc/services
      +
    5. Add svdrp/svdrp-disc to /etc/services
      - name: add svdrp and svdrp-disc to /etc/services
      @@ -1293,7 +1296,7 @@ Allow the vdr user to restart vdr.service and reboot the system
       
    6. -
    7. Set up the recording directory for the vdr user
      +
    8. Set up the recording directory for the vdr user
      - name: create vdr recdir
      @@ -1328,7 +1331,7 @@ Allow the vdr user to restart vdr.service and reboot the system
       
    9. -
    10. Install additional vdr plugins
      +
    11. Install additional vdr plugins

      The additional plugins to install can be set in the variable {{vdr_plugins}} in the group variables @@ -1346,7 +1349,7 @@ The additional plugins to install can be set in the variable {{vdr_plugins

    -
  • copy vdr configuration files (if they don’t exist yet)
    +
  • copy vdr configuration files (if they don’t exist yet)
    - name: ensure vdr is stopped
    @@ -1377,7 +1380,7 @@ The additional plugins to install can be set in the variable {{vdr_plugins
     
  • -
  • start vdr after network-online.target
    +
  • start vdr after network-online.target
    - name: create directory for vdr.service systemd drop-in files
    @@ -1398,8 +1401,8 @@ The additional plugins to install can be set in the variable {{vdr_plugins
     
     
    -
    -

    7.5.2 templates

    +
    +

    7.5.2 templates

    Start after network-online.target @@ -1411,12 +1414,12 @@ Start after network-online.target

    -
    -

    7.5.3 files

    +
    +

    7.5.3 files

      -
    1. remote.conf
      +
    2. remote.conf
      LIRC.Up KEY_UP
      @@ -1551,7 +1554,7 @@ XKeySym.Next       XF86AudioNext
       
    3. -
    4. keymacros.conf
      +
    5. keymacros.conf
      # Remote control key macros for VDR
      @@ -1577,12 +1580,12 @@ User0     @osdteletext
       
    -
    -

    7.6 STARTED yavdr-network

    +
    +

    7.6 STARTED yavdr-network

    -
    -

    7.6.1 default variables

    +
    +

    7.6.1 default variables

    install_avahi: true
    @@ -1590,8 +1593,8 @@ User0     @osdteletext
     
    -
    -

    7.6.2 tasks

    +
    +

    7.6.2 tasks

    ---
    @@ -1661,15 +1664,15 @@ User0     @osdteletext
     
    -
    -

    7.7 nfs-server

    +
    +

    7.7 nfs-server

    -
    -

    7.7.1 TODO avahi-services für NFS beim Stoppen des nfs-kernel-servers depublizieren, beim Start wieder announcen

    +
    +

    7.7.1 TODO avahi-services für NFS beim Stoppen des nfs-kernel-servers depublizieren, beim Start wieder announcen

    -
    -

    7.7.2 tasks

    +
    +

    7.7.2 tasks

    ---
    @@ -1698,12 +1701,12 @@ User0     @osdteletext
     
    -
    -

    7.7.3 templates

    +
    +

    7.7.3 templates

      -
    1. /etc/exports
      +
    2. /etc/exports
      /srv *(rw,fsid=0,sync,no_subtree_check,all_squash,anongid={{ vdr.gid }},anonuid={{ vdr.uid }})
      @@ -1714,7 +1717,7 @@ User0     @osdteletext
       
    3. -
    4. avahi services
      +
    5. avahi services
      <?xml version="1.0" standalone='no'?>
      @@ -1736,12 +1739,12 @@ User0     @osdteletext
       
      -
      -

      7.8 STARTED yavdr-remote

      +
      +

      7.8 STARTED yavdr-remote

      -
      -

      7.8.1 default variables

      +
      +

      7.8.1 default variables

      lircd0_socket: /var/run/lirc/lircd0
      @@ -1749,8 +1752,8 @@ User0     @osdteletext
       
      -
      -

      7.8.2 tasks

      +
      +

      7.8.2 tasks

      ---
      @@ -1823,12 +1826,12 @@ User0     @osdteletext
       
      -
      -

      7.8.3 templates

      +
      +

      7.8.3 templates

        -
      1. Systemd Drop-in to start vdr with lirc support
        +
      2. Systemd Drop-in to start vdr with lirc support
        {% if frontend != 'kodi' %}
        @@ -1839,7 +1842,7 @@ User0     @osdteletext
         
      3. -
      4. Systemd Drop-in to start lircd2uinput with lircd
        +
      5. Systemd Drop-in to start lircd2uinput with lircd
        [Service]
        @@ -1849,7 +1852,7 @@ User0     @osdteletext
         
      6. -
      7. create /etc/rc_maps.cfg
        +
      8. create /etc/rc_maps.cfg
        {{ ansible_managed | comment }}
        @@ -2041,17 +2044,17 @@ ati_remote    rc-medion-x10-digitainer   /lib/udev/rc_keymaps/rc-medion-x10-digi
         
      -
      -

      7.8.4 files

      +
      +

      7.8.4 files

      -
      -

      7.9 pulseaudio

      +
      +

      7.9 pulseaudio

      -
      -

      7.9.1 tasks

      +
      +

      7.9.1 tasks

      ---
      @@ -2074,8 +2077,8 @@ ati_remote    rc-medion-x10-digitainer   /lib/udev/rc_keymaps/rc-medion-x10-digi
       
      -
      -

      7.9.2 templates

      +
      +

      7.9.2 templates

      # Use PulseAudio by default
      @@ -2098,12 +2101,12 @@ ati_remote    rc-medion-x10-digitainer   /lib/udev/rc_keymaps/rc-medion-x10-digi
       
      -
      -

      7.10 yavdr-xorg

      +
      +

      7.10 yavdr-xorg

      -
      -

      7.10.1 About the GUI session

      +
      +

      7.10.1 About the GUI session

      The X-Server is started by using the two systemd units xlogin@.service and x@.service provided by the package xlogin. The former is enabled (and started) for the vdr user - which results (using the default settings for the user vdr with the uid 666) in the activation of xlogin@vdr.service when reaching the graphical.target. To simplify starting and stopping the X-server and the desktop session a yavdr-xorg.service is provided by the package yavdr-xorg, which depends on the two units mentioned before. @@ -2132,8 +2135,8 @@ In order to achive a clean shutdown of the session, x@t7.service is

      -
      -

      7.10.2 default variables

      +
      +

      7.10.2 default variables

      first_run: False
      @@ -2156,12 +2159,12 @@ In order to achive a clean shutdown of the session, x@t7.service is
       
      -
      -

      7.10.3 tasks

      +
      +

      7.10.3 tasks

        -
      1. main.yml
        +
      2. main.yml
        ---
        @@ -2174,7 +2177,7 @@ In order to achive a clean shutdown of the session, x@t7.service is
         
      3. -
      4. setup-xorg.yml
        +
      5. setup-xorg.yml
        ---
        @@ -2295,7 +2298,7 @@ In order to achive a clean shutdown of the session, x@t7.service is
         
      6. -
      7. detect-xorg.yml
        +
      8. detect-xorg.yml
        ---
        @@ -2455,7 +2458,7 @@ In order to achive a clean shutdown of the session, x@t7.service is
         
      9. -
      10. intel.yml
        +
      11. intel.yml

        KMS drivers (like for intel (i915) and amd (radeon)) require additional configuration beneath a customized xorg.conf - for a „static“ output configuration (which works if the TV or AV receiver is not turned on) we need to force loading the display(s) EDID early during the boot process. @@ -2502,12 +2505,12 @@ Please note that rescanning the connected displays works only after removing the

      -
      -

      7.10.4 templates

      +
      +

      7.10.4 templates

        -
      1. grub
        +
      2. grub
        {% set output_flag = 'D' if ("HDMI" in xorg.primary.connector or "DVI" in xorg.primary.connector or "DP" in xorg.primary.connector) else 'e' %} 
        @@ -2517,9 +2520,9 @@ Please note that rescanning the connected displays works only after removing the
         
      3. -
      4. xorg
        +
      5. xorg
          -
        1. x-verbose@.service
          +
        2. x-verbose@.service
          # file: roles/yavdr-xorg/templates/systemd/system/x-verbose@.service.j2
          @@ -2535,7 +2538,7 @@ Please note that rescanning the connected displays works only after removing the
           
        3. -
        4. Drop-in snippet for x@.service
          +
        5. Drop-in snippet for x@.service
          [Unit]
          @@ -2561,7 +2564,7 @@ Please note that rescanning the connected displays works only after removing the
           
        6. -
        7. Drop-in snippet for vdr.service
          +
        8. Drop-in snippet for vdr.service
          {{ ansible_managed | comment }}
          @@ -2573,7 +2576,7 @@ Please note that rescanning the connected displays works only after removing the
           
        9. -
        10. xorg.conf snippets
          +
        11. xorg.conf snippets
          {{ ansible_managed | comment }}
          @@ -2587,7 +2590,7 @@ EndSection
           
        12. -
        13. xorg.conf
          +
        14. xorg.conf
          Section "Device"
          @@ -2913,7 +2916,7 @@ EndSection
           
      6. -
      7. vdr
        +
      8. vdr

        Set environment variables for system locale and user session on startup @@ -2929,12 +2932,12 @@ Set environment variables for system locale and user session on startup

      -
      -

      7.10.5 files

      +
      +

      7.10.5 files

        -
      1. initramfs EDID hook
        +
      2. initramfs EDID hook
        #!/bin/bash
        @@ -2960,16 +2963,16 @@ manual_add_modules i915 radeon
         
        -
        -

        7.11 yavdr-desktop

        +
        +

        7.11 yavdr-desktop

        -
        -

        7.11.1 Tasks

        +
        +

        7.11.1 Tasks

          -
        1. main.yml
          +
        2. main.yml
          ---
          @@ -3118,14 +3121,14 @@ manual_add_modules i915 radeon
           
        -
        -

        7.11.2 Templates

        +
        +

        7.11.2 Templates

          -
        1. xorg configuration
          +
        2. xorg configuration
            -
          1. .Xresources
            +
          2. .Xresources
            xterm*background: Black
            @@ -3148,7 +3151,7 @@ XTerm.vt100.font: 7x13
             
          3. -
          4. .xinitrc
            +
          5. .xinitrc
            #!/bin/bash
            @@ -3160,9 +3163,9 @@ XTerm.vt100.font: 7x13
             
        3. -
        4. openbox
          +
        5. openbox
            -
          1. autostart
            +
          2. autostart
            # forward environment variables to an environment file and the systemd user session
            @@ -3198,7 +3201,7 @@ systemctl --user isolate yavdr-desktop.target
             
          3. -
          4. rc.xml
            +
          5. rc.xml
            <?xml version="1.0" encoding="UTF-8"?>
            @@ -4018,7 +4021,7 @@ systemctl --user isolate yavdr-desktop.target
             
          6. -
          7. rc2.xml
            +
          8. rc2.xml
            <?xml version="1.0" encoding="UTF-8"?>
            @@ -4841,9 +4844,9 @@ systemctl --user isolate yavdr-desktop.target
             
        6. -
        7. Systemd User Session
          +
        8. Systemd User Session
            -
          1. yavdr-desktop.target
            +
          2. yavdr-desktop.target
            [Unit]
            @@ -4856,7 +4859,7 @@ systemctl --user isolate yavdr-desktop.target
             
          3. -
          4. detect-second-display
            +
          5. detect-second-display
            [Unit]
            @@ -4872,7 +4875,7 @@ systemctl --user isolate yavdr-desktop.target
             
          6. -
          7. openbox-second.service
            +
          8. openbox-second.service
            [Unit]
            @@ -4894,7 +4897,7 @@ systemctl --user isolate yavdr-desktop.target
             
          9. -
          10. osd2web.service
            +
          11. osd2web.service
            [Unit]
            @@ -4917,7 +4920,7 @@ systemctl --user isolate yavdr-desktop.target
             
          12. -
          13. tmux.service
            +
          14. tmux.service
            [Unit]
            @@ -4936,7 +4939,7 @@ systemctl --user isolate yavdr-desktop.target
             
          15. -
          16. wm-exit.service
            +
          17. wm-exit.service
            [Unit]
            @@ -4955,7 +4958,7 @@ systemctl --user isolate yavdr-desktop.target
             
        9. -
        10. irexec
          +
        11. irexec

          irexec.service starts irexec for the user session @@ -4989,12 +4992,12 @@ end

        -
        -

        7.12 samba-install

        +
        +

        7.12 samba-install

        -
        -

        7.12.1 tasks

        +
        +

        7.12.1 tasks

        ---
        @@ -5016,12 +5019,12 @@ end
         
        -
        -

        7.13 samba-config

        +
        +

        7.13 samba-config

        -
        -

        7.13.1 tasks

        +
        +

        7.13.1 tasks

        ---
        @@ -5046,14 +5049,14 @@ end
         
        -
        -

        7.13.2 templates

        +
        +

        7.13.2 templates

          -
        1. smb.conf
          +
        2. smb.conf
            -
          1. global settings
            +
          2. global settings
            {{ ansible_managed | comment }}
            @@ -5139,7 +5142,7 @@ end
             
          3. -
          4. media directories
            +
          5. media directories
            {% for name, path in media_dirs.iteritems() %}
            @@ -5161,7 +5164,7 @@ end
             
          6. -
          7. include custom samba exports
            +
          8. include custom samba exports
            include = /etc/samba/smb.conf.custom
            @@ -5174,15 +5177,15 @@ end
             
        -
        -

        7.14 STARTED autoinstall-drivers

        +
        +

        7.14 STARTED autoinstall-drivers

        It would be nice to be able to detect if it is suitable to install those drivers:

        -
        -

        7.14.1 TODO sundtek for Sundtek devices (local or network connection)

        +
        +

        7.14.1 TODO sundtek for Sundtek devices (local or network connection)

        Vendor-IDs: @@ -5193,7 +5196,7 @@ Vendor-IDs:

          -
        1. planned packages
          +
        2. planned packages
          • yavdr-hardware-sundtek
          • @@ -5204,8 +5207,8 @@ Vendor-IDs:
        -
        -

        7.14.2 TODO drivers for TT S2-6400 FF

        +
        +

        7.14.2 TODO drivers for TT S2-6400 FF

        https://github.com/s-moch/linux-saa716x - kann man den relevanten Teil als dkms-Paket bauen? @@ -5213,15 +5216,15 @@ Vendor-IDs:

        -
        -

        7.15 autoinstall-ubuntu-drivers

        +
        +

        7.15 autoinstall-ubuntu-drivers

        The tool ubuntu-drivers is used to install the matching driver version for nvidia graphics cards, virtualbox guest additions and Intel and AMD microcode updates.

        -
        -

        7.15.1 tasks

        +
        +

        7.15.1 tasks

        ---
        @@ -5244,8 +5247,8 @@ The tool ubuntu-drivers is used to install the matching driver version for nvidi
         
        -
        -

        7.16 autoinstall-virtualbox-guest

        +
        +

        7.16 autoinstall-virtualbox-guest

        This role installs the guest additions for virtualbox guests on Ubuntu 16.04 @@ -5296,12 +5299,12 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04

        -
        -

        7.17 autoinstall-atric-usb

        +
        +

        7.17 autoinstall-atric-usb

        -
        -

        7.17.1 dependencies

        +
        +

        7.17.1 dependencies

        ---
        @@ -5313,8 +5316,8 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04
         
        -
        -

        7.17.2 tasks

        +
        +

        7.17.2 tasks

        ---
        @@ -5356,8 +5359,8 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04
         
        -
        -

        7.17.3 templates

        +
        +

        7.17.3 templates

        {{ ansible_managed | comment }}
        @@ -5386,12 +5389,12 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04
         
        -
        -

        7.18 autoinstall-yausbir

        +
        +

        7.18 autoinstall-yausbir

        -
        -

        7.18.1 dependencies

        +
        +

        7.18.1 dependencies

        ---
        @@ -5402,8 +5405,8 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04
         
        -
        -

        7.18.2 tasks

        +
        +

        7.18.2 tasks

        ---
        @@ -5445,8 +5448,8 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04
         
        -
        -

        7.18.3 templates

        +
        +

        7.18.3 templates

        {{ ansible_managed | comment }}
        @@ -5474,15 +5477,15 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04
         
        -
        -

        7.19 autoinstall-satip

        +
        +

        7.19 autoinstall-satip

        If a Sat>IP Server responds to a discovery request, the package vdr-plugin-satip is installed.

        -
        -

        7.19.1 tasks

        +
        +

        7.19.1 tasks

        ---
        @@ -5507,12 +5510,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.20 autoinstall-targavfd

        +
        +

        7.20 autoinstall-targavfd

        -
        -

        7.20.1 tasks

        +
        +

        7.20.1 tasks

        ---
        @@ -5528,12 +5531,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.21 autoinstall-imonlcd

        +
        +

        7.21 autoinstall-imonlcd

        -
        -

        7.21.1 tasks

        +
        +

        7.21.1 tasks

        ---
        @@ -5549,12 +5552,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.22 autoinstall-libcecdaemon

        +
        +

        7.22 autoinstall-libcecdaemon

        -
        -

        7.22.1 tasks

        +
        +

        7.22.1 tasks

        ---
        @@ -5570,12 +5573,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.23 autoinstall-pvr350

        +
        +

        7.23 autoinstall-pvr350

        -
        -

        7.23.1 tasks

        +
        +

        7.23.1 tasks

        ---
        @@ -5591,8 +5594,8 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.24 autoinstall-hauppauge-pvr

        +
        +

        7.24 autoinstall-hauppauge-pvr

        ---
        @@ -5607,12 +5610,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.25 autoinstall-firmware

        +
        +

        7.25 autoinstall-firmware

        -
        -

        7.25.1 dependencies

        +
        +

        7.25.1 dependencies

        ---
        @@ -5623,8 +5626,8 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.25.2 tasks

        +
        +

        7.25.2 tasks

        ---
        @@ -5665,12 +5668,12 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.26 autoinstall-dvbsky-firmware

        +
        +

        7.26 autoinstall-dvbsky-firmware

        -
        -

        7.26.1 dependencies

        +
        +

        7.26.1 dependencies

        ---
        @@ -5681,8 +5684,8 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.26.2 defaults

        +
        +

        7.26.2 defaults

        ---
        @@ -5692,8 +5695,8 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.26.3 tasks

        +
        +

        7.26.3 tasks

        ---
        @@ -5743,15 +5746,15 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.27 TODO autoinstall-dvbhddevice

        +
        +

        7.27 TODO autoinstall-dvbhddevice

        Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware sollte in yavdr-firmware stecken

        -
        -

        7.27.1 dependencies

        +
        +

        7.27.1 dependencies

        ---
        @@ -5762,8 +5765,8 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
         
        -
        -

        7.27.2 tasks

        +
        +

        7.27.2 tasks

        ---
        @@ -5780,12 +5783,12 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
         
        -
        -

        7.28 autoinstall-dvbsddevice

        +
        +

        7.28 autoinstall-dvbsddevice

        -
        -

        7.28.1 dependencies

        +
        +

        7.28.1 dependencies

        ---
        @@ -5796,8 +5799,8 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
         
        -
        -

        7.28.2 tasks

        +
        +

        7.28.2 tasks

        ---
        @@ -5815,12 +5818,12 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
         
        -
        -

        7.29 autoinstall-hardware-irmp

        +
        +

        7.29 autoinstall-hardware-irmp

        -
        -

        7.29.1 dependencies

        +
        +

        7.29.1 dependencies

        ---
        @@ -5831,8 +5834,8 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
         
        -
        -

        7.29.2 tasks

        +
        +

        7.29.2 tasks

        ---
        @@ -5848,19 +5851,19 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
         
        -
        -

        7.30 kodi

        +
        +

        7.30 kodi

        -
        -

        7.30.1 tasks

        +
        +

        7.30.1 tasks

          -
        1. Install KODI
          +
        2. Install KODI
            -
          • main.yml
            -
            +
          • main.yml
            +
            - import_tasks: install-kodi.yml tags=install,update,kodi:install
             - import_tasks: configure-kodi.yml tags=install,update,kodi:configure
            @@ -5868,7 +5871,7 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
             
          • -
          • install-kodi.yml
            +
          • install-kodi.yml
            ---
            @@ -5900,7 +5903,7 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
             
          • -
          • configure-kodi.yml
            +
          • configure-kodi.yml
            - name: create kodi.service for the user session
            @@ -5949,12 +5952,12 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
             
        -
        -

        7.30.2 templates

        +
        +

        7.30.2 templates

          -
        1. kodi.service
          +
        2. kodi.service

          This systemd unit for the user session starts (and stops) kodi. @@ -5979,15 +5982,15 @@ This systemd unit for the user session starts (and stops) kodi.

        -
        -

        7.30.3 files

        +
        +

        7.30.3 files

        Those configuration files provide a preconfiguration for kodi which overrides the system wide configuration

          -
        1. Lircmap.xml
          +
        2. Lircmap.xml

          This file allows to map keys sent by remotes via eventlircd (which uses the name devinput) to kodi key names. @@ -6058,14 +6061,14 @@ This file allows to map keys sent by remotes via eventlircd (which uses the name

      3. -
      4. keymaps
        +
      5. keymaps

        This file maps the keys defined in Lircmap.xml to actions within kodi.

          -
        1. remote.xml
          +
        2. remote.xml
          <?xml version="1.0" encoding="UTF-8"?>
          @@ -6617,17 +6620,17 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
           
      -
      -

      7.31 dvd

      +
      +

      7.31 dvd

      -
      -

      7.31.1 tasks

      +
      +

      7.31.1 tasks

        -
      • install libdvd-pkg, allow programs to eject optical media
        -
        +
      • install libdvd-pkg, allow programs to eject optical media
        +
        ---
         # file: roles/dvd/tasks/main.yml
        @@ -6668,15 +6671,15 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
         
      -
      -

      7.32 install-sundtek

      +
      +

      7.32 install-sundtek

      -
      -

      7.32.1 variables

      +
      +

      7.32.1 variables

      -
      -

      7.32.2 tasks

      +
      +

      7.32.2 tasks

      ---
      @@ -6725,8 +6728,8 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
       
      -
      -

      7.32.3 templates

      +
      +

      7.32.3 templates

      # ----- GLOBAL SECTION -----
      @@ -6832,8 +6835,8 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
       
      -
      -

      7.33 template-test

      +
      +

      7.33 template-test

      ---
      @@ -7074,12 +7077,12 @@ EndSection
       
      -
      -

      7.34 wakeup

      +
      +

      7.34 wakeup

      -
      -

      7.34.1 defaults

      +
      +

      7.34.1 defaults

      ---
      @@ -7089,8 +7092,8 @@ EndSection
       
      -
      -

      7.34.2 tasks

      +
      +

      7.34.2 tasks

      ---
      @@ -7111,8 +7114,8 @@ EndSection
       
      -
      -

      7.34.3 templates

      +
      +

      7.34.3 templates

      {{ ansible_managed | comment }}
      @@ -7138,12 +7141,12 @@ ACPI_START_AHEAD=5
       
      -
      -

      7.35 grub-config

      +
      +

      7.35 grub-config

      -
      -

      7.35.1 default variables

      +
      +

      7.35.1 default variables

      system:
      @@ -7155,8 +7158,8 @@ ACPI_START_AHEAD=5
       
      -
      -

      7.35.2 tasks

      +
      +

      7.35.2 tasks

      ---
      @@ -7181,8 +7184,8 @@ ACPI_START_AHEAD=5
       
      -
      -

      7.35.3 templates

      +
      +

      7.35.3 templates

      #!/bin/sh
      @@ -7205,8 +7208,8 @@ menuentry "PowerOff" 
      -

      7.35.4 handlers

      +
      +

      7.35.4 handlers

      ---
      @@ -7229,15 +7232,15 @@ menuentry "PowerOff" 
      -

      8 Modules

      +
      +

      8 Modules

      This section contains custom modules for the yaVDR Playbooks. They are used to collect facts about the system and configure applications and daemons.

      -
      -

      8.1 hardware_facts.py

      +
      +

      8.1 hardware_facts.py

      # This Module collects the vendor- and device ids for USB- and PCI(e)-devices and currently loaded kernel modules.
      @@ -7415,8 +7418,8 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
       
      -
      -

      8.2 pci_facts.py

      +
      +

      8.2 pci_facts.py

      @@ -7492,8 +7495,8 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
       
      -
      -

      8.3 satip_facts.py

      +
      +

      8.3 satip_facts.py

      DOCUMENTATION = '''
      @@ -7617,8 +7620,8 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
       
      -
      -

      8.4 xrandr_facts.py

      +
      +

      8.4 xrandr_facts.py

      • [ ] support multiple screens (-d :0.0 .. :0.n)
      • @@ -7845,6 +7848,7 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c def output_data(data, write_edids=True): + result = {} if data: modes = [] for _, screen_data in data.items(): @@ -7856,7 +7860,6 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c for refreshrate in refreshrates: modes.append(Mode(connector, resolution, refreshrate)) if modes: - result = {} try: gpu_name, bus_id = collect_nvidia_data() except ValueError: @@ -7905,8 +7908,8 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
      -
      -

      9 Handlers

      +
      +

      9 Handlers

      - name: Reconfigure unattended upgrades with dpkg
      @@ -7999,7 +8002,7 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
       

      Autor: Alexander Grothe <seahawk1986@gmx.de>

      -

      Created: 2018-09-04 Di 13:22

      +

      Created: 2018-09-05 Mi 12:23

      Validate

      diff --git a/Manual.org b/Manual.org index 11fe1a1..8267b40 100644 --- a/Manual.org +++ b/Manual.org @@ -141,14 +141,17 @@ We use a callback to generate tags for all roles autmatically: ** Install script for local usage #+BEGIN_SRC shell :tangle install-yavdr.sh :shebang "#!/bin/bash" +set -e if (( $EUID != 0 )); then echo "This script must be run using sudo -H or as root" exit fi -apt-get -y install software-properties-common # update packages -apt-get update +apt update +apt -y install software-properties-common +add-apt-repository -y ppa:ansible/ansible-2.6 + # install required packages apt-get -y install --no-install-recommends ansible python-jmespath @@ -6113,6 +6116,7 @@ def collect_nvidia_data(): def output_data(data, write_edids=True): + result = {} if data: modes = [] for _, screen_data in data.items(): @@ -6124,7 +6128,6 @@ def output_data(data, write_edids=True): for refreshrate in refreshrates: modes.append(Mode(connector, resolution, refreshrate)) if modes: - result = {} try: gpu_name, bus_id = collect_nvidia_data() except ValueError: diff --git a/install-yavdr.sh b/install-yavdr.sh index 5c1d0ad..8e4999b 100755 --- a/install-yavdr.sh +++ b/install-yavdr.sh @@ -1,12 +1,15 @@ #!/bin/bash +set -e if (( $EUID != 0 )); then echo "This script must be run using sudo -H or as root" exit fi -apt-get -y install software-properties-common # update packages -apt-get update +apt update +apt -y install software-properties-common +add-apt-repository -y ppa:ansible/ansible-2.6 + # install required packages apt-get -y install --no-install-recommends ansible python-jmespath