yavdr-ansible/roles/yavdr-xorg/tasks/main.yml
2017-04-10 13:24:40 +02:00

106 lines
2.4 KiB
YAML

---
# file: roles/yavdr-xorg/tasks/main.yml
- name: install packages for xorg
apt:
name: '{{ item }}'
state: present
with_items:
- xorg
- xserver-xorg-video-all
- xserver-xorg-input-all
- xlogin
- xterm
- openbox
#- yavdr-xorg
- name: "stop x@vt7.service"
systemd:
name: "x@vt7.service"
state: stopped
- name: "expand template for x-verbose@.service"
template:
src: "templates/x-verbose@.service.j2"
dest: "/etc/systemd/system/x-verbose@.service"
- name: "start x-verbose@.service"
systemd:
name: "x-verbose@vt7.service"
state: started
enabled: false
masked: false
daemon_reload: true
- name: "wait a little bit, so X has some time to start up (needed?)"
wait_for:
timeout: 3
- name: "detect xorg configuration"
action: xrandr_facts
- name: "stop x-verbose@vt7.service"
systemd:
name: "x-verbose@vt7.service"
state: stopped
enabled: false
masked: true
### TODO: Create xorg configuration
- name: create folders for user session
file:
state: directory
dest: '{{ item }}'
mode: '0775'
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
with_items:
- '{{ vdr.home }}/.config/systemd/user'
- '{{ vdr.home }}/.config/openbox/autostart'
### TODO: move to yavdr-xorg package? ###
- name: create folder for customizations of vdr.service
file:
state: directory
dest: /etc/systemd/system/vdr.service.d
mode: '0775'
- 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/
### END TODO ###
- name: create .xinitrc for vdr user
template:
src: 'templates/.xinitrc.j2'
dest: '/var/lib/vdr/.xinitrc'
mode: 0755
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
- name: populate autostart for openbox
template:
src: 'templates/autostart.j2'
dest: '/var/lib/vdr/.config/openbox/autostart'
mode: 0755
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
- 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: enable and start xlogin for the user vdr
systemd:
daemon_reload: yes
name: 'xlogin@{{ vdr.user }}'
enabled: yes
state: started