From 052b46ee34078f310f6d9cb86668176e7fb36294 Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Mon, 20 Nov 2017 09:21:22 +0100 Subject: [PATCH] put custom fact collection in own role "collect-facts" so it is not necessary to run yavdr-common every time we use an autoinstall-* role --- Manual.html | 1129 +++++++++-------- Manual.org | 145 ++- roles/autoinstall-hardware-irmp/meta/main.yml | 2 +- .../tasks/main.yml} | 2 + roles/yavdr-common/tasks/main.yml | 103 +- yavdr07-headless.yml | 1 + yavdr07.yml | 1 + 7 files changed, 743 insertions(+), 640 deletions(-) rename roles/{yavdr-common/tasks/gather_facts.yml => collect-facts/tasks/main.yml} (84%) diff --git a/Manual.html b/Manual.html index 230fcb3..366ec03 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,206 +240,217 @@ 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. @@ -472,22 +483,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. @@ -509,8 +520,8 @@ sudo ./install-yavdr.sh

-
-

3.1 Install script for local usage

+
+

3.1 Install script for local usage

if (( $EUID != 0 )); then
@@ -533,12 +544,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: @@ -553,6 +564,7 @@ The yavdr07.yml playbook sets up a fully-featured yaVDR installatio become: true roles: - yavdr-common # install and configure the basic system + - collect-facts # query system facts - autoinstall-ubuntu-drivers # use ubuntu-drivers to install proprietary dirvers # (e.g. nvidia, virtualbox) # - nvidia-387 # install very recent nvidia-387 from ppa:graphics-drivers/ppa @@ -571,6 +583,7 @@ The yavdr07.yml playbook sets up a fully-featured yaVDR installatio - 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-dvbsky-firmware # download an install required firmware files for dvbsky cards - kodi - dvd # set up packages and a udev rule to allow kodi and other players # to play and eject optical media @@ -584,8 +597,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 @@ -600,6 +613,7 @@ For a headless server installation yavdr07-headless.yml is a good c become: true roles: - yavdr-common + - collect-facts # query system facts - vdr - yavdr-network - samba-server @@ -616,8 +630,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: @@ -631,12 +645,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

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

6.2 PPAs

+
+

6.2 PPAs

branch: unstable
@@ -665,8 +679,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
@@ -693,8 +707,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
@@ -709,8 +723,8 @@ This playbook can either be used to run the installation on the localhost or any
 
-
-

6.5 NFS

+
+

6.5 NFS

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

6.6 Samba

+
+

6.6 Samba

samba:
@@ -730,8 +744,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
@@ -747,8 +761,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
@@ -762,20 +776,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
    ---
    @@ -795,19 +809,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
      ---
      @@ -833,15 +847,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. @@ -854,7 +868,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. @@ -871,7 +885,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. @@ -884,7 +898,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 @@ -898,7 +912,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. @@ -931,17 +945,31 @@ 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
      +
      +
      +
      ---
      +# file: roles/yavdr-common/tasks/main.yml 
      +
      +- name: basic installation
      +  block:
      +        - import_tasks: configure_apt.yml
      +        - import_tasks: configure_system.yml
      +        - import_tasks: create_directories.yml
      +  tags: [install]
      +
      +
      +
        -
      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: @@ -958,36 +986,9 @@ This task prevents apt to automatically install all recommended dependencies for

    -
  • Use bash instead of dash
    +
  • Set up package repositories
    -
    - name: use bash instead of dash
    -  shell: |
    -    echo "set dash/sh false" | debconf-communicate
    -    dpkg-reconfigure -f noninteractive dash
    -
    -
    -
    -
  • - -
  • create user vdr
  • -
  • Disable release-upgrade notifications
    -
    -
    -
    - name: disable release-upgrade notifications
    -  lineinfile:
    -    dest: /etc/update-manager/release-upgrades
    -    backrefs: yes
    -    state: present
    -    regexp: '^(Prompt=).*$'
    -    line: '\1never'
    -
    -
    -
    -
  • -
  • Set up package repositories
    -
    -
    - name: add PPAs
       apt_repository:
           repo: '{{ item }}'
    @@ -1003,7 +1004,34 @@ This task prevents apt to automatically install all recommended dependencies for
     
  • -
  • Install essential packages
    +
  • Use bash instead of dash
    +
    +
    +
    - name: use bash instead of dash
    +  shell: |
    +    echo "set dash/sh false" | debconf-communicate
    +    dpkg-reconfigure -f noninteractive dash
    +
    +
    +
    +
  • + +
  • create user vdr
  • +
  • Disable release-upgrade notifications
    +
    +
    +
    - name: disable release-upgrade notifications
    +  lineinfile:
    +    dest: /etc/update-manager/release-upgrades
    +    backrefs: yes
    +    state: present
    +    regexp: '^(Prompt=).*$'
    +    line: '\1never'
    +
    +
    +
    +
  • +
  • Install essential packages
    - name: apt | install basic packages
    @@ -1035,7 +1063,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
    @@ -1049,35 +1077,13 @@ This task prevents apt to automatically install all recommended dependencies for
     
  • -
  • Gather facts with custom modules
    -
    -
    -
    - name: get information about usb and pci hardware and loaded kernel modules
    -  hardware_facts:
    -    usb: True
    -    pci: True
    -    modules: True
    -    gpus: True
    -    
    -- debug:
    -    var: '{{ item }}'
    -    verbosity: 1
    -  with_items:
    -    - usb
    -    - pci
    -    - gpus
    -    - modules
    -
    -
    -
    -
  • -
  • create media directories
  • +
  • create media directories
  • -
    -

    7.3.3 templates

    +
    +

    7.3.3 templates

    {{ ansible_managed_file | comment('c') }}
    @@ -1089,17 +1095,53 @@ APT::Install-Suggests "0";
     
    -
    -

    7.4 vdr

    +
    +

    7.4 collect facts about the system with custom modules

    -
    -

    7.4.1 tasks

    +
    +

    7.4.1 tasks

      -
    1. install the basic vdr packages
      -
      +
    2. main.yml
      +
      +
      +
      - name: get information about usb and pci hardware and loaded kernel modules
      +  hardware_facts:
      +    usb: True
      +    pci: True
      +    modules: True
      +    gpus: True
      +    acpi_power_modes: True
      +    
      +- debug:
      +    var: '{{ item }}'
      +    verbosity: 1
      +  with_items:
      +    - usb
      +    - pci
      +    - gpus
      +    - modules
      +    - acpi_power_modes
      +
      +
      +
      +
    3. +
    +
    +
    +
    +

    7.5 vdr

    +
    +
    +
    +

    7.5.1 tasks

    +
    +
    +
      +
    1. install the basic vdr packages
      +
      ---
       # file: roles/vdr/tasks/main.yml
      @@ -1117,8 +1159,8 @@ APT::Install-Suggests "0";
       
    2. -
    3. Add svdrp/svdrp-disc to /etc/services
      -
      +
    4. Add svdrp/svdrp-disc to /etc/services
      +
      - name: add svdrp and svdrp-disc to /etc/services
         lineinfile:
      @@ -1132,8 +1174,8 @@ APT::Install-Suggests "0";
       
    5. -
    6. Set up the recording directory for the vdr user
      -
      +
    7. Set up the recording directory for the vdr user
      +
      - name: create vdr recdir
         file:
      @@ -1168,8 +1210,8 @@ APT::Install-Suggests "0";
       
    8. -
    9. Install additional vdr plugins
      -
      +
    10. Install additional vdr plugins
      +

      The additional plugins to install can be set in the variable {{vdr_plugins}} in the group variables

      @@ -1186,8 +1228,8 @@ 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
       systemd:
    @@ -1219,16 +1261,16 @@ The additional plugins to install can be set in the variable {{vdr_plugins
     
     
    -
    -

    7.4.2 templates

    +
    +

    7.5.2 templates

    -
    -

    7.4.3 files

    -
    +
    +

    7.5.3 files

    +
      -
    1. remote.conf
      -
      +
    2. remote.conf
      +
      LIRC.Up KEY_UP
       LIRC.Down KEY_DOWN
      @@ -1362,8 +1404,8 @@ XKeySym.Next       XF86AudioNext
       
    3. -
    4. keymacros.conf
      -
      +
    5. keymacros.conf
      +
      # Remote control key macros for VDR
       #
      @@ -1388,22 +1430,22 @@ User0     @osdteletext
       
    -
    -

    7.5 STARTED yavdr-network

    -
    +
    +

    7.6 STARTED yavdr-network

    +
    -
    -

    7.5.1 default variables

    -
    +
    +

    7.6.1 default variables

    +
    install_avahi: true
     
    -
    -

    7.5.2 tasks

    -
    +
    +

    7.6.2 tasks

    +
    ---
     # this playbook sets up network services for a yaVDR installation
    @@ -1472,16 +1514,16 @@ User0     @osdteletext
     
    -
    -

    7.6 nfs-server

    -
    +
    +

    7.7 nfs-server

    +
    -
    -

    7.6.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.6.2 tasks

    -
    +
    +

    7.7.2 tasks

    +
    ---
     
    @@ -1509,13 +1551,13 @@ User0     @osdteletext
     
    -
    -

    7.6.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 }})
       {% for name, path in media_dirs.iteritems() %}
      @@ -1525,8 +1567,8 @@ User0     @osdteletext
       
    3. -
    4. avahi services
      -
      +
    5. avahi services
      +
      <?xml version="1.0" standalone='no'?>
       <!DOCTYPE service-group SYSTEM "avahi-service.dtd">
      @@ -1546,16 +1588,16 @@ User0     @osdteletext
       
    -
    -

    7.7 STARTED yavdr-remote

    -
    +
    +

    7.8 STARTED yavdr-remote

    +
    -
    -

    7.7.1 default variables

    +
    +

    7.8.1 default variables

    -
    -

    7.7.2 tasks

    -
    +
    +

    7.8.2 tasks

    +
    ---
     # This role is used to set up the yaVDR remote control configuration.
    @@ -1605,9 +1647,9 @@ User0     @osdteletext
     
    -
    -

    7.7.3 templates

    -
    +
    +

    7.8.3 templates

    +
    {% if frontend != 'kodi' %}
     [vdr]
    @@ -1617,18 +1659,18 @@ User0     @osdteletext
     
    -
    -

    7.7.4 files

    +
    +

    7.8.4 files

    -
    -

    7.8 pulseaudio

    -
    +
    +

    7.9 pulseaudio

    +
    -
    -

    7.8.1 tasks

    -
    +
    +

    7.9.1 tasks

    +
    ---
     
    @@ -1649,9 +1691,9 @@ User0     @osdteletext
     
    -
    -

    7.8.2 templates

    -
    +
    +

    7.9.2 templates

    +
    # Use PulseAudio by default
     pcm.!default {
    @@ -1672,13 +1714,13 @@ User0     @osdteletext
     
    -
    -

    7.9 yavdr-xorg

    -
    +
    +

    7.10 yavdr-xorg

    +
    -
    -

    7.9.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.

    @@ -1705,12 +1747,12 @@ In order to achive a clean shutdown of the session, x@t7.service is

    -
    -

    7.9.2 default variables

    +
    +

    7.10.2 default variables

    -
    -

    7.9.3 tasks

    -
    +
    +

    7.10.3 tasks

    +
    ---
     # file: roles/yavdr-xorg/tasks/main.yml
    @@ -1966,15 +2008,15 @@ In order to achive a clean shutdown of the session, x@t7.service is
     
    -
    -

    7.9.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
         [Unit]
        @@ -1989,8 +2031,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]
         Before=xlogin@{{ vdr.user }}.service
        @@ -2010,8 +2052,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
        +
        # file: roles/yavdr-xorg/templates/vdr-xorg.conf
         # {{ ansible_managed_file }}
        @@ -2023,8 +2065,8 @@ In order to achive a clean shutdown of the session, x@t7.service is
         
      9. -
      10. .xinitrc
        -
        +
      11. .xinitrc
        +
        #!/bin/bash
         # {{ ansible_managed_file }}
        @@ -2033,8 +2075,8 @@ In order to achive a clean shutdown of the session, x@t7.service is
         
      12. -
      13. xorg.conf
        -
        +
      14. xorg.conf
        +
        Section "Device"
                 Identifier "nvidia"
        @@ -2360,8 +2402,8 @@ EndSection
         
    3. -
    4. vdr
      -
      +
    5. vdr
      +
      [Service]
       Environment=XDG_RUNTIME_DIR=/run/user/{{ vdr.uid }}/
      @@ -2370,10 +2412,10 @@ EndSection
       
    6. -
    7. Systemd User Session
      +
    8. Systemd User Session
        -
      1. yavdr-desktop.target
        -
        +
      2. yavdr-desktop.target
        +
        [Unit]
         Description=yaVDR Desktop
        @@ -2386,8 +2428,8 @@ EndSection
         
      3. -
      4. detect-second-display
        -
        +
      5. detect-second-display
        +
        [Unit]
         Description=Detect second DISPLAY using xrandr
        @@ -2402,8 +2444,8 @@ EndSection
         
      6. -
      7. openbox-second.service
        -
        +
      8. openbox-second.service
        +
        [Unit]
         Description=Start openbox on the second DISPLAY if it exists
        @@ -2423,8 +2465,8 @@ EndSection
         
      9. -
      10. osd2web.service
        -
        +
      11. osd2web.service
        +
        [Unit]
         Description=Start a kiosk browser on the second DISPLAY if it exists
        @@ -2444,8 +2486,8 @@ EndSection
         
      12. -
      13. tmux.service
        -
        +
      14. tmux.service
        +
        [Unit]
         Description=Start tmux in detached session
        @@ -2463,8 +2505,8 @@ EndSection
         
      15. -
      16. wm-exit.service
        -
        +
      17. wm-exit.service
        +
        [Unit]
         Description=exit window manager gracefully
        @@ -2482,10 +2524,10 @@ EndSection
         
    9. -
    10. openbox
      +
    11. openbox
        -
      1. autostart
        -
        +
      2. autostart
        +
        # forward environment variables to an environment file and the systemd user session
         env | grep "DISPLAY\|DBUS_SESSION_BUS_ADDRESS\|XDG_RUNTIME_DIR" > ~/.session-env
        @@ -2518,8 +2560,8 @@ systemctl --user isolate yavdr-desktop.target
         
      3. -
      4. rc.xml
        -
        +
      5. rc.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">
        @@ -3348,13 +3390,13 @@ systemctl --user isolate yavdr-desktop.target
         
        -
        -

        7.10 samba-install

        -
        +
        +

        7.11 samba-install

        +
        -
        -

        7.10.1 tasks

        -
        +
        +

        7.11.1 tasks

        +
        ---
         # file: roles/samba-install/tasks/main.yml
        @@ -3375,13 +3417,13 @@ systemctl --user isolate yavdr-desktop.target
         
        -
        -

        7.11 samba-config

        -
        +
        +

        7.12 samba-config

        +
        -
        -

        7.11.1 tasks

        -
        +
        +

        7.12.1 tasks

        +
        ---
         # file: roles/samba-config/tasks/main.yml
        @@ -3405,15 +3447,15 @@ systemctl --user isolate yavdr-desktop.target
         
        -
        -

        7.11.2 templates

        -
        +
        +

        7.12.2 templates

        +
          -
        1. smb.conf
          +
        2. smb.conf
            -
          1. global settings
            -
            +
          2. global settings
            +
            {{ ansible_managed_file | comment }}
             
            @@ -3498,8 +3540,8 @@ systemctl --user isolate yavdr-desktop.target
             
          3. -
          4. media directories
            -
            +
          5. media directories
            +
            {% for name, path in media_dirs.iteritems() %}
             [{{ name }}]
            @@ -3520,8 +3562,8 @@ systemctl --user isolate yavdr-desktop.target
             
          6. -
          7. include custom samba exports
            -
            +
          8. include custom samba exports
            +
            include = /etc/samba/smb.conf.custom
             
            @@ -3533,16 +3575,16 @@ systemctl --user isolate yavdr-desktop.target
        -
        -

        7.12 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.12.1 TODO sundtek for Sundtek devices (local or network connection)

        -
        +
        +

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

        +

        Vendor-IDs:

        @@ -3552,15 +3594,15 @@ Vendor-IDs:
        -
        -

        7.12.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.12.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.12.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/

        @@ -3568,16 +3610,16 @@ from -

        7.13 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.13.1 tasks

        -
        +
        +

        7.14.1 tasks

        +
        ---
         # file roles/autoinstall-ubuntu-drivers/tasks/main.yml
        @@ -3599,16 +3641,16 @@ The tool ubuntu-drivers is used to install the matching driver version for nvidi
         
        -
        -

        7.14 autoinstall-satip

        -
        +
        +

        7.15 autoinstall-satip

        +

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

        -
        -

        7.14.1 tasks

        -
        +
        +

        7.15.1 tasks

        +
        ---
         # file roles/autoinstall-satip/tasks/main.yml
        @@ -3631,13 +3673,13 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.15 autoinstall-targavfd

        -
        +
        +

        7.16 autoinstall-targavfd

        +
        -
        -

        7.15.1 tasks

        -
        +
        +

        7.16.1 tasks

        +
        ---
         # file roles/autoinstall-targavfd/tasks/main.yml
        @@ -3652,13 +3694,13 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.16 autoinstall-imonlcd

        -
        +
        +

        7.17 autoinstall-imonlcd

        +
        -
        -

        7.16.1 tasks

        -
        +
        +

        7.17.1 tasks

        +
        ---
         # file roles/autoinstall-imonlcd/tasks/main.yml
        @@ -3673,13 +3715,13 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.17 autoinstall-libcecdaemon

        -
        +
        +

        7.18 autoinstall-libcecdaemon

        +
        -
        -

        7.17.1 tasks

        -
        +
        +

        7.18.1 tasks

        +
        ---
         # file roles/autoinstall-libcec-daemon/tasks/main.yml
        @@ -3694,13 +3736,13 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.18 autoinstall-pvr350

        -
        +
        +

        7.19 autoinstall-pvr350

        +
        -
        -

        7.18.1 tasks

        -
        +
        +

        7.19.1 tasks

        +
        ---
         # file roles/autoinstall-pvr350/tasks/main.yml
        @@ -3715,9 +3757,9 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.19 autoinstall-hauppauge-pvr

        -
        +
        +

        7.20 autoinstall-hauppauge-pvr

        +
        ---
         # file roles/autoinstall-hauppauge-pvr/tasks/main.yml
        @@ -3731,16 +3773,83 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-sa
         
        -
        -

        7.20 TODO autoinstall-dvbhddevice

        -
        +
        +

        7.21 autoinstall-dvbsky-firmware

        +
        +
        +
        +

        7.21.1 defaults

        +
        +
        +
        ---
        +# file roles/autoinstall-dvbsky-firmware
        +dvbsky_firmware_files: []
        +
        +
        +
        +
        +
        +

        7.21.2 tasks

        +
        +
        +
        ---
        +# file roles/autoinstall-dvbsky-firmware/tasks/main.yml
        +
        +- name: determine needed firmware files by device ids
        +  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']
        +      when:
        +        - '"1ade:3038" in pci'
        +        - ansible_distribution_version >= '15.04'  #driver only included since Kernel 3.19
        +  when:
        +    - not dvbsky_firmware_files
        +
        +- name: Download firmware for DVBSky cards and copy required files to /lib/firmware
        +  block:
        +    # download and extract firmware
        +    - unarchive:
        +        src: http://www.dvbsky.net/download/linux/dvbsky-firmware.tar.gz
        +        dest: /tmp/
        +        remote_src: yes
        +
        +    # copy firmware file
        +    - copy:
        +        src: "/tmp/dvbsky-firmware/{{ item }}"
        +        dest: /lib/firmware/
        +        owner: root
        +        group: root
        +        mode: 0644
        +      with_items: '{{ dvbsky_firmware_files }}'
        +      notify: ['Trigger Udev']
        +
        +    # Remove temporary files
        +    - file:
        +        path: /tmp/dvbsky-firmware
        +        state: absent
        +  when:
        +    - dvbsky_firmware_files is defined
        +    - dvbsky_firmware_files
        +  tags:
        +    - install
        +    - autodetect
        +    - dvbsky
        +
        +
        +
        +
        +
        +
        +

        7.22 TODO autoinstall-dvbhddevice

        +

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

        -
        -

        7.20.1 tasks

        -
        +
        +

        7.22.1 tasks

        +
        ---
         # file roles/autoinstall-dvbhddevice/tasks/main.yml
        @@ -3756,13 +3865,13 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
         
        -
        -

        7.21 autoinstall-dvbsddevice

        -
        +
        +

        7.23 autoinstall-dvbsddevice

        +
        -
        -

        7.21.1 tasks

        -
        +
        +

        7.23.1 tasks

        +
        ---
         # file roles/autoinstall-dvbsddevice/tasks/main.yml
        @@ -3777,13 +3886,13 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll
         
        -
        -

        7.22 autoinstall-hardware-irmp

        -
        +
        +

        7.24 autoinstall-hardware-irmp

        +
        -
        -

        7.22.1 tasks

        -
        +
        +

        7.24.1 sasks

        +
        ---
         # file roles/autoinstall-hardware-irmp/tasks/main.yml
        @@ -3797,24 +3906,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.23 kodi

        -
        +
        +

        7.25 kodi

        +
        -
        -

        7.23.1 tasks

        -
        +
        +

        7.25.1 tasks

        +
          -
        1. Install KODI
          +
        2. Install KODI
        -
        -

        7.23.2 templates

        -
        +
        +

        7.25.2 templates

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

          This systemd unit for the user session starts (and stops) kodi.

          @@ -3919,16 +4028,16 @@ This systemd unit for the user session starts (and stops) kodi.
        -
        -

        7.23.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.

          @@ -3997,15 +4106,15 @@ 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 -->
           <!-- The <global> section is a fall through - they will only be used if the button is not          -->
          @@ -4555,17 +4664,17 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
           
    -
    -

    7.24 dvd

    -
    +
    +

    7.26 dvd

    +
    -
    -

    7.24.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
      @@ -4605,9 +4714,9 @@ This file maps the keys defined in Lircmap.xml to actions within kodi.
       
    -
    -

    7.25 template-test

    -
    +
    +

    7.27 template-test

    +
    ---
     
    @@ -4847,13 +4956,13 @@ EndSection
     
    -
    -

    7.26 grub-config

    -
    +
    +

    7.28 grub-config

    +
    -
    -

    7.26.1 default variables

    -
    +
    +

    7.28.1 default variables

    +
    system:
       shutdown: poweroff
    @@ -4864,9 +4973,9 @@ EndSection
     
    -
    -

    7.26.2 tasks

    -
    +
    +

    7.28.2 tasks

    +
    ---
     
    @@ -4890,9 +4999,9 @@ EndSection
     
    -
    -

    7.26.3 templates

    -
    +
    +

    7.28.3 templates

    +
    #!/bin/sh
     exec tail -n +3 $0
    @@ -4914,9 +5023,9 @@ menuentry "PowerOff" {
     
    -
    -

    7.26.4 handlers

    -
    +
    +

    7.28.4 handlers

    +
    ---
     
    @@ -4933,15 +5042,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.
    @@ -4976,6 +5085,12 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
             default: True
             description:
               - return a list of devices of the pci gpu class (0x030000)
    +
    +    acpi_power_modes:
    +        required: False
    +        default: True
    +        description:
    +          - return a list of supported acpi power saving modes
     notes:
        - requres python-pyusb and python-kmodpy
     requirements: [ ]
    @@ -4988,6 +5103,7 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
         usb: True
         pci: True
         modules: True
    +    acpi_power_modes: True
     - debug:
         var: usb
     - debug
    @@ -5042,11 +5158,21 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
                            "VendorID": d.idVendor, "ProductID": d.idProduct}
         return [entry for entry in get_entries(iterator)]
     
    +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()]
    +    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),
         }
     
     
    @@ -5056,24 +5182,32 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
         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 = []
    +    acpi_power_modes = []
    +
         if collect_usb:
             usb_devices = format_device_list(usb.core.find(find_all=True))
    -    else:
    -        usb_device = []
    +
         if collect_pci:
             pci_devices = format_device_list(get_pci_devices())
    -    else:
    -        pci_devices = []
    +
         if collect_modules:
             k = kmodpy.Kmod()
             modules = [m[0] for m in k.loaded()]
    -    else:
    -        modules = []
    +
         if collect_gpus:
             gpus = format_gpu_device_list(get_pci_devices())
    -    else:
    -        gpus = []
    -    data = {'usb': usb_devices, 'pci': pci_devices, 'modules': modules, 'gpus': gpus}
    +
    +    if collect_acpi_power_modes:
    +        acpi_power_modes = list_acpi_power_modes()
    +
    +    data = {'usb': usb_devices, 'pci': pci_devices, 'modules': modules, 'gpus': gpus,
    +            'acpi_power_modes': acpi_power_modes}
         module.exit_json(changed=False, ansible_facts=data, msg=data)
     
     
    @@ -5083,8 +5217,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 = '''
    @@ -5208,8 +5342,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)
    • @@ -5488,12 +5622,15 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
    -
    -

    9 Handlers

    +
    +

    9 Handlers

    - name: Reconfigure unattended upgrades with dpkg
       command: '/usr/sbin/dpkg-reconfigure --frontend noninteractive unattended-upgrades'
    +
    +- name: Trigger Udev
    +  command: 'udevadm trigger '
       
     - name: Restart Samba
       systemd:
    @@ -5551,7 +5688,7 @@ This section contains custom modules for the yaVDR Playbooks. They are used to c
     

    Autor: Alexander Grothe <seahawk1986@gmx.de>

    -

    Created: 2017-11-13 Mo 09:55

    +

    Created: 2017-11-20 Mo 09:21

    Validate

    diff --git a/Manual.org b/Manual.org index 7e32683..3961174 100644 --- a/Manual.org +++ b/Manual.org @@ -166,6 +166,7 @@ The ~yavdr07.yml~ playbook sets up a fully-featured yaVDR installation: become: true roles: - yavdr-common # install and configure the basic system + - collect-facts # query system facts - autoinstall-ubuntu-drivers # use ubuntu-drivers to install proprietary dirvers # (e.g. nvidia, virtualbox) # - nvidia-387 # install very recent nvidia-387 from ppa:graphics-drivers/ppa @@ -207,6 +208,7 @@ For a headless server installation ~yavdr07-headless.yml~ is a good choice become: true roles: - yavdr-common + - collect-facts # query system facts - vdr - yavdr-network - samba-server @@ -413,9 +415,20 @@ vdr: *** tasks yavdr-common executes the following tasks: **** main.yml + #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :mkdirp yes :padline no +--- +# file: roles/yavdr-common/tasks/main.yml + +- name: basic installation + block: + - import_tasks: configure_apt.yml + - import_tasks: configure_system.yml + - import_tasks: create_directories.yml + tags: [install] + #+END_SRC ***** Disable default installation of recommended packages This task prevents apt to automatically install all recommended dependencies for packages: - #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :mkdirp yes :padline no + #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_apt.yml :mkdirp yes :padline no --- - name: apt | prevent automatic installation of recommended packages @@ -424,8 +437,22 @@ yavdr-common executes the following tasks: dest: /etc/apt/apt.conf.d/90norecommends #+END_SRC +***** Set up package repositories + #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_apt.yml :mkdirp yes +- name: add PPAs + apt_repository: + repo: '{{ item }}' + state: present + update_cache: yes + with_items: '{{ repositories }}' + +- name: run apt-get dist-upgrade + apt: + upgrade: dist + update_cache: yes + #+END_SRC ***** Use bash instead of dash -#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :mkdirp yes +#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_system.yml :mkdirp yes - name: use bash instead of dash shell: | echo "set dash/sh false" | debconf-communicate @@ -433,7 +460,7 @@ yavdr-common executes the following tasks: #+END_SRC ***** create user vdr -#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :exports none :mkdirp yes +#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_system.yml :exports none :mkdirp yes - name: create vdr group group: gid: '{{ vdr.gid }}' @@ -452,7 +479,7 @@ yavdr-common executes the following tasks: #+END_SRC ***** Disable release-upgrade notifications -#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :mkdirp yes +#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_system.yml :mkdirp yes - name: disable release-upgrade notifications lineinfile: dest: /etc/update-manager/release-upgrades @@ -461,22 +488,8 @@ yavdr-common executes the following tasks: regexp: '^(Prompt=).*$' line: '\1never' #+END_SRC -***** Set up package repositories - #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :mkdirp yes -- name: add PPAs - apt_repository: - repo: '{{ item }}' - state: present - update_cache: yes - with_items: '{{ repositories }}' - -- name: run apt-get dist-upgrade - apt: - upgrade: dist - update_cache: yes - #+END_SRC ***** Install essential packages - #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :mkdirp yes + #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_system.yml :mkdirp yes - name: apt | install basic packages apt: name: '{{ item }}' @@ -504,7 +517,7 @@ yavdr-common executes the following tasks: #+END_SRC ***** Install additional packages (user defined) -#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml +#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/configure_system.yml - name: apt | install extra packages apt: name: '{{ item }}' @@ -513,26 +526,8 @@ yavdr-common executes the following tasks: with_items: '{{ extra_packages }}' #+END_SRC -***** Gather facts with custom modules -#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :mkdirp yes -- name: get information about usb and pci hardware and loaded kernel modules - hardware_facts: - usb: True - pci: True - modules: True - gpus: True - -- debug: - var: '{{ item }}' - verbosity: 1 - with_items: - - usb - - pci - - gpus - - modules -#+END_SRC ***** create media directories -#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :exports none :mkdirp yes +#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/create_directories.yml :exports none :mkdirp yes - name: create media directories file: dest: '{{ item.value }}' @@ -549,6 +544,28 @@ yavdr-common executes the following tasks: APT::Install-Recommends "0"; APT::Install-Suggests "0"; #+END_SRC +** collect facts about the system with custom modules +*** tasks +***** main.yml +#+BEGIN_SRC yaml :tangle roles/collect-facts/tasks/main.yml :mkdirp yes +- name: get information about usb and pci hardware and loaded kernel modules + hardware_facts: + usb: True + pci: True + modules: True + gpus: True + acpi_power_modes: True + +- debug: + var: '{{ item }}' + verbosity: 1 + with_items: + - usb + - pci + - gpus + - modules + - acpi_power_modes +#+END_SRC ** vdr *** tasks **** install the basic vdr packages @@ -3226,6 +3243,11 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-satip when: '"0070:4000" in pci or "4444:0016" in pci' notify: [ 'Restart VDR' ] #+END_SRC +** autoinstall-dvbsky-firmware +*** defaults +#+INCLUDE: "roles/autoinstall-dvbsky-firmware/defaults/main.yml" src yaml +*** tasks +#+INCLUDE: "roles/autoinstall-dvbsky-firmware/tasks/main.yml" src yaml ** TODO autoinstall-dvbhddevice Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware sollte in yavdr-firmware stecken *** tasks @@ -3253,7 +3275,7 @@ Problem: woher kommt der Treiber (AFAIK noch nicht im Kernel)? Die Firmware soll notify: [ 'Restart VDR' ] #+END_SRC ** autoinstall-hardware-irmp -*** tasks +*** sasks #+BEGIN_SRC yaml :tangle roles/autoinstall-hardware-irmp/tasks/main.yml :padline no --- # file roles/autoinstall-hardware-irmp/tasks/main.yml @@ -3634,6 +3656,12 @@ DOCUMENTATION = ''' default: True description: - return a list of devices of the pci gpu class (0x030000) + + acpi_power_modes: + required: False + default: True + description: + - return a list of supported acpi power saving modes notes: - requres python-pyusb and python-kmodpy requirements: [ ] @@ -3646,6 +3674,7 @@ EXAMPLES = ''' usb: True pci: True modules: True + acpi_power_modes: True - debug: var: usb - debug @@ -3700,11 +3729,21 @@ def format_gpu_device_list(iterator): "VendorID": d.idVendor, "ProductID": d.idProduct} return [entry for entry in get_entries(iterator)] +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()] + 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), } @@ -3714,24 +3753,32 @@ def main(): 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 = [] + acpi_power_modes = [] + if collect_usb: usb_devices = format_device_list(usb.core.find(find_all=True)) - else: - usb_device = [] + if collect_pci: pci_devices = format_device_list(get_pci_devices()) - else: - pci_devices = [] + if collect_modules: k = kmodpy.Kmod() modules = [m[0] for m in k.loaded()] - else: - modules = [] + if collect_gpus: gpus = format_gpu_device_list(get_pci_devices()) - else: - gpus = [] - data = {'usb': usb_devices, 'pci': pci_devices, 'modules': modules, 'gpus': gpus} + + if collect_acpi_power_modes: + acpi_power_modes = list_acpi_power_modes() + + data = {'usb': usb_devices, 'pci': pci_devices, 'modules': modules, 'gpus': gpus, + 'acpi_power_modes': acpi_power_modes} module.exit_json(changed=False, ansible_facts=data, msg=data) diff --git a/roles/autoinstall-hardware-irmp/meta/main.yml b/roles/autoinstall-hardware-irmp/meta/main.yml index e2987ff..b5c6a7e 100644 --- a/roles/autoinstall-hardware-irmp/meta/main.yml +++ b/roles/autoinstall-hardware-irmp/meta/main.yml @@ -1,3 +1,3 @@ --- dependencies: - - { role: yavdr-common } + - { role: collect-facts } diff --git a/roles/yavdr-common/tasks/gather_facts.yml b/roles/collect-facts/tasks/main.yml similarity index 84% rename from roles/yavdr-common/tasks/gather_facts.yml rename to roles/collect-facts/tasks/main.yml index 5c0ebab..cc4512a 100644 --- a/roles/yavdr-common/tasks/gather_facts.yml +++ b/roles/collect-facts/tasks/main.yml @@ -4,6 +4,7 @@ pci: True modules: True gpus: True + acpi_power_modes: True - debug: var: '{{ item }}' @@ -13,3 +14,4 @@ - pci - gpus - modules + - acpi_power_modes diff --git a/roles/yavdr-common/tasks/main.yml b/roles/yavdr-common/tasks/main.yml index ef1acb0..e245cbf 100644 --- a/roles/yavdr-common/tasks/main.yml +++ b/roles/yavdr-common/tasks/main.yml @@ -1,97 +1,12 @@ --- +# file: roles/yavdr-common/tasks/main.yml -- name: apt | prevent automatic installation of recommended packages - template: - src: templates/90-norecommends.j2 - dest: /etc/apt/apt.conf.d/90norecommends -- 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 }}' - state: present - name: '{{ vdr.group }}' +- name: basic installation + block: + - import_tasks: configure_apt.yml + - import_tasks: configure_system.yml + - import_tasks: create_directories.yml + tags: [install] -- name: create vdr user - user: - name: '{{ vdr.user }}' - group: '{{ vdr.group }}' - uid: '{{ vdr.uid }}' - home: '{{ vdr.home }}' - shell: '/bin/bash' - state: present - append: true -- name: disable release-upgrade notifications - lineinfile: - dest: /etc/update-manager/release-upgrades - backrefs: yes - state: present - regexp: '^(Prompt=).*$' - line: '\1never' -- name: add PPAs - apt_repository: - repo: '{{ item }}' - state: present - update_cache: yes - with_items: '{{ repositories }}' - -- name: run apt-get dist-upgrade - apt: - upgrade: dist - update_cache: yes -- name: apt | install basic packages - apt: - name: '{{ item }}' - state: present - install_recommends: no - with_items: - - anacron - - acl - - at - - bash-completion - #- biosdevname # caution: may change device names after a minimal installation! - - debconf-utils - - linux-firmware - - psmisc - - python-kmodpy - - python-requests - - python-usb - - python3-usb - - software-properties-common - - ssh - - wget - - wpasupplicant - - usbutils - - xfsprogs -- name: apt | install extra packages - apt: - name: '{{ item }}' - state: present - install_recommends: no - with_items: - '{{ extra_packages }}' -- name: get information about usb and pci hardware and loaded kernel modules - hardware_facts: - usb: True - pci: True - modules: True - gpus: True - -- debug: - var: '{{ item }}' - verbosity: 1 - with_items: - - usb - - pci - - gpus - - modules -- name: create media directories - file: - dest: '{{ item.value }}' - owner: '{{ vdr.user }}' - group: '{{ vdr.group }}' - state: directory - mode: '0777' - with_dict: '{{ media_dirs }}' +- import_tasks: gather_facts.yml + tags: [install, autodetect] diff --git a/yavdr07-headless.yml b/yavdr07-headless.yml index c96538e..b2ae784 100644 --- a/yavdr07-headless.yml +++ b/yavdr07-headless.yml @@ -7,6 +7,7 @@ become: true roles: - yavdr-common + - collect-facts # query system facts - vdr - yavdr-network - samba-server diff --git a/yavdr07.yml b/yavdr07.yml index 836e1ae..6a9fa83 100644 --- a/yavdr07.yml +++ b/yavdr07.yml @@ -7,6 +7,7 @@ become: true roles: - yavdr-common # install and configure the basic system + - collect-facts # query system facts - autoinstall-ubuntu-drivers # use ubuntu-drivers to install proprietary dirvers # (e.g. nvidia, virtualbox) # - nvidia-387 # install very recent nvidia-387 from ppa:graphics-drivers/ppa