yavdr-ansible/roles/yavdr-xorg/tasks/setup-xorg.yml

97 lines
2.8 KiB
YAML

---
# file: roles/yavdr-xorg/tasks/setup-xorg.yml
- name: create directories for systemd drop-in files
file:
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/X11/xorg.conf.d/"
- name: shell | write keyboard configuration from /etc/default/keyboard to /etc/X11/xorg.conf.d/00-keyboard.conf
shell: |
source /etc/default/keyboard
mkdir -p /etc/X11/xorg.conf.d/
cat > /etc/X11/xorg.conf.d/00-keyboard.conf <<EOF
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "${XKBLAYOUT}"
Option "XkbModel" "${XKBMODEL}"
Option "XkbVariant" ",${XKBVARIANT}"
Option "XkbOptions" "${XKBOPTIONS}"
EndSection
EOF
- 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: 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: 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: systemd-drop-in | start vdr.service after network-online.target
template:
src: templates/systemd/network-online.j2
dest: /etc/systemd/system/vdr.service.d/network-online.conf
- 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: vdr-config | start softhddevice detached and set audio to pulseaudio
lineinfile:
path: /etc/vdr/conf.avail/softhddevice.conf
line: '{{ item }}ys
with_items:
- '-D'
# - '-a pulse' # do we need this with our existing asound.conf?
- name: add a login shell for the user vdr
user:
name: '{{ vdr.user }}'
shell: '/bin/bash'
state: present
uid: '{{ vdr.uid }}'
groups: '{{ vdr.group }}'
append: yes
- name: apt | install packages for xorg
apt:
name: '{{ item }}'
state: present
with_items:
- xlogin
- xorg
- xserver-xorg-input-all
- xserver-xorg-video-all
- openbox
- python3-dbus2vdr
- python3-yavdrfrontend
- read-edid
- tmux
- vdr-plugin-desktop
- vdr-plugin-osd2web
#- yavdr-xorg
- name: apt | install desktop programs
apt:
name: '{{ item }}'
state: present
with_items:
- xterm
- firefox
- kiosk-browser