yavdr-ansible/roles/yavdr-xorg/tasks/main.yml
2017-07-16 11:21:04 +02:00

83 lines
1.8 KiB
YAML

---
# file: roles/yavdr-xorg/tasks/main.yml
# IDEA: use hooks or requirements instead
- name: Stop VDR
systemd:
name: vdr.service
state: stopped
enabled: yes
notify: ['Start VDR']
- name: create directory /etc/systemd/system/vdr.service.d/
file:
dest: /etc/systemd/system/vdr.service.d/
state: directory
- name: add dependency to X-server for vdr.service using a drop-in
template:
src: templates/vdr-xorg.conf
dest: /etc/systemd/system/vdr.service.d/vdr-xorg.conf
- name: load environment file for vdr.service
template:
src: templates/systemd/vdr-environ.j2
dest: /etc/systemd/system/vdr.service.d/load-environ.conf
- name: set 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: install packages for xorg
apt:
name: '{{ item }}'
state: present
with_items:
- xorg
- xserver-xorg-video-all
- xserver-xorg-input-all
- xlogin
- xterm
- openbox
- tmux
- kiosk-browser
- read-edid
#- yavdr-xorg
- name: Stop xlogin
systemd:
name: xlogin@vdr.service
state: stopped
enabled: yes
- name: Stop x
systemd:
name: x@vt7.service
state: stopped
- include: detect-xorg.yml
# 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
- include: desktop-session.yml
- name: enable and start xlogin for the user vdr
systemd:
daemon_reload: yes
name: 'xlogin@{{ vdr.user }}'
enabled: yes
state: started