cleanup and test basic functionality

This commit is contained in:
Alexander Grothe 2017-02-22 15:27:48 +01:00
parent efac4618fa
commit 9fe824e452
12 changed files with 540 additions and 266 deletions

View File

@ -1,21 +1,31 @@
# -*- mode: org; -*-
#+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: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
#+HTML_HEAD: <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/lib/js/jquery.stickytableheaders.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="http://www.pirilampo.org/styles/readtheorg/js/readtheorg.js"></script>
#+OPTIONS: ^:nil #+OPTIONS: ^:nil
* Installing and configuring yaVDR with Ansible * 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 [[http://ansible.com][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 [[http://ansible.com][Ansible]].
* Playbooks * Playbooks
To set up a fully-featured yaVDR installation you can use the yavdr07.yml Playbook: To set up a fully-featured yaVDR installation you can use the ~yavdr07.yml~ Playbook:
#+BEGIN_SRC yaml :tangle yavdr07.yml :mkdirp yes :exports none
---
# this playbook sets up a fully featured yaVDR 0.7 installation
#+END_SRC
#+BEGIN_SRC yaml :tangle yavdr07.yml :mkdirp yes #+BEGIN_SRC yaml :tangle yavdr07.yml :mkdirp yes
- name: basic setup for PPAs, packages etc. ---
hosts: yavdr-full # file: yavdr07.yml
# this playbook sets up a complete yaVDR 0.7 installation
- name: set up yaVDR
hosts: all
become: true become: true
roles: roles:
- yavdr-common - yavdr-common
- vdr
- yavdr-network - yavdr-network
- yavdr-xorg - yavdr-xorg
- yavdr-remote
- grub - grub
#+END_SRC #+END_SRC
@ -23,25 +33,68 @@ To set up a fully-featured yaVDR installation you can use the yavdr07.yml Playbo
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: 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:
#+BEGIN_SRC conf :tangle hosts :mkdirp yes #+BEGIN_SRC conf :tangle hosts :mkdirp yes
[yavdr-full] [yavdr-full]
localhost connection=local #localhost connection=local
192.168.1.116
[yavdr-headless] [yavdr-headless]
[yavdr-client] [yavdr-client]
#+END_SRC
* Group Variables
#+BEGIN_SRC yaml :tangle group_vars/all :mkdirp yes :exports none
ansible_managed_file: "*** YAVDR: ANSIBLE MANAGED FILE ***"
branch: unstable
ppa_owner: 'ppa:yavdr'
repositories:
- '{{ ppa_owner }}/main'
- '{{ ppa_owner }}/unstable-main'
- '{{ ppa_owner }}/{{branch}}-vdr'
- '{{ ppa_owner }}/{{branch}}-yavdr'
- '{{ ppa_owner }}/{{branch}}-kodi'
drivers:
sundtek: auto
ddvb-dkms: auto
vdr:
user: vdr
group: vdr
uid: 666
gid: 666
home: /var/lib/vdr
recdir: /srv/vdr/video
hide_first_recording_level: false
safe_dirnames: true
override_vdr_charset: false
vdr_plugins:
- vdr-plugin-devstatus
- vdr-plugin-markad
- vdr-plugin-restfulapi
- vdr-plugin-softhddevice
extra_packages:
- vim
- tree
- w-scan
#+END_SRC #+END_SRC
* Roles * Roles
** yavdr-common ** yavdr-common
This role is used to set up a basic yaVDR installation. It creates the directories, installs the vdr and other useful packages. This role is used to set up a basic yaVDR installation. It creates the directories, installs the vdr and other useful packages.
*** Variables *** default variables
Several variables can be set to customize the configuration. Several variables can be set to customize the configuration.
**** Repositories **** Repositories
You can provide 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. 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.
#+BEGIN_SRC yaml :tangle roles/yavdr-common/defaults/main.yml #+BEGIN_SRC yaml :tangle roles/yavdr-common/defaults/main.yml
branch: unstable ---
repositories: # file: roles/yavdr-common/defaults/main.yml
branch: unstable
repositories:
- 'ppa:yavdr/main' - 'ppa:yavdr/main'
- 'ppa:yavdr/unstable-main' - 'ppa:yavdr/unstable-main'
- 'ppa:yavdr/{{branch}}-vdr' - 'ppa:yavdr/{{branch}}-vdr'
@ -49,13 +102,14 @@ You can provide a list of package repositories which provide the necessary packa
- 'ppa:yavdr/{{branch}}-yavdr' - 'ppa:yavdr/{{branch}}-yavdr'
#+END_SRC #+END_SRC
**** Drivers **** Drivers
Using autodetection to automatically install 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*. 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*.
#+BEGIN_SRC yaml :tangle roles/yavdr-common/defaults/main.yml #+BEGIN_SRC yaml :tangle roles/yavdr-common/defaults/main.yml
drivers: drivers:
sundtek: auto sundtek: auto
ddvb-dkms: auto ddvb-dkms: auto
#+END_SRC #+END_SRC
**** Additional Packages **** Additional Packages
Add additional packages you would like to have on your installation to this list
#+BEGIN_SRC yaml :tangle roles/yavdr-common/defaults/main.yml #+BEGIN_SRC yaml :tangle roles/yavdr-common/defaults/main.yml
extra_packages: extra_packages:
- vim - vim
@ -81,20 +135,20 @@ vdr:
gid: 666 gid: 666
home: /var/lib/vdr home: /var/lib/vdr
recdir: /srv/vdr/video recdir: /srv/vdr/video
hide_first_recording_level: true hide_first_recording_level: false
safe_dirnames: true safe_dirnames: true
override_vdr_charset: false override_vdr_charset: false
#+END_SRC #+END_SRC
*** Tasks *** tasks
yavdr-common executes the following tasks: yavdr-common executes the following tasks:
**** Disable default installation of recommended packages **** Disable default installation of recommended packages
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :exports none #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml :exports none
--- ---
# This playbook sets up the basic packages an directories for a yaVDR installation # This playbook sets up the basic packages an directories for a yaVDR installation
#+END_SRC #+END_SRC
This configuration file prevents apt to automatically install all recommended dependencies when installing packages:
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml
- name: apt| prevent installation of recommended packages - name: apt | prevent automatic installation of recommended packages
blockinfile: blockinfile:
dest: /etc/apt/apt.conf.d/90norecommends dest: /etc/apt/apt.conf.d/90norecommends
create: yes create: yes
@ -121,7 +175,7 @@ yavdr-common executes the following tasks:
#+END_SRC #+END_SRC
**** Installing essential packages **** Installing essential packages
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml #+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml
- name: install basic packages - name: apt | install basic packages
apt: apt:
name: '{{ item }}' name: '{{ item }}'
state: present state: present
@ -136,16 +190,27 @@ yavdr-common executes the following tasks:
- software-properties-common - software-properties-common
- ssh - ssh
- ubuntu-drivers-common - ubuntu-drivers-common
- vdr
- vdr-plugin-dbus2vdr
- vdrctl
- wget - wget
- wpasupplicant - wpasupplicant
- usbutils - usbutils
- xfsprogs - xfsprogs
#+END_SRC #+END_SRC
**** Set up the VDR directories ** vdr
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml *** tasks
#+BEGIN_SRC yaml :tangle roles/vdr/tasks/main.yml :mkdirp yes
---
# file: roles/vdr/tasks/main.yml
- name: apt | install basic vdr packages
apt:
name: '{{ item }}'
state: present
install_recommends: no
with_items:
- vdr
- vdrctl
- vdr-plugin-dbus2vdr
- name: create vdr recdir - name: create vdr recdir
file: file:
state: directory state: directory
@ -169,19 +234,27 @@ yavdr-common executes the following tasks:
state: directory state: directory
owner: '{{ vdr.user }}' owner: '{{ vdr.user }}'
group: '{{ vdr.group }}' group: '{{ vdr.group }}'
mode: 0775 mode: '0775'
dest: '{{ vdr.recdir }}/local' dest: '{{ vdr.recdir }}/local'
when: when:
vdr.hide_first_recording_level vdr.hide_first_recording_level
- name: install additional vdr plugins
apt:
name: '{{ item }}'
state: present
install_recommends: no
with_items:
'{{ vdr_plugins }}'
#+END_SRC #+END_SRC
**** Set up the directories for files in /srv *** Set up the directories for files in /srv
#+BEGIN_SRC yaml :tangle roles/yavdr-common/tasks/main.yml #+BEGIN_SRC yaml :tangle roles/vdr/tasks/main.yml
- name: create directories for media files - name: create directories for media files
file: file:
state: directory state: directory
owner: '{{ vdr.user }}' owner: '{{ vdr.user }}'
group: '{{ vdr.group }}' group: '{{ vdr.group }}'
mode: 0775 mode: 0777
dest: '{{ item }}' dest: '{{ item }}'
with_items: with_items:
- /srv/videos - /srv/videos
@ -190,3 +263,158 @@ yavdr-common executes the following tasks:
- /srv/backups - /srv/backups
#+END_SRC #+END_SRC
** yavdr-network
*** default variables
#+BEGIN_SRC yaml :tangle roles/yavdr-network/main.yml :mkdirp yes
install_avahi: true
install_epgd: true
install_mariadb: true
install_nfs_client: true
install_nfs_server: true
install_samba_client: true
install_samba_server: true
#+END_SRC
*** tasks
#+BEGIN_SRC yaml :tangle roles/yavdr-network/tasks/main.yml :mkdirp yes
---
# this playbook sets up network services for a yaVDR installation
#
- name: install network packages
apt:
name: '{{ item }}'
state: present
install_recommends: no
with_items:
- avahi-daemon
- avahi-utils
- biosdevname
- ethtool
- nfs-common
- vdr-addon-avahi-linker
- wakeonlan
- name: install and configure nfs-kernel-server
apt:
name: "{{ item }}"
state: present
install_recommends: no
with_items:
- nfs-kernel-server
when:
- '{{ install_nfs_server }}'
# Does this really work? We need a way to check if an interface supports WOL - Python Skript?
# - name: check WOL capabilities of network interfaces
# shell: 'ethtool {{ item }} | grep -Po "(?<=Supports\sWake-on:\s).*$"'
# register: wol
# with_items: '{% for interface in ansible_interfaces if interface != 'lo' and interface != 'bond0' %}'
#+END_SRC
** yavdr-remote
*** default variables
*** tasks
*** templates
*** files
** yavdr-xorg
*** default variables
*** tasks
#+BEGIN_SRC yaml :tangle roles/yavdr-xorg/tasks/main.yml :mkdirp yes
---
# 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
#- yavdr-xorg
- openbox
# TODO: move to yavdr-xorg package?
- 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: set up .xinitrc for vdr user
template:
src: 'templates/.xinitrc.j2'
dest: '/var/lib/vdr/.xinitrc'
mode: 0755
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
- name: set up 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 vdr user
user:
name: '{{ vdr.user }}'
shell: '/bin/bash'
state: present
uid: '{{ vdr.uid }}'
groups: '{{ vdr.group }}'
append: yes
- name: enable and start xlogin for vdr user
systemd:
daemon_reload: yes
name: 'xlogin@{{ vdr.user }}'
enabled: yes
state: started
#+END_SRC
*** templates
#+BEGIN_SRC jinja2 :tangle roles/yavdr-xorg/templates/vdr-xorg.conf :mkdirp yes
# file: roles/yavdr-xorg/templates/vdr-xorg.conf
# {{ ansible_managed_file }}
[Unit]
After=x@vt7.service
Wants=x@vt7.service
BindsTo=x@vt7.service
#+END_SRC
#+BEGIN_SRC jinja2 :tangle roles/yavdr-xorg/templates/.xinitrc.j2 :mkdirp yes
#!/bin/bash
# {{ ansible_managed_file }}
exec openbox-session
#+END_SRC
#+BEGIN_SRC jinja2 tangle: ansible/yavdr-ansible/roles/yavdr-xorg/templates/autostart.j2 :mkdirp yes
env | grep "DISPLAY\|DBUS_SESSION_BUS_ADDRESS\|XDG_RUNTIME_DIR" > ~/.session-env
systemctl --user import-environment
#+END_SRC
*** files
** grub
*** default variables
*** tasks
*** templates
*** files

36
group_vars/all Normal file
View File

@ -0,0 +1,36 @@
ansible_managed_file: "*** YAVDR: ANSIBLE MANAGED FILE ***"
branch: unstable
ppa_owner: 'ppa:yavdr'
repositories:
- '{{ ppa_owner }}/main'
- '{{ ppa_owner }}/unstable-main'
- '{{ ppa_owner }}/{{branch}}-vdr'
- '{{ ppa_owner }}/{{branch}}-yavdr'
- '{{ ppa_owner }}/{{branch}}-kodi'
drivers:
sundtek: auto
ddvb-dkms: auto
vdr:
user: vdr
group: vdr
uid: 666
gid: 666
home: /var/lib/vdr
recdir: /srv/vdr/video
hide_first_recording_level: false
safe_dirnames: true
override_vdr_charset: false
vdr_plugins:
- vdr-plugin-devstatus
- vdr-plugin-markad
- vdr-plugin-restfulapi
- vdr-plugin-softhddevice
extra_packages:
- vim
- tree
- w-scan

61
roles/vdr/tasks/main.yml Normal file
View File

@ -0,0 +1,61 @@
---
# file: roles/vdr/tasks/main.yml
- name: apt | install basic vdr packages
apt:
name: '{{ item }}'
state: present
install_recommends: no
with_items:
- vdr
- vdrctl
- vdr-plugin-dbus2vdr
- name: create vdr recdir
file:
state: directory
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
mode: 0775
dest: '{{ vdr.recdir }}'
- name: set option to use hide-first-recording-level patch
blockinfile:
dest: /etc/vdr/conf.d/04-vdr-hide-first-recordinglevel.conf
create: true
block: |
[vdr]
--hide-first-recording-level
when:
vdr.hide_first_recording_level
- name: create local dir in recdir
file:
state: directory
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
mode: '0775'
dest: '{{ vdr.recdir }}/local'
when:
vdr.hide_first_recording_level
- name: install additional vdr plugins
apt:
name: '{{ item }}'
state: present
install_recommends: no
with_items:
'{{ vdr_plugins }}'
- name: create directories for media files
file:
state: directory
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
mode: 0777
dest: '{{ item }}'
with_items:
- /srv/videos
- /srv/music
- /srv/picture
- /srv/backups

View File

@ -1,3 +1,5 @@
---
# file: roles/yavdr-common/defaults/main.yml
branch: unstable branch: unstable
repositories: repositories:
@ -11,7 +13,7 @@ drivers:
sundtek: auto sundtek: auto
ddvb-dkms: auto ddvb-dkms: auto
extra_packages: extra_packages:
- vim - vim
- tree - tree
- w-scan - w-scan
@ -23,6 +25,6 @@ vdr:
gid: 666 gid: 666
home: /var/lib/vdr home: /var/lib/vdr
recdir: /srv/vdr/video recdir: /srv/vdr/video
hide_first_recording_level: true hide_first_recording_level: false
safe_dirnames: true safe_dirnames: true
override_vdr_charset: false override_vdr_charset: false

View File

@ -1,8 +1,7 @@
--- ---
# This playbook sets up the basic packages an directories for a yaVDR installation # This playbook sets up the basic packages an directories for a yaVDR installation
- name: apt| prevent installation of recommended packages - name: apt | prevent automatic installation of recommended packages
blockinfile: blockinfile:
dest: /etc/apt/apt.conf.d/90norecommends dest: /etc/apt/apt.conf.d/90norecommends
create: yes create: yes
@ -25,7 +24,7 @@
upgrade: dist upgrade: dist
update_cache: yes update_cache: yes
- name: install basic packages - name: apt | install basic packages
apt: apt:
name: '{{ item }}' name: '{{ item }}'
state: present state: present
@ -40,51 +39,7 @@
- software-properties-common - software-properties-common
- ssh - ssh
- ubuntu-drivers-common - ubuntu-drivers-common
- vdr
- vdr-plugin-dbus2vdr
- vdrctl
- wget - wget
- wpasupplicant - wpasupplicant
- usbutils - usbutils
- xfsprogs - xfsprogs
- name: create vdr recdir
file:
state: directory
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
mode: 0775
dest: '{{ vdr.recdir }}'
- name: set option to use hide-first-recording-level patch
blockinfile:
dest: /etc/vdr/conf.d/04-vdr-hide-first-recordinglevel.conf
create: true
block: |
[vdr]
--hide-first-recording-level
when:
vdr.hide_first_recording_level
- name: create local dir in recdir
file:
state: directory
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
mode: 0775
dest: '{{ vdr.recdir }}/local'
when:
vdr.hide_first_recording_level
- name: create directories for media files
file:
state: directory
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
mode: 0775
dest: '{{ item }}'
with_items:
- /srv/videos
- /srv/music
- /srv/picture
- /srv/backups

View File

@ -0,0 +1,7 @@
install_avahi: true
install_epgd: true
install_mariadb: true
install_nfs_client: true
install_nfs_server: true
install_samba_client: true
install_samba_server: true

View File

@ -23,42 +23,10 @@
with_items: with_items:
- nfs-kernel-server - nfs-kernel-server
when: when:
- install_nfs_server - '{{ install_nfs_server }}'
#- name: install and configure mariadb-server # Does this really work? We need a way to check if an interface supports WOL - Python Skript?
# apt: # - name: check WOL capabilities of network interfaces
# name: "{{ item }}" # shell: 'ethtool {{ item }} | grep -Po "(?<=Supports\sWake-on:\s).*$"'
# state: present # register: wol
# install_recommends: no # with_items: '{% for interface in ansible_interfaces if interface != 'lo' and interface != 'bond0' %}'
# with_items:
# - mariadb-server
# - mariadb-client
# - python-mysqldb
# when:
# - install_mariadb
#
#- name: create a new database with name epg2vdr
# mysql_db:
# name: epg2vdr
# state: present
# encoding: utf-8
# when:
# - install_mariadb
#
# mysql_user:
# name: epg2vdr
# password: epg
# priv: 'epg2vdr.*:ALL,GRANT'
# host_all: yes
# state: present
# when:
# - install_mariadb
#
#- name: Install and configure vdr-epg-daemon
# apt:
# name: "{{ item }}"
# state: present
# with_items:
# - vdr-epg-daemon
# when:
# - install_epgd

View File

@ -1,15 +1,12 @@
--- ---
# This role is used to set up the yaVDR remote control configuration. # This role is used to set up the yaVDR remote control configuration.
- name: install yavdr-remote - name: install yavdr-remote
tag: install
apt: apt:
name: yavdr-remote name: yavdr-remote
state: present state: present
- name: install lirc - name: install lirc
tag: install
apt: apt:
name: lircd name: lircd
state: present state: present
@ -17,7 +14,6 @@
- install_lircd is defined and install_lircd - install_lircd is defined and install_lircd
- name: install eventlircd - name: install eventlircd
tag: install
apt: apt:
name: eventlircd name: eventlircd
state: present state: present

View File

@ -1,61 +1,72 @@
--- ---
# this playbook sets up a graphical user session for a yaVDR installation # file: roles/yavdr-xorg/tasks/main.yml
- name: install xorg packages - name: install packages for xorg
apt: apt:
name: "{{ item }}" name: '{{ item }}'
state: present state: present
install_recommends: no
with_items: with_items:
- openbox
- xlogin
- xorg - xorg
- xserver-xorg-input-all
- xserver-xorg-video-all - xserver-xorg-video-all
- xserver-xorg-input-all
- xlogin
- xterm - xterm
#- yavdr-xorg
- openbox
- name: create /etc/yavdr # TODO: move to yavdr-xorg package?
- name: create folders for user session
file: file:
path: /etc/yavdr
state: directory state: directory
mode: 0755 dest: '{{ item }}'
mode: '0775'
owner: '{{ vdr.user }}'
group: '{{ vdr.group }}'
with_items:
- '{{ vdr.home }}/.config/systemd/user'
- '{{ vdr.home }}/.config/openbox/autostart'
- name: check if /etc/yavdr/autoinstalled exists ### TODO: move to yavdr-xorg package? ###
stat: path=/etc/yavdr/autoinstalled - name: create folder for customizations of vdr.service
register: ubuntu_drivers_autoinstalled file:
state: directory
dest: /etc/systemd/system/vdr.service.d
mode: '0775'
- name: install drivers using ubuntu-drivers autodetection - name: add dependency to X-server for vdr.service using a drop-in
shell: ubuntu-drivers --package-list /etc/yavdr/autoinstalled autoinstall template:
when: not ubuntu_drivers_autoinstalled.stat.exists src: templates/vdr-xorg.conf
dest: /etc/systemd/system/vdr.service.d/
### END TODO ###
- name: set up .xinitrc for user vdr - name: set up .xinitrc for vdr user
template: template:
src: 'templates/.xinitrc.j2' src: 'templates/.xinitrc.j2'
dest: '/var/lib/vdr/.xinitrc' dest: '/var/lib/vdr/.xinitrc'
mode: 0755 mode: 0755
owner: vdr owner: '{{ vdr.user }}'
group: vdr group: '{{ vdr.group }}'
- name: create directories for desktop session
file:
state: directory
owner: vdr
group: vdr
mode: 0644
path: '{{ item }}'
with_items:
- /var/lib/vdr/.config/openbox/
- /var/lib/vdr/.config/systemd/user/
- name: set up autostart for openbox - name: set up autostart for openbox
template: template:
src: 'templates/autostart.j2' src: 'templates/autostart.j2'
dest: '/var/lib/vdr/.config/openbox/autostart' dest: '/var/lib/vdr/.config/openbox/autostart'
mode: 0755 mode: 0755
owner: vdr owner: '{{ vdr.user }}'
group: vdr group: '{{ vdr.group }}'
- name: enable xlogin@vt7.service - name: set a login shell for the vdr user
service: user:
name: xlogin@vdr.service name: '{{ vdr.user }}'
shell: '/bin/bash'
state: present
uid: '{{ vdr.uid }}'
groups: '{{ vdr.group }}'
append: yes
- name: enable and start xlogin for vdr user
systemd:
daemon_reload: yes
name: 'xlogin@{{ vdr.user }}'
enabled: yes enabled: yes
state: started

View File

@ -1,2 +1,3 @@
#!/bin/bash #!/bin/bash
# {{ ansible_managed_file }}
exec openbox-session exec openbox-session

View File

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

View File

@ -1,12 +1,14 @@
--- ---
# this playbook sets up a fully featured yaVDR 0.7 installation # file: yavdr07.yml
# this playbook sets up a complete yaVDR 0.7 installation
- name: basic setup for PPAs, packages etc. - name: set up yaVDR
hosts: yavdr-full hosts: all
become: true become: true
roles: roles:
- yavdr-common - yavdr-common
- vdr
- yavdr-network - yavdr-network
- yavdr-xorg - yavdr-xorg
- yavdr-remote
- grub - grub