add tags to yavdr-remote, add autoinstall-atric-usb role

This commit is contained in:
Alexander Grothe 2018-01-01 22:39:10 +01:00
parent 41e44b67a4
commit 88254f8e79
3 changed files with 138 additions and 45 deletions

View File

@ -237,7 +237,7 @@ localhost connection=local
# file: group_vars/all # file: group_vars/all
# this is the standard text to put in templates # this is the standard text to put in templates
ansible_managed_file: "*** YAVDR: ANSIBLE MANAGED FILE ***" ansible_managed_file: "*** YAVDR: ANSIBLE MANAGED FILE ***\norigin: {file}"
#+END_SRC #+END_SRC
** PPAs ** PPAs
#+BEGIN_SRC yaml :tangle group_vars/all :mkdirp yes #+BEGIN_SRC yaml :tangle group_vars/all :mkdirp yes
@ -271,7 +271,6 @@ vdr_plugins:
- vdr-plugin-markad - vdr-plugin-markad
- vdr-plugin-restfulapi - vdr-plugin-restfulapi
- vdr-plugin-softhddevice-vpp - vdr-plugin-softhddevice-vpp
#+END_SRC #+END_SRC
** Media directories ** Media directories
#+BEGIN_SRC yaml :tangle group_vars/all :mkdirp yes #+BEGIN_SRC yaml :tangle group_vars/all :mkdirp yes
@ -594,6 +593,13 @@ APT::Install-Suggests "0";
- intel_detected - intel_detected
- amd_detected - amd_detected
- virtualbox_detected - virtualbox_detected
- name: known vdr output plugins
vars:
vdr_output_plugins:
- softhddevice
- xineliboutput
- xine
#+END_SRC #+END_SRC
** vdr ** vdr
*** tasks *** tasks
@ -966,25 +972,38 @@ install_avahi: true
#+END_SRC #+END_SRC
** STARTED yavdr-remote ** STARTED yavdr-remote
*** default variables *** default variables
#+BEGIN_SRC yaml :tangle roles/yavdr-remote/defaults/main.yml :mkdirp yes :padline no
lircd0_socket: /var/run/lirc/lircd0
#+END_SRC
*** tasks *** tasks
#+BEGIN_SRC yaml :tangle roles/yavdr-remote/tasks/main.yml :mkdirp yes :padline no #+BEGIN_SRC yaml :tangle roles/yavdr-remote/tasks/main.yml :mkdirp yes :padline no
--- ---
# 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: apt | install yavdr-remote - name: apt | install packages for remote support
apt: apt:
name: yavdr-remote name: '{{ item }}'
state: present state: present
with_items:
- yavdr-remote
- lirc
- eventlircd
- lircd2uinput
tags:
- packages
- name: apt | install eventlircd - name: add systemd drop-in for lircd to use lircd2uinput
apt: block:
name: eventlircd - name: create directory /etc/systemd/system/lircd.service.d/
state: present file:
path: /etc/systemd/system/lircd.service.d/
- name: apt | install lirc state: directory
apt: - name: expand template for /etc/systemd/system/lircd.service.d/lircd2uinput.conf
name: lirc template:
state: present src: templates/lircd.service.d/lircd2uinput.conf.j2
dest: /etc/systemd/system/lircd.service.d/lircd2uinput.conf
tags:
- config
- name: stop, mask and disable lircd.socket, lircd.service and lircd-uinput.service # (the default lirc configuration conflicts with eventlircd) - name: stop, mask and disable lircd.socket, lircd.service and lircd-uinput.service # (the default lirc configuration conflicts with eventlircd)
systemd: systemd:
@ -997,27 +1016,24 @@ install_avahi: true
- lircd.socket - lircd.socket
- lircd-uinput.service - lircd-uinput.service
ignore_errors: yes ignore_errors: yes
tags:
- systemd
- name: configure vdr to read from a lircd-compatible socket - name: configure vdr to read from a lircd-compatible socket
template: template:
src: templates/03-vdr-lirc.conf.j2 src: templates/03-vdr-lirc.conf.j2
dest: /etc/vdr/conf.d/03-vdr-lirc.conf dest: /etc/vdr/conf.d/03-vdr-lirc.conf
notify: ['Restart VDR'] notify: ['Restart VDR']
tags:
- config
- name: expand template for /etc/rc_maps.cfg - name: expand template for /etc/rc_maps.cfg
template: template:
src: templates/rc_maps.cfg.j2 src: templates/rc_maps.cfg.j2
dest: /etc/rc_maps.cfg dest: /etc/rc_maps.cfg
notify: ['Trigger Udev'] notify: ['Trigger Udev']
tags:
# TODO: upload lircd2uinput package to PPA - config
#- name: install lircd2uinput
# tag: install
# apt:
# name: lircd2uinput
# state: present
# when:
# install_eventlircd is defined and install_eventlircd
#+END_SRC #+END_SRC
*** templates *** templates
**** Systemd Drop-in to start vdr with lirc support **** Systemd Drop-in to start vdr with lirc support
@ -1027,6 +1043,12 @@ install_avahi: true
--lirc=/var/run/lirc/lircd --lirc=/var/run/lirc/lircd
{% endif %} {% endif %}
#+END_SRC #+END_SRC
**** Systemd Drop-in to start lircd2uinput with lircd
#+BEGIN_SRC conf :tangle roles/yavdr-remote/templates/lircd.service.d/lircd2uinput.conf.j2 :mkdirp yes :padline no
[Service]
ExecStartPre=/usr/bin/lircd2uinput-add /var/run/lirc/lircd0
ExecStartPre=/usr/bin/lircd2uinput-remove /var/run/lirc/lircd0
#+END_SRC
**** create /etc/rc_maps.cfg **** create /etc/rc_maps.cfg
#+BEGIN_SRC conf :tangle roles/yavdr-remote/templates/rc_maps.cfg.j2 :mkdirp yes :padline no #+BEGIN_SRC conf :tangle roles/yavdr-remote/templates/rc_maps.cfg.j2 :mkdirp yes :padline no
# #
@ -1992,8 +2014,7 @@ KillMode=mixed
***** Drop-in snippet for vdr.service ***** Drop-in snippet for vdr.service
#+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 {{ ansible_managed_file | comment }}
# {{ ansible_managed_file }}
[Unit] [Unit]
After=x@vt7.service After=x@vt7.service
Wants=x@vt7.service Wants=x@vt7.service
@ -2002,7 +2023,7 @@ Wants=x@vt7.service
***** .xinitrc ***** .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 | comment }}
exec openbox-session exec openbox-session
#+END_SRC #+END_SRC
***** xorg.conf ***** xorg.conf
@ -3510,6 +3531,64 @@ This role installs the guest additions for virtualbox guests on Ubuntu 16.04
- ansible_distribution == "Ubuntu" - ansible_distribution == "Ubuntu"
- ansible_distribution_version == "16.04" - ansible_distribution_version == "16.04"
#+END_SRC #+END_SRC
** autoinstall-atric-usb
*** dependencies
#+BEGIN_SRC yaml :tange roles/autoinstall-atric-usb/meta/main.yml :padline no
---
dependencies:
- { role: yavdr-remote }
#+END_SRC
*** tasks
#+BEGIN_SRC yaml :tangle roles/autoinstall-atric-usb/tasks/main.yml :padline no
---
# file roles/autoinstall-atric-usb/tasks/main.yml
- name: install and configure Atric IR-WakeupUSB
block:
- name: apt | install lirc-drv-irman
apt:
name: lirc-drv-irman
- name: write lirc configuration
template:
src: templates/lircd_options.conf.j2
dest: /etc/lirc/lircd_options.conf
- name: enable lircd
systemd:
name: lircd.service
enabled: yes
state: started
masked: no
daemon_reload: yes
when: '"04d8:f844" in usb'
#+END_SRC
*** templates
#+BEGIN_SRC conf :tangle roles/autoinstall-atric-usb/templates/lircd_options.conf.j2 :padline no
{{ ansible_managed_file | comment }}
[lircd]
nodaemon = False
driver = irman
device = /dev/irman
output = /var/run/lirc/lircd0
pidfile = /var/run/lirc/lircd0.pid
plugindir = /usr/lib/x86_64-linux-gnu/lirc/plugins
permission = 666
allow-simulate = No
repeat-max = 600
#loglevel = 6
#release = true
#release_suffix = _EVUP
#logfile = ...
#driver-options = ...
[lircmd]
uinput = False
nodaemon = False
#+END_SRC
** autoinstall-satip ** autoinstall-satip
If a Sat>IP Server responds to a discovery request, the package vdr-plugin-satip is installed. If a Sat>IP Server responds to a discovery request, the package vdr-plugin-satip is installed.
*** tasks *** tasks

View File

@ -21,3 +21,10 @@
- intel_detected - intel_detected
- amd_detected - amd_detected
- virtualbox_detected - virtualbox_detected
- name: known vdr output plugins
vars:
vdr_output_plugins:
- softhddevice
- xineliboutput
- xine

View File

@ -1,20 +1,30 @@
--- ---
# 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: apt | install yavdr-remote - name: apt | install packages for remote support
apt: apt:
name: yavdr-remote name: '{{ item }}'
state: present state: present
with_items:
- yavdr-remote
- lirc
- eventlircd
- lircd2uinput
tags:
- packages
- name: apt | install eventlircd - name: add systemd drop-in for lircd to use lircd2uinput
apt: block:
name: eventlircd - name: create directory /etc/systemd/system/lircd.service.d/
state: present file:
path: /etc/systemd/system/lircd.service.d/
- name: apt | install lirc state: directory
apt: - name: expand template for /etc/systemd/system/lircd.service.d/lircd2uinput.conf
name: lirc template:
state: present src: templates/lircd.service.d/lircd2uinput.conf.j2
dest: /etc/systemd/system/lircd.service.d/lircd2uinput.conf
tags:
- config
- name: stop, mask and disable lircd.socket, lircd.service and lircd-uinput.service # (the default lirc configuration conflicts with eventlircd) - name: stop, mask and disable lircd.socket, lircd.service and lircd-uinput.service # (the default lirc configuration conflicts with eventlircd)
systemd: systemd:
@ -27,24 +37,21 @@
- lircd.socket - lircd.socket
- lircd-uinput.service - lircd-uinput.service
ignore_errors: yes ignore_errors: yes
tags:
- systemd
- name: configure vdr to read from a lircd-compatible socket - name: configure vdr to read from a lircd-compatible socket
template: template:
src: templates/03-vdr-lirc.conf.j2 src: templates/03-vdr-lirc.conf.j2
dest: /etc/vdr/conf.d/03-vdr-lirc.conf dest: /etc/vdr/conf.d/03-vdr-lirc.conf
notify: ['Restart VDR'] notify: ['Restart VDR']
tags:
- config
- name: expand template for /etc/rc_maps.cfg - name: expand template for /etc/rc_maps.cfg
template: template:
src: templates/rc_maps.cfg.j2 src: templates/rc_maps.cfg.j2
dest: /etc/rc_maps.cfg dest: /etc/rc_maps.cfg
notify: ['Trigger Udev'] notify: ['Trigger Udev']
tags:
# TODO: upload lircd2uinput package to PPA - config
#- name: install lircd2uinput
# tag: install
# apt:
# name: lircd2uinput
# state: present
# when:
# install_eventlircd is defined and install_eventlircd