Fix quoting for hardware detection conditions

This commit is contained in:
Alexander Grothe 2017-08-31 15:55:04 +02:00
parent e5a4394129
commit 1a10952345
12 changed files with 42 additions and 48 deletions

View File

@ -1,8 +1,5 @@
# -*- mode: org; -*- # -*- mode: org; -*-
* Settings for Export * Settings for Export :noexport:
# Local Variables:
# org-src-preserve-indentation: t
# End:
:DOCUMENT_OPTIONS: :DOCUMENT_OPTIONS:
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/htmlize.css"/> #+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/htmlize.css"/>
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/readtheorg.css"/> #+HTML_HEAD: <link rel="stylesheet" type="text/css" href="http://www.pirilampo.org/styles/readtheorg/css/readtheorg.css"/>
@ -18,7 +15,6 @@
#+PROPERTY: header-args :mkdirp yes :padline no #+PROPERTY: header-args :mkdirp yes :padline no
#+TITLE: Ansible Playbooks for yaVDR 0.7 #+TITLE: Ansible Playbooks for yaVDR 0.7
#+Author: Alexander Grothe <seahawk1986@gmx.de> #+Author: Alexander Grothe <seahawk1986@gmx.de>
# #+LATEX_CLASS: article
#+STARTUP: latexpreview #+STARTUP: latexpreview
#+LATEX_CLASS_OPTIONS: [ngerman,a4paper,locale=DE,koma,palatino,DIV=15,BCOR=15mm] #+LATEX_CLASS_OPTIONS: [ngerman,a4paper,locale=DE,koma,palatino,DIV=15,BCOR=15mm]
#+LATEX_HEADER: \usepackage[margin=3.0cm]{geometry} #+LATEX_HEADER: \usepackage[margin=3.0cm]{geometry}
@ -28,10 +24,14 @@
#+LATEX_HEADER: \usepackage{rotating} #+LATEX_HEADER: \usepackage{rotating}
#+LATEX_HEADER: \usepackage{paralist} #+LATEX_HEADER: \usepackage{paralist}
#+LATEX_HEADER: \usepackage{booktabs} #+LATEX_HEADER: \usepackage{booktabs}
#+LATEX_HEADER: \usepackage{titlesec}
#+LATEX_HEADER: \usepackage[locale=DE,seperr,repeatunits=true,trapambigerr=false,tophrase={{ bis }}]{siunitx} #+LATEX_HEADER: \usepackage[locale=DE,seperr,repeatunits=true,trapambigerr=false,tophrase={{ bis }}]{siunitx}
#+LATEX_HEADER: \usemintedstyle{lovelace} #+LATEX_HEADER: \usemintedstyle{lovelace}
#+LATEX_HEADER: \defaultfontfeatures{Ligatures=TeX} #+LATEX: \defaultfontfeatures{Ligatures=TeX}
#+LATEX_HEADER: \usepackage{parskip}
# #+LATEX_HEADER_EXTRA: # #+LATEX_HEADER_EXTRA:
#+EXCLUDE_TAGS: noexport
:END: :END:
* User Stories * User Stories
@ -812,7 +812,7 @@ install_avahi: true
with_items: with_items:
- avahi-daemon - avahi-daemon
- avahi-utils - avahi-utils
- biosdevname #- biosdevname # caution: this may change device names after a minimal installation!
- ethtool - ethtool
- nfs-common - nfs-common
- vdr-addon-avahi-linker - vdr-addon-avahi-linker
@ -1009,26 +1009,21 @@ ctl.!default {
#+END_SRC #+END_SRC
** yavdr-xorg ** yavdr-xorg
*** About the GUI session *** About the GUI session
**** Starting the X-server and the 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.
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.
~x@vt7.service~ is started automatically as a dependency of ~xlogin@vdr.service~ and starts the X-server. ~x@vt7.service~ is started automatically as a dependency of ~xlogin@vdr.service~ and starts the X-server. ~xlogin@vdr.service~ also starts a systemd user session using ~user@666.service~.
~xlogin@vdr.service~ also starts a systemd user session using ~user@666.service~.
To prevent stopping the X-server when vdr is running, additional dependencies are set up - see the drop-in rules created in ~/etc/systemd/system/vdr.service.d/~. To prevent stopping the X-server when vdr is running, additional dependencies are set up - see the drop-in rules created in ~/etc/systemd/system/vdr.service.d/~.
Basic Services like the session DBus, pulseaudio etc. are started for the ~default.target~ of the session. Basic Services like the session DBus, pulseaudio etc. are started for the ~default.target~ of the session.
**** openbox autostart and yavdr-desktop.target
The openbox autostart script is used to update the systemd session with the needed session variables. It creates a file =~/.session-env= which is used as an environment file by ~vdr.service~ (so the vdr knows the *DISPLAY* and can access pulseaudio). The openbox autostart script is used to update the systemd session with the needed session variables. It creates a file =~/.session-env= which is used as an environment file by ~vdr.service~ (so the vdr knows the *DISPLAY* and can access pulseaudio).
The autostart script then enables all services to be pulled in by yavdr-desktop.target. As the last step ~yavdr-desktop.target~ is startet, which results in staring ~yavdr-frontend.service~ and additional Units for a second display (openbox and a browser for osd2eb, if available). The autostart script then enables all services to be pulled in by yavdr-desktop.target. As the last step ~yavdr-desktop.target~ is startet, which results in staring ~yavdr-frontend.service~ and additional Units for a second display (openbox and a browser for osd2eb, if available).
**** yavdr-frontend # TODO: describe yavdr-frontend
**** Shutdown of the Session
In order to achive a clean shutdown of the session, ~x@t7.service~ is set as a dependency of ~user@666.service~ and all processes within the session must be shutdown properly when stopping ~xlogin@vdr.service~. In order to achive a clean shutdown of the session, ~x@t7.service~ is set as a dependency of the systemd unit instance ~user@666.service~ and all processes within the session must be shutdown properly when stopping ~xlogin@vdr.service~. If systemd units are used within the user session, they must stop their process(es) successfully (you should set them up to accept expected exit codes appropriately). The window manager /openbox/ is started using the =~/.xinitrc= and stopped using the systemd unit ~exit-wm.service~ (which runs on stopping the jobs pulled in by the ~default.target~ of the session).
If systemd units are used within the user session, they must stop their process(es) successfully (you should set them up to accept expected exit codes appropriately). The window manager /openbox/ is started using the =~/.xinitrc= and stopped using the systemd unit ~exit-wm.service~ (which runs on stopping the jobs pulled in by the ~default.target~ of the session). *** TODO automatic X-server configuration :noexport:
*** TODO automatic X-server configuration
- [X] detect connected display - [X] detect connected display
- [X] read EDID from displays - [X] read EDID from displays
- [ ] create a xorg.conf for nvidia/intel/amd gpus - [ ] create a xorg.conf for nvidia/intel/amd gpus
@ -1411,7 +1406,7 @@ b'\xde\xad\xbe\xef'
#+END_SRC #+END_SRC
*** default variables *** default variables
*** tasks *** tasks
**** main
#+BEGIN_SRC yaml :tangle roles/yavdr-xorg/tasks/main.yml :mkdirp yes :padline no #+BEGIN_SRC yaml :tangle roles/yavdr-xorg/tasks/main.yml :mkdirp yes :padline no
--- ---
# file: roles/yavdr-xorg/tasks/main.yml # file: roles/yavdr-xorg/tasks/main.yml
@ -1419,8 +1414,10 @@ b'\xde\xad\xbe\xef'
- include: detect-xorg.yml tags=xorg:detect,install - include: detect-xorg.yml tags=xorg:detect,install
- include: desktop-session.yml tags=install,update - include: desktop-session.yml tags=install,update
#+END_SRC #+END_SRC
**** setup-xorg
#+BEGIN_SRC yaml :tangle roles/yavdr-xorg/tasks/setup-xorg.yml :mkdirp yes :padline no #+BEGIN_SRC yaml :tangle roles/yavdr-xorg/tasks/setup-xorg.yml :mkdirp yes :padline no
---
# file: roles/yavdr-xorg/tasks/setup-xorg.yml
- name: create directories for systemd drop-in files - name: create directories for systemd drop-in files
file: file:
dest: '{{ item }}' dest: '{{ item }}'
@ -1486,7 +1483,7 @@ b'\xde\xad\xbe\xef'
- vdr-plugin-desktop - vdr-plugin-desktop
#- yavdr-xorg #- yavdr-xorg
#+END_SRC #+END_SRC
**** detect-xorg
#+BEGIN_SRC yaml :tangle roles/yavdr-xorg/tasks/detect-xorg.yml :mkdirp yes :padline no #+BEGIN_SRC yaml :tangle roles/yavdr-xorg/tasks/detect-xorg.yml :mkdirp yes :padline no
--- ---
# file: roles/yavdr-xorg/tasks/detect-xorg.yml # file: roles/yavdr-xorg/tasks/detect-xorg.yml
@ -1508,7 +1505,6 @@ b'\xde\xad\xbe\xef'
enabled: yes enabled: yes
notify: ['Start VDR'] notify: ['Start VDR']
- name: Stop xlogin - name: Stop xlogin
systemd: systemd:
name: 'xlogin@{{ vdr.user }}.service' name: 'xlogin@{{ vdr.user }}.service'
@ -1519,7 +1515,6 @@ b'\xde\xad\xbe\xef'
name: x@vt7.service name: x@vt7.service
state: stopped state: stopped
- name: "start x-verbose@.service" - name: "start x-verbose@.service"
systemd: systemd:
name: "x-verbose@vt7.service" name: "x-verbose@vt7.service"
@ -1549,18 +1544,16 @@ b'\xde\xad\xbe\xef'
enabled: false enabled: false
masked: true masked: true
# IDEA: use hooks or requirements instead
# TODO: expand template for xorg.conf (or snippets) # TODO: expand template for xorg.conf (or snippets)
# with respect for the available graphics card driver # with respect for the available graphics card driver
# nvidia, noveau, intel, radeon # nvidia, noveau, intel, radeon
- name: create xorg.conf (for nvidia driver) - name: create xorg.conf (for nvidia driver)
template: template:
src: templates/xorg.conf.j2 src: templates/xorg.conf.j2
dest: /etc/X11/xorg.conf dest: /etc/X11/xorg.conf
backup: yes backup: yes
#+END_SRC #+END_SRC
**** desktop-session
#+BEGIN_SRC yaml :tangle roles/yavdr-xorg/tasks/desktop-session.yml :mkdirp yes :padline no #+BEGIN_SRC yaml :tangle roles/yavdr-xorg/tasks/desktop-session.yml :mkdirp yes :padline no
--- ---
# file: roles/yavdr-xorg/tasks/desktop-session.yml # file: roles/yavdr-xorg/tasks/desktop-session.yml
@ -1660,6 +1653,8 @@ b'\xde\xad\xbe\xef'
**** xorg **** xorg
***** x-verbose@.service ***** x-verbose@.service
#+BEGIN_SRC conf :tangle "roles/yavdr-xorg/templates/systemd/system/x-verbose@.service.j2" :padline no #+BEGIN_SRC conf :tangle "roles/yavdr-xorg/templates/systemd/system/x-verbose@.service.j2" :padline no
---
# file: roles/yavdr-xorg/templates/systemd/system/x-verbose@.service.j2
[Unit] [Unit]
Description=X with verbose logging on %I Description=X with verbose logging on %I
Wants=graphical.target Wants=graphical.target
@ -1689,12 +1684,12 @@ KillMode=mixed
#+BEGIN_SRC conf :tangle roles/yavdr-xorg/templates/vdr-xorg.conf :mkdirp yes :padline no #+BEGIN_SRC conf :tangle roles/yavdr-xorg/templates/vdr-xorg.conf :mkdirp yes :padline no
# file: roles/yavdr-xorg/templates/vdr-xorg.conf # file: roles/yavdr-xorg/templates/vdr-xorg.conf
# {{ ansible_managed_file }} # {{ ansible_managed_file }}
[Unit] [Unit]
After=x@vt7.service After=x@vt7.service
Wants=x@vt7.service Wants=x@vt7.service
#BindsTo=x@vt7.service #BindsTo=x@vt7.service
#+END_SRC #+END_SRC
***** .xinitrc
#+BEGIN_SRC shell :tangle roles/yavdr-xorg/templates/.xinitrc.j2 :mkdirp yes :padline no #+BEGIN_SRC shell :tangle roles/yavdr-xorg/templates/.xinitrc.j2 :mkdirp yes :padline no
#!/bin/bash #!/bin/bash
# {{ ansible_managed_file }} # {{ ansible_managed_file }}
@ -3170,7 +3165,7 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-satip
apt: apt:
name: vdr-plugin-targavfd name: vdr-plugin-targavfd
when: when:
- '"19c2:6a11" in usb' - "19c2:6a11" in usb
notify: [ 'Restart VDR' ] notify: [ 'Restart VDR' ]
#+END_SRC #+END_SRC
** autoinstall-imonlcd ** autoinstall-imonlcd
@ -3183,8 +3178,8 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-satip
apt: apt:
name: vdr-plugin-imonlcd name: vdr-plugin-imonlcd
when: when:
- '"15c2:0038" in usb' - "15c2:0038" in usb
- '"15c2:ffdc" in usb' - "15c2:ffdc" in usb
notify: [ 'Restart VDR' ] notify: [ 'Restart VDR' ]
#+END_SRC #+END_SRC
** autoinstall-libcecdaemon ** autoinstall-libcecdaemon
@ -3197,7 +3192,7 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-satip
apt: apt:
name: libcec-daemon name: libcec-daemon
when: when:
- '"2548:1002" in usb' - "2548:1002" in usb
#+END_SRC #+END_SRC
** autoinstall-pvr350 ** autoinstall-pvr350
*** tasks *** tasks
@ -3209,7 +3204,7 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-satip
apt: apt:
name: vdr-plugin-pvr350 name: vdr-plugin-pvr350
when: when:
- '"0070:4000" in pci' - "0070:4000" in pci
notify: [ 'Restart VDR' ] notify: [ 'Restart VDR' ]
#+END_SRC #+END_SRC
** autoinstall-hauppauge-pvr ** autoinstall-hauppauge-pvr
@ -3221,8 +3216,8 @@ If a Sat>IP Server responds to a discovery request, the package vdr-plugin-satip
apt: apt:
name: vdr-plugin-pvrinput name: vdr-plugin-pvrinput
when: when:
- '"0070:4000" in pci' - "0070:4000" in pci
- '"4444:0016" in pci' - "4444:0016" in pci
notify: [ 'Restart VDR' ] notify: [ 'Restart VDR' ]
#+END_SRC #+END_SRC
** TODO autoinstall-dvbhddevice ** TODO autoinstall-dvbhddevice

View File

@ -5,6 +5,6 @@
apt: apt:
name: vdr-plugin-pvrinput name: vdr-plugin-pvrinput
when: when:
- '"0070:4000" in pci' - "0070:4000" in pci
- '"4444:0016" in pci' - "4444:0016" in pci
notify: [ 'Restart VDR' ] notify: [ 'Restart VDR' ]

View File

@ -5,6 +5,6 @@
apt: apt:
name: vdr-plugin-imonlcd name: vdr-plugin-imonlcd
when: when:
- '"15c2:0038" in usb' - "15c2:0038" in usb
- '"15c2:ffdc" in usb' - "15c2:ffdc" in usb
notify: [ 'Restart VDR' ] notify: [ 'Restart VDR' ]

View File

@ -5,4 +5,4 @@
apt: apt:
name: libcec-daemon name: libcec-daemon
when: when:
- '"2548:1002" in usb' - "2548:1002" in usb

View File

@ -5,5 +5,5 @@
apt: apt:
name: vdr-plugin-pvr350 name: vdr-plugin-pvr350
when: when:
- '"0070:4000" in pci' - "0070:4000" in pci
notify: [ 'Restart VDR' ] notify: [ 'Restart VDR' ]

View File

@ -5,5 +5,5 @@
apt: apt:
name: vdr-plugin-targavfd name: vdr-plugin-targavfd
when: when:
- '"19c2:6a11" in usb' - "19c2:6a11" in usb
notify: [ 'Restart VDR' ] notify: [ 'Restart VDR' ]

View File

@ -8,4 +8,4 @@
with_items: with_items:
- kodi - kodi
- kodi-pvr-vdr-vnsi - kodi-pvr-vdr-vnsi
- kodi-eventclients-xbmc-send - kodi-eventclients-xbmc-send

View File

@ -9,7 +9,7 @@
with_items: with_items:
- avahi-daemon - avahi-daemon
- avahi-utils - avahi-utils
#- biosdevname # caution: may change device names after a minimal installation! #- biosdevname # caution: this may change device names after a minimal installation!
- ethtool - ethtool
- nfs-common - nfs-common
- vdr-addon-avahi-linker - vdr-addon-avahi-linker

View File

@ -18,7 +18,6 @@
enabled: yes enabled: yes
notify: ['Start VDR'] notify: ['Start VDR']
- name: Stop xlogin - name: Stop xlogin
systemd: systemd:
name: 'xlogin@{{ vdr.user }}.service' name: 'xlogin@{{ vdr.user }}.service'
@ -29,7 +28,6 @@
name: x@vt7.service name: x@vt7.service
state: stopped state: stopped
- name: "start x-verbose@.service" - name: "start x-verbose@.service"
systemd: systemd:
name: "x-verbose@vt7.service" name: "x-verbose@vt7.service"
@ -59,11 +57,9 @@
enabled: false enabled: false
masked: true masked: true
# IDEA: use hooks or requirements instead
# TODO: expand template for xorg.conf (or snippets) # TODO: expand template for xorg.conf (or snippets)
# with respect for the available graphics card driver # with respect for the available graphics card driver
# nvidia, noveau, intel, radeon # nvidia, noveau, intel, radeon
- name: create xorg.conf (for nvidia driver) - name: create xorg.conf (for nvidia driver)
template: template:
src: templates/xorg.conf.j2 src: templates/xorg.conf.j2

View File

@ -1,3 +1,5 @@
---
# file: roles/yavdr-xorg/tasks/setup-xorg.yml
- name: create directories for systemd drop-in files - name: create directories for systemd drop-in files
file: file:
dest: '{{ item }}' dest: '{{ item }}'

View File

@ -1,3 +1,5 @@
---
# file: roles/yavdr-xorg/templates/systemd/system/x-verbose@.service.j2
[Unit] [Unit]
Description=X with verbose logging on %I Description=X with verbose logging on %I
Wants=graphical.target Wants=graphical.target

View File

@ -1,6 +1,5 @@
# file: roles/yavdr-xorg/templates/vdr-xorg.conf # file: roles/yavdr-xorg/templates/vdr-xorg.conf
# {{ ansible_managed_file }} # {{ ansible_managed_file }}
[Unit] [Unit]
After=x@vt7.service After=x@vt7.service
Wants=x@vt7.service Wants=x@vt7.service