From 75cd1eb560385d619aaeab1cde7aab71fb31541f Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Tue, 21 Nov 2017 11:30:03 +0100 Subject: [PATCH] improve syntax, add new variables for detected gpus --- Manual.html | 851 +++++++++++++------------ Manual.org | 73 ++- library/hardware_facts.py | 6 +- roles/collect-facts/tasks/main.yml | 17 +- roles/yavdr-xorg/tasks/detect-xorg.yml | 117 +++- roles/yavdr-xorg/tasks/setup-xorg.yml | 18 +- 6 files changed, 638 insertions(+), 444 deletions(-) diff --git a/Manual.html b/Manual.html index f0d98de..1f4c685 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,223 +240,224 @@ 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. @@ -489,22 +490,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 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. @@ -526,8 +527,8 @@ sudo ./install-yavdr.sh

-
-

3.1 Install script for local usage

+
+

3.1 Install script for local usage

if (( $EUID != 0 )); then
@@ -550,12 +551,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: @@ -604,8 +605,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 @@ -638,8 +639,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: @@ -653,12 +654,12 @@ This playbook can either be used to run the installation on the localhost or any

-
-

6 Group Variables

+
+

6 Group Variables

-
-

6.1 default text for templates used by ansible

+
+

6.1 default text for templates used by ansible

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

6.2 PPAs

+
+

6.2 PPAs

branch: unstable
@@ -687,8 +688,8 @@ This playbook can either be used to run the installation on the localhost or any
 
-
-

6.3 VDR user, directories, special configuration and plugins

+
+

6.3 VDR user, directories, special configuration and plugins

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

6.4 Media directories

+
+

6.4 Media directories

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

6.5 NFS

+
+

6.5 NFS

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

6.6 Samba

+
+

6.6 Samba

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

6.7 Additional packages

+
+

6.7 Additional packages

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

6.8 System pre-configuration

+
+

6.8 System pre-configuration

frontend: vdr
@@ -784,20 +785,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
    ---
    @@ -817,19 +818,19 @@ This playbook can either be used to run the installation on the localhost or any
     
    -
    -

    7.2 nvidia-387 drivers

    +
    +

    7.2 nvidia-387 drivers

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

    -
    -

    7.2.1 tasks

    +
    +

    7.2.1 tasks

      -
    1. main.yml
      +
    2. main.yml
      ---
      @@ -855,15 +856,15 @@ install nvidia-387 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. @@ -876,7 +877,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. @@ -893,7 +894,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. @@ -906,7 +907,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 @@ -920,7 +921,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. @@ -953,15 +954,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
      ---
      @@ -977,7 +978,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: @@ -994,7 +995,7 @@ This task prevents apt to automatically install all recommended dependencies for

    -
  • Set up package repositories
    +
  • Set up package repositories
    - name: add PPAs
    @@ -1012,7 +1013,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
    @@ -1024,8 +1025,8 @@ 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
    - name: disable release-upgrade notifications
    @@ -1039,7 +1040,7 @@ This task prevents apt to automatically install all recommended dependencies for
     
  • -
  • Install essential packages
    +
  • Install essential packages
    - name: apt | install basic packages
    @@ -1071,7 +1072,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
    @@ -1085,13 +1086,13 @@ This task prevents apt to automatically install all recommended dependencies for
     
  • -
  • create media directories
  • +
  • create media directories
  • -
    -

    7.3.3 templates

    +
    +

    7.3.3 templates

    {{ ansible_managed_file | comment('c') }}
    @@ -1103,16 +1104,16 @@ APT::Install-Suggests "0";
     
    -
    -

    7.4 collect facts about the system with custom modules

    +
    +

    7.4 collect facts about the system with custom modules

    -
    -

    7.4.1 tasks

    +
    +

    7.4.1 tasks

      -
    1. main.yml
      +
    2. main.yml
      - name: get information about usb and pci hardware and loaded kernel modules
      @@ -1139,16 +1140,16 @@ APT::Install-Suggests "0";
       
    -
    -

    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
      ---
      @@ -1167,7 +1168,7 @@ APT::Install-Suggests "0";
       
    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
      @@ -1182,7 +1183,7 @@ APT::Install-Suggests "0";
       
    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
      @@ -1218,7 +1219,7 @@ APT::Install-Suggests "0";
       
    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 @@ -1236,7 +1237,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
    @@ -1269,15 +1270,15 @@ The additional plugins to install can be set in the variable {{vdr_plugins
     
     
    -
    -

    7.5.2 templates

    +
    +

    7.5.2 templates

    -
    -

    7.5.3 files

    +
    +

    7.5.3 files

      -
    1. remote.conf
      +
    2. remote.conf
      LIRC.Up KEY_UP
      @@ -1412,7 +1413,7 @@ XKeySym.Next       XF86AudioNext
       
    3. -
    4. keymacros.conf
      +
    5. keymacros.conf
      # Remote control key macros for VDR
      @@ -1438,12 +1439,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
    @@ -1451,8 +1452,8 @@ User0     @osdteletext
     
    -
    -

    7.6.2 tasks

    +
    +

    7.6.2 tasks

    ---
    @@ -1522,15 +1523,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

    ---
    @@ -1559,12 +1560,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 }})
      @@ -1575,7 +1576,7 @@ User0     @osdteletext
       
    3. -
    4. avahi services
      +
    5. avahi services
      <?xml version="1.0" standalone='no'?>
      @@ -1596,15 +1597,15 @@ User0     @osdteletext
       
    -
    -

    7.8 STARTED yavdr-remote

    +
    +

    7.8 STARTED yavdr-remote

    -
    -

    7.8.1 default variables

    +
    +

    7.8.1 default variables

    -
    -

    7.8.2 tasks

    +
    +

    7.8.2 tasks

    ---
    @@ -1655,8 +1656,8 @@ User0     @osdteletext
     
    -
    -

    7.8.3 templates

    +
    +

    7.8.3 templates

    {% if frontend != 'kodi' %}
    @@ -1667,17 +1668,17 @@ User0     @osdteletext
     
    -
    -

    7.8.4 files

    +
    +

    7.8.4 files

    -
    -

    7.9 pulseaudio

    +
    +

    7.9 pulseaudio

    -
    -

    7.9.1 tasks

    +
    +

    7.9.1 tasks

    ---
    @@ -1699,8 +1700,8 @@ User0     @osdteletext
     
    -
    -

    7.9.2 templates

    +
    +

    7.9.2 templates

    # Use PulseAudio by default
    @@ -1722,12 +1723,12 @@ User0     @osdteletext
     
    -
    -

    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. @@ -1755,11 +1756,11 @@ In order to achive a clean shutdown of the session, x@t7.service is

    -
    -

    7.10.2 default variables

    +
    +

    7.10.2 default variables

    -
    -

    7.10.3 tasks

    +
    +

    7.10.3 tasks

    ---
    @@ -1778,31 +1779,31 @@ In order to achive a clean shutdown of the session, x@t7.service is
         dest: '{{ item }}'
         state: directory
       with_items:
    -    - /etc/systemd/system/x@.service.d/
    -    - /etc/systemd/system/vdr.service.d/
    -    - '/etc/systemd/system/user@{{ vdr.uid }}.service.d/'
    +    - "/etc/systemd/system/x@.service.d/"
    +    - "/etc/systemd/system/vdr.service.d/"
    +    - "/etc/systemd/system/user@{{ vdr.uid }}.service.d/"
     
    -- name: add dependency to X-server for vdr.service using a drop-in
    +- name: systemd-drop-in: add dependency to X-server for vdr.service
       template:
         src: templates/vdr-xorg.conf
         dest: /etc/systemd/system/vdr.service.d/vdr-xorg.conf
     
    -- name: start x@.service before xlogin@.service
    +- name: systemd-drop-in: start x@.service before xlogin@.service
       template:
         src: templates/x@service.d/xlogin.conf.j2
         dest: /etc/systemd/system/x@.service.d/xlogin.conf
     
    -- name: load environment file for vdr.service
    +- name: systemd-drop-in: load environment file for vdr.service
       template:
         src: templates/systemd/vdr-environ.j2
         dest: /etc/systemd/system/vdr.service.d/load-environ.conf
     
    -- name: user@{{ vdr.uid }}.service depends on x@vt7.service
    +- name: systemd-drop-in: user@{{ vdr.uid }}.service depends on x@vt7.service
       template:
         src: templates/user@666.service.d/x-dependency.conf.j2
         dest: '/etc/systemd/system/user@{{ vdr.uid }}.service.d/x-dependency.conf'
     
    -- name: start softhddevice detached and set audio to pulseaudio
    +- name: vdr-config: start softhddevice detached and set audio to pulseaudio
       lineinfile:
         path: /etc/vdr/conf.avail/softhddevice.conf
         line: '{{ item }}'
    @@ -1810,7 +1811,7 @@ In order to achive a clean shutdown of the session, x@t7.service is
           - '-D'
           # - '-a pulse' # do we need this with our existing asound.conf?
     
    -- name: set a login shell for the user vdr
    +- name: add a login shell for the user vdr
       user:
           name: '{{ vdr.user }}'
           shell: '/bin/bash'
    @@ -1878,6 +1879,10 @@ In order to achive a clean shutdown of the session, x@t7.service is
         name: x@vt7.service
         state: stopped
     
    +- name: "wait a little bit before starting x-verbose@vt7.service (needed?)"
    +  wait_for:
    +    timeout: 3
    +
     - name: "start x-verbose@.service"
       systemd:
         name: "x-verbose@vt7.service"
    @@ -1907,14 +1912,23 @@ In order to achive a clean shutdown of the session, x@t7.service is
         enabled: false
         masked: true
     
    +- name: "wait a little bit, so X has some time to shut down (needed?)"
    +  wait_for:
    +    timeout: 3
    +
     # TODO: expand template for xorg.conf (or snippets)
     #       with respect for the available graphics card driver
     #       nvidia, noveau, intel, radeon
    -- name: create xorg.conf (for nvidia driver)
    -  template:
    -    src: templates/xorg.conf.j2
    -    dest: /etc/X11/xorg.conf
    -    backup: yes
    +
    +- name: nvidia related config
    +  block:
    +    - name: create xorg.conf (for nvidia driver)
    +    template:
    +        src: templates/xorg.conf.j2
    +        dest: /etc/X11/xorg.conf
    +        backup: yes
    +  when:
    +    - 'if {% gpus | selectattr("VendorName", "nvidia") | list %}'
     
    @@ -2016,14 +2030,14 @@ In order to achive a clean shutdown of the session, x@t7.service is
    -
    -

    7.10.4 templates

    +
    +

    7.10.4 templates

      -
    1. xorg
      +
    2. xorg
        -
      1. x-verbose@.service
        +
      2. x-verbose@.service
        # file: roles/yavdr-xorg/templates/systemd/system/x-verbose@.service.j2
        @@ -2039,7 +2053,7 @@ 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]
        @@ -2060,7 +2074,7 @@ 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
        # file: roles/yavdr-xorg/templates/vdr-xorg.conf
        @@ -2073,7 +2087,7 @@ In order to achive a clean shutdown of the session, x@t7.service is
         
      9. -
      10. .xinitrc
        +
      11. .xinitrc
        #!/bin/bash
        @@ -2083,7 +2097,7 @@ In order to achive a clean shutdown of the session, x@t7.service is
         
      12. -
      13. xorg.conf
        +
      14. xorg.conf
        Section "Device"
        @@ -2410,7 +2424,7 @@ EndSection
         
    3. -
    4. vdr
      +
    5. vdr
      [Service]
      @@ -2420,9 +2434,9 @@ EndSection
       
    6. -
    7. Systemd User Session
      +
    8. Systemd User Session
        -
      1. yavdr-desktop.target
        +
      2. yavdr-desktop.target
        [Unit]
        @@ -2436,7 +2450,7 @@ EndSection
         
      3. -
      4. detect-second-display
        +
      5. detect-second-display
        [Unit]
        @@ -2452,7 +2466,7 @@ EndSection
         
      6. -
      7. openbox-second.service
        +
      8. openbox-second.service
        [Unit]
        @@ -2473,7 +2487,7 @@ EndSection
         
      9. -
      10. osd2web.service
        +
      11. osd2web.service
        [Unit]
        @@ -2494,7 +2508,7 @@ EndSection
         
      12. -
      13. tmux.service
        +
      14. tmux.service
        [Unit]
        @@ -2513,7 +2527,7 @@ EndSection
         
      15. -
      16. wm-exit.service
        +
      17. wm-exit.service
        [Unit]
        @@ -2532,9 +2546,9 @@ EndSection
         
    9. -
    10. openbox
      +
    11. openbox
        -
      1. autostart
        +
      2. autostart
        # forward environment variables to an environment file and the systemd user session
        @@ -2568,7 +2582,7 @@ systemctl --user isolate yavdr-desktop.target
         
      3. -
      4. rc.xml
        +
      5. rc.xml
        <?xml version="1.0" encoding="UTF-8"?>
        @@ -3398,12 +3412,12 @@ systemctl --user isolate yavdr-desktop.target
         
        -
        -

        7.11 samba-install

        +
        +

        7.11 samba-install

        -
        -

        7.11.1 tasks

        +
        +

        7.11.1 tasks

        ---
        @@ -3425,12 +3439,12 @@ systemctl --user isolate yavdr-desktop.target
         
        -
        -

        7.12 samba-config

        +
        +

        7.12 samba-config

        -
        -

        7.12.1 tasks

        +
        +

        7.12.1 tasks

        ---
        @@ -3455,14 +3469,14 @@ systemctl --user isolate yavdr-desktop.target
         
        -
        -

        7.12.2 templates

        +
        +

        7.12.2 templates

          -
        1. smb.conf
          +
        2. smb.conf
            -
          1. global settings
            +
          2. global settings
            {{ ansible_managed_file | comment }}
            @@ -3548,7 +3562,7 @@ systemctl --user isolate yavdr-desktop.target
             
          3. -
          4. media directories
            +
          5. media directories
            {% for name, path in media_dirs.iteritems() %}
            @@ -3570,7 +3584,7 @@ systemctl --user isolate yavdr-desktop.target
             
          6. -
          7. include custom samba exports
            +
          8. include custom samba exports
            include = /etc/samba/smb.conf.custom
            @@ -3583,15 +3597,15 @@ systemctl --user isolate yavdr-desktop.target
             
        -
        -

        7.13 STARTED autoinstall-drivers

        +
        +

        7.13 STARTED autoinstall-drivers

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

        -
        -

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

        +
        +

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

        Vendor-IDs: @@ -3602,14 +3616,14 @@ Vendor-IDs:

        -
        -

        7.13.2 TODO dddvb-dkms if only newer DD cards are detected

        +
        +

        7.13.2 TODO dddvb-dkms if only newer DD cards are detected

        -
        -

        7.13.3 TODO media-build-experimental (up to kernel 4.8) for „old“ cards like TT S2-6400 FF

        +
        +

        7.13.3 TODO media-build-experimental (up to kernel 4.8) for „old“ cards like TT S2-6400 FF

        -
        -

        7.13.4 TODO newly merged DD drivers

        +
        +

        7.13.4 TODO newly merged DD drivers

        from http://www.vdr-portal.de/board18-vdr-hardware/board102-dvb-karten/120817-treiber-der-cine-ctv6-ddbridge-ci-in-den-kernel-integrieren/ @@ -3618,15 +3632,15 @@ from -

        7.14 autoinstall-ubuntu-drivers

        +
        +

        7.14 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.14.1 tasks

        +
        +

        7.14.1 tasks

        ---
        @@ -3649,15 +3663,15 @@ The tool ubuntu-drivers is used to install the matching driver version for nvidi
         
        -
        -

        7.15 autoinstall-satip

        +
        +

        7.15 autoinstall-satip

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

        -
        -

        7.15.1 tasks

        +
        +

        7.15.1 tasks

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

        7.16 autoinstall-targavfd

        +
        +

        7.16 autoinstall-targavfd

        -
        -

        7.16.1 tasks

        +
        +

        7.16.1 tasks

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

        7.17 autoinstall-imonlcd

        +
        +

        7.17 autoinstall-imonlcd

        -
        -

        7.17.1 tasks

        +
        +

        7.17.1 tasks

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

        7.18 autoinstall-libcecdaemon

        +
        +

        7.18 autoinstall-libcecdaemon

        -
        -

        7.18.1 tasks

        +
        +

        7.18.1 tasks

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

        7.19 autoinstall-pvr350

        +
        +

        7.19 autoinstall-pvr350

        -
        -

        7.19.1 tasks

        +
        +

        7.19.1 tasks

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

        7.20 autoinstall-hauppauge-pvr

        +
        +

        7.20 autoinstall-hauppauge-pvr

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

        7.21 autoinstall-dvbsky-firmware

        +
        +

        7.21 autoinstall-dvbsky-firmware

        -
        -

        7.21.1 defaults

        +
        +

        7.21.1 defaults

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

        7.21.2 tasks

        +
        +

        7.21.2 tasks

        ---
        @@ -3808,7 +3822,7 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
           block:
             - name: add firmware for DVBSky S952 V3 to variable dvbsky_firmware_files if a card has been detected
               set_fact:
        -        dvbsky_firmware_files: dvbsky_firmware_files + [ 'dvb-demod-m88rs6000.fw']
        +        dvbsky_firmware_files: "{{dvbsky_firmware_files}} + ['dvb-demod-m88rs6000.fw']"
               when:
                 - '"1ade:3038" in pci'
                 - ansible_distribution_version >= '15.04'  #driver only included since Kernel 3.19
        @@ -3849,15 +3863,15 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.22 TODO autoinstall-dvbhddevice

        +
        +

        7.22 TODO autoinstall-dvbhddevice

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

        -
        -

        7.22.1 tasks

        +
        +

        7.22.1 tasks

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

        7.23 autoinstall-dvbsddevice

        +
        +

        7.23 autoinstall-dvbsddevice

        -
        -

        7.23.1 tasks

        +
        +

        7.23.1 tasks

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

        7.24 autoinstall-hardware-irmp

        +
        +

        7.24 autoinstall-hardware-irmp

        -
        -

        7.24.1 tasks

        +
        +

        7.24.1 tasks

        ---
        @@ -3916,24 +3930,24 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
         
          -
        1. TODO add other device ids if necessary
        2. +
        3. TODO add other device ids if necessary
        -
        -

        7.25 kodi

        +
        +

        7.25 kodi

        -
        -

        7.25.1 tasks

        +
        +

        7.25.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
            @@ -3941,7 +3955,7 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
             
          • -
          • install-kodi.yml
            +
          • install-kodi.yml
            ---
            @@ -3959,7 +3973,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
            @@ -4008,12 +4022,12 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
             
        -
        -

        7.25.2 templates

        +
        +

        7.25.2 templates

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

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

        -
        -

        7.25.3 files

        +
        +

        7.25.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. @@ -4116,14 +4130,14 @@ This file allows to map keys sent by remotes via eventlircd (which uses the name

      6. -
      7. keymaps
        +
      8. keymaps

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

          -
        1. remote.xml
          +
        2. remote.xml
          <!-- This file contains the mapping of keys (gamepad, remote, and keyboard) to actions within XBMC -->
          @@ -4674,17 +4688,17 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
           
    -
    -

    7.26 dvd

    +
    +

    7.26 dvd

    -
    -

    7.26.1 tasks

    +
    +

    7.26.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
      @@ -4724,8 +4738,8 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
       
    -
    -

    7.27 template-test

    +
    +

    7.27 template-test

    ---
    @@ -4966,12 +4980,12 @@ EndSection
     
    -
    -

    7.28 wakeup

    +
    +

    7.28 wakeup

    -
    -

    7.28.1 defaults

    +
    +

    7.28.1 defaults

    ---
    @@ -4981,36 +4995,61 @@ EndSection
     
    -
    -

    7.28.2 tasks

    +
    +

    7.28.2 tasks

    ---
     # file roles/wakeup/tasks/main.yml
     
     - name: install and configure vdr-addon-acpiwakeup
    -  block:
    -    - apt:
    -      name: vdr-addon-acpiwakeup
    -      state: present
    -      
    -    - lineinfile:
    -        path: /etc/vdr/vdr-addon-acpiwakeup.conf
    -        regexp: '^ACPI_ENABLED='
    -        line: 'ACPI_ENABLED=true'
    -
    +  apt:
    +    name: vdr-addon-acpiwakeup
    +    state: present
       when: wakeup_method == "acpiwakeup"
    +      
    +- name: expand template for /etc/vdr/vdr-addon-acpiwakeup.conf
    +  template:
    +    src: templates/vdr-addon-acpiwakeup.conf.j2
    +    dest: /etc/vdr/vdr-addon-acpiwakeup.conf
    +
    +
    +
    +
    +
    +
    +

    7.28.3 templates

    +
    +
    +
    {{ ansible_managed_file | comment }}
    +
    +# Activate/deactivate ACPIWakeup with yes/no:
    +ACPI_ENABLED="{% if wakeup_method == 'acpiwakeup' %}yes{% else %}no{% endif %}"
    +
    +# How many minutes should the machine wake up before the timer starts:
    +ACPI_START_AHEAD=5
    +
    +# If you want your VDR machine to wakeup in regular intervals (i.e. for
    +# updating EPG data), specify the days of the week and the wakeup time.
    +#
    +# Days of the week for regular wakeup (not set=Disabled, 1=Monday...7=Sunday)
    +# ACPI_REGULAR_DAYS="1 2 3 4 5 6 7"
    +
    +# Wakeup time
    +#ACPI_REGULAR_TIME=01:00  # HH:MM
    +
     
    -
    -

    7.29 grub-config

    + +
    +

    7.29 grub-config

    -
    -

    7.29.1 default variables

    +
    +

    7.29.1 default variables

    system:
    @@ -5022,8 +5061,8 @@ EndSection
     
    -
    -

    7.29.2 tasks

    +
    +

    7.29.2 tasks

    ---
    @@ -5048,8 +5087,8 @@ EndSection
     
    -
    -

    7.29.3 templates

    +
    +

    7.29.3 templates

    #!/bin/sh
    @@ -5072,8 +5111,8 @@ menuentry "PowerOff" {
     
    -
    -

    7.29.4 handlers

    +
    +

    7.29.4 handlers

    ---
    @@ -5091,15 +5130,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.
    @@ -5155,11 +5194,11 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
         acpi_power_modes: True
     - debug:
         var: usb
    -- debug
    +- debug:
         var: pci
    -- debug
    +- debug:
         var: modules
    -- debug
    +- debug:
         var: gpus
     '''
     
    @@ -5266,8 +5305,8 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
     
    -
    -

    8.2 satip_facts.py

    +
    +

    8.2 satip_facts.py

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

    8.3 xrandr_facts.py

    +
    +

    8.3 xrandr_facts.py

    • [ ] support multiple screens (-d :0.0 .. :0.n)
    • @@ -5671,8 +5710,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
    @@ -5737,7 +5776,7 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
     

    Autor: Alexander Grothe <seahawk1986@gmx.de>

    -

    Created: 2017-11-20 Mo 09:44

    +

    Created: 2017-11-21 Di 11:18

    Validate

    diff --git a/Manual.org b/Manual.org index 68f912d..1eb7567 100644 --- a/Manual.org +++ b/Manual.org @@ -557,7 +557,19 @@ APT::Install-Suggests "0"; modules: True gpus: True acpi_power_modes: True - + +- name: set variable nvidia_detected + set_fact: + nvidia_detected: 'true if {{ gpus | selectattr("VendorName", "nvidia") | list }}' else false + +- name: set variable intel_detected + set_fact: + intel_detected: 'true if {{ gpus | selectattr("VendorName", "intel") | list }}' else false + +- name: set variable amd_detected + set_fact: + amd_detected: 'true if {{ gpus | selectattr("VendorName", "amd") | list }}' else false + - debug: var: '{{ item }}' verbosity: 1 @@ -567,6 +579,9 @@ APT::Install-Suggests "0"; - gpus - modules - acpi_power_modes + - nvidia_detected + - intel_detected + - amd_detected #+END_SRC ** vdr *** tasks @@ -1051,7 +1066,10 @@ In order to achive a clean shutdown of the session, ~x@t7.service~ is set as a d *** TODO automatic X-server configuration :noexport: - [X] detect connected display - [X] read EDID from displays -- [ ] create a xorg.conf for nvidia/intel/amd gpus +create a xorg.conf for +- [X] nvidia +- [ ] intel +- [ ] amd gpus **** HOLD Nvidia-GPUs:read EDID: @@ -1448,31 +1466,31 @@ b'\xde\xad\xbe\xef' dest: '{{ item }}' state: directory with_items: - - /etc/systemd/system/x@.service.d/ - - /etc/systemd/system/vdr.service.d/ - - '/etc/systemd/system/user@{{ vdr.uid }}.service.d/' + - "/etc/systemd/system/x@.service.d/" + - "/etc/systemd/system/vdr.service.d/" + - "/etc/systemd/system/user@{{ vdr.uid }}.service.d/" -- name: add dependency to X-server for vdr.service using a drop-in +- name: systemd-drop-in: add dependency to X-server for vdr.service template: src: templates/vdr-xorg.conf dest: /etc/systemd/system/vdr.service.d/vdr-xorg.conf -- name: start x@.service before xlogin@.service +- name: systemd-drop-in: start x@.service before xlogin@.service template: src: templates/x@service.d/xlogin.conf.j2 dest: /etc/systemd/system/x@.service.d/xlogin.conf -- name: load environment file for vdr.service +- name: systemd-drop-in: load environment file for vdr.service template: src: templates/systemd/vdr-environ.j2 dest: /etc/systemd/system/vdr.service.d/load-environ.conf -- name: user@{{ vdr.uid }}.service depends on x@vt7.service +- name: systemd-drop-in: user@{{ vdr.uid }}.service depends on x@vt7.service template: src: templates/user@666.service.d/x-dependency.conf.j2 dest: '/etc/systemd/system/user@{{ vdr.uid }}.service.d/x-dependency.conf' -- name: start softhddevice detached and set audio to pulseaudio +- name: vdr-config: start softhddevice detached and set audio to pulseaudio lineinfile: path: /etc/vdr/conf.avail/softhddevice.conf line: '{{ item }}' @@ -1480,7 +1498,7 @@ b'\xde\xad\xbe\xef' - '-D' # - '-a pulse' # do we need this with our existing asound.conf? -- name: set a login shell for the user vdr +- name: add a login shell for the user vdr user: name: '{{ vdr.user }}' shell: '/bin/bash' @@ -1547,6 +1565,10 @@ b'\xde\xad\xbe\xef' name: x@vt7.service state: stopped +- name: "wait a little bit before starting x-verbose@vt7.service (needed?)" + wait_for: + timeout: 3 + - name: "start x-verbose@.service" systemd: name: "x-verbose@vt7.service" @@ -1576,17 +1598,26 @@ b'\xde\xad\xbe\xef' enabled: false masked: true +- name: "wait a little bit, so X has some time to shut down (needed?)" + wait_for: + timeout: 3 + # TODO: expand template for xorg.conf (or snippets) # with respect for the available graphics card driver # nvidia, noveau, intel, radeon -- name: create xorg.conf (for nvidia driver) - template: - src: templates/xorg.conf.j2 - dest: /etc/X11/xorg.conf - backup: yes -#+END_SRC -#+BEGIN_SRC yaml :tangle roles/yavdr-xorg/tasks/desktop-session.yml :mkdirp yes :padline no +- name: nvidia related config + block: + - name: create xorg.conf (for nvidia driver) + template: + src: templates/xorg.conf.j2 + dest: /etc/X11/xorg.conf + backup: yes + when: + - nvidia_detected + - #+END_SRC + +,#+BEGIN_SRC yaml :tangle roles/yavdr-xorg/tasks/desktop-session.yml :mkdirp yes :padline no --- # file: roles/yavdr-xorg/tasks/desktop-session.yml @@ -3726,11 +3757,11 @@ EXAMPLES = ''' acpi_power_modes: True - debug: var: usb -- debug +- debug: var: pci -- debug +- debug: var: modules -- debug +- debug: var: gpus ''' diff --git a/library/hardware_facts.py b/library/hardware_facts.py index e7770c7..e1a7788 100755 --- a/library/hardware_facts.py +++ b/library/hardware_facts.py @@ -52,11 +52,11 @@ EXAMPLES = ''' acpi_power_modes: True - debug: var: usb -- debug +- debug: var: pci -- debug +- debug: var: modules -- debug +- debug: var: gpus ''' diff --git a/roles/collect-facts/tasks/main.yml b/roles/collect-facts/tasks/main.yml index cc4512a..5d695d8 100644 --- a/roles/collect-facts/tasks/main.yml +++ b/roles/collect-facts/tasks/main.yml @@ -5,7 +5,19 @@ modules: True gpus: True acpi_power_modes: True - + +- name: set variable nvidia_detected + set_fact: + nvidia_detected: 'true if {{ gpus | selectattr("VendorName", "nvidia") | list }}' else false + +- name: set variable intel_detected + set_fact: + intel_detected: 'true if {{ gpus | selectattr("VendorName", "intel") | list }}' else false + +- name: set variable amd_detected + set_fact: + amd_detected: 'true if {{ gpus | selectattr("VendorName", "amd") | list }}' else false + - debug: var: '{{ item }}' verbosity: 1 @@ -15,3 +27,6 @@ - gpus - modules - acpi_power_modes + - nvidia_detected + - intel_detected + - amd_detected diff --git a/roles/yavdr-xorg/tasks/detect-xorg.yml b/roles/yavdr-xorg/tasks/detect-xorg.yml index 863f3df..b24c6b1 100644 --- a/roles/yavdr-xorg/tasks/detect-xorg.yml +++ b/roles/yavdr-xorg/tasks/detect-xorg.yml @@ -28,6 +28,10 @@ name: x@vt7.service state: stopped +- name: "wait a little bit before starting x-verbose@vt7.service (needed?)" + wait_for: + timeout: 3 + - name: "start x-verbose@.service" systemd: name: "x-verbose@vt7.service" @@ -57,11 +61,116 @@ enabled: false masked: true +- name: "wait a little bit, so X has some time to shut down (needed?)" + wait_for: + timeout: 3 + # TODO: expand template for xorg.conf (or snippets) # with respect for the available graphics card driver # nvidia, noveau, intel, radeon -- name: create xorg.conf (for nvidia driver) + +- name: nvidia related config + block: + - name: create xorg.conf (for nvidia driver) + template: + src: templates/xorg.conf.j2 + dest: /etc/X11/xorg.conf + backup: yes + when: + - nvidia_detected + - #+END_SRC + +#+BEGIN_SRC yaml :tangle roles/yavdr-xorg/tasks/desktop-session.yml :mkdirp yes :padline no +--- +# file: roles/yavdr-xorg/tasks/desktop-session.yml + +- name: create folders for user configuration files + file: + state: directory + dest: '{{ item }}' + mode: '0775' + owner: '{{ vdr.user }}' + group: '{{ vdr.group }}' + with_items: + - '{{ vdr.home }}/.config/systemd/user' + - '{{ vdr.home }}/.config/openbox' + - '{{ vdr.home }}/.config/pulse' + +- name: expand template for .xinitrc for vdr user template: - src: templates/xorg.conf.j2 - dest: /etc/X11/xorg.conf - backup: yes + src: 'templates/.xinitrc.j2' + dest: '{{ vdr.home }}/.xinitrc' + mode: 0755 + owner: '{{ vdr.user }}' + group: '{{ vdr.group }}' + +- name: expand template for openbox autostart + template: + src: 'templates/openbox/autostart.j2' + dest: '{{ vdr.home }}/.config/openbox/autostart' + mode: 0755 + owner: '{{ vdr.user }}' + group: '{{ vdr.group }}' + +- name: expand rc.xml for openbox + template: + src: 'templates/openbox/rc.xml.j2' + dest: '{{ vdr.home }}/.config/openbox/rc.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' + dest: '{{ vdr.home }}/.config/systemd/user/yavdr-desktop.target' + mode: 0644 + owner: '{{ vdr.user }}' + group: '{{ vdr.group }}' + +- name: disable pulseaudio autospawning + lineinfile: + path: '{{ vdr.home }}/.config/pulse/client.conf' + line: 'autospawn = no' + create: yes + state: present + owner: '{{ vdr.user }}' + group: '{{ vdr.group }}' + +- name: create tmux.service for the session + template: + src: roles/yavdr-xorg/templates/systemd/user/tmux.service.j2 + dest: '{{ vdr.home }}/.config/systemd/user/tmux.service' + +- name: create wm-exit.service for the session + template: + src: roles/yavdr-xorg/templates/systemd/user/wm-exit.service.j2 + dest: '{{ vdr.home }}/.config/systemd/user/wm-exit.service' + +- name: create detect-second-display.service for the session + template: + src: templates/systemd/user/detect-second-display.service.j2 + dest: '{{ vdr.home }}/.config/systemd/user/detect-second-display.service' + +- name: create openbox-second.service for the session + template: + src: templates/systemd/user/openbox-second.service.j2 + dest: '{{ vdr.home }}/.config/systemd/user/openbox-second.service' + +- name: create osd2web.service for the session + template: + src: templates/systemd/user/osd2web.service.j2 + dest: '{{ vdr.home }}/.config/systemd/user/osd2web.service' + +- name: link /usr/bin/start-desktop to /var/lib/vdr/plugins/desktop/starter + file: + src: /usr/bin/start-desktop + dest: /var/lib/vdr/plugins/desktop/starter + state: link + +- name: enable and start xlogin for the vdr user + systemd: + daemon_reload: yes + name: 'xlogin@{{ vdr.user }}' + enabled: yes + state: started diff --git a/roles/yavdr-xorg/tasks/setup-xorg.yml b/roles/yavdr-xorg/tasks/setup-xorg.yml index dbd062d..4656560 100644 --- a/roles/yavdr-xorg/tasks/setup-xorg.yml +++ b/roles/yavdr-xorg/tasks/setup-xorg.yml @@ -5,31 +5,31 @@ dest: '{{ item }}' state: directory with_items: - - /etc/systemd/system/x@.service.d/ - - /etc/systemd/system/vdr.service.d/ - - '/etc/systemd/system/user@{{ vdr.uid }}.service.d/' + - "/etc/systemd/system/x@.service.d/" + - "/etc/systemd/system/vdr.service.d/" + - "/etc/systemd/system/user@{{ vdr.uid }}.service.d/" -- name: add dependency to X-server for vdr.service using a drop-in +- name: systemd-drop-in: add dependency to X-server for vdr.service template: src: templates/vdr-xorg.conf dest: /etc/systemd/system/vdr.service.d/vdr-xorg.conf -- name: start x@.service before xlogin@.service +- name: systemd-drop-in: start x@.service before xlogin@.service template: src: templates/x@service.d/xlogin.conf.j2 dest: /etc/systemd/system/x@.service.d/xlogin.conf -- name: load environment file for vdr.service +- name: systemd-drop-in: load environment file for vdr.service template: src: templates/systemd/vdr-environ.j2 dest: /etc/systemd/system/vdr.service.d/load-environ.conf -- name: user@{{ vdr.uid }}.service depends on x@vt7.service +- name: systemd-drop-in: user@{{ vdr.uid }}.service depends on x@vt7.service template: src: templates/user@666.service.d/x-dependency.conf.j2 dest: '/etc/systemd/system/user@{{ vdr.uid }}.service.d/x-dependency.conf' -- name: start softhddevice detached and set audio to pulseaudio +- name: vdr-config: start softhddevice detached and set audio to pulseaudio lineinfile: path: /etc/vdr/conf.avail/softhddevice.conf line: '{{ item }}' @@ -37,7 +37,7 @@ - '-D' # - '-a pulse' # do we need this with our existing asound.conf? -- name: set a login shell for the user vdr +- name: add a login shell for the user vdr user: name: '{{ vdr.user }}' shell: '/bin/bash'