Add comments to templates for serial-ir

This commit is contained in:
Alexander Grothe 2019-01-02 12:08:37 +01:00
parent b3195507fa
commit f253d7c864
7 changed files with 536 additions and 503 deletions

File diff suppressed because it is too large Load Diff

View File

@ -5729,13 +5729,16 @@ This role preconfigures the system for serial "homebrew" receivers. Newer kernel
As configured in the role yavdr-remote ([[*create /etc/rc_maps.cfg][/etc/rc_maps.cfg]]) a keytable for a RC-6 MCE remote is loaded by default. You can choose a different keymap which may also use another ir-protocol. As configured in the role yavdr-remote ([[*create /etc/rc_maps.cfg][/etc/rc_maps.cfg]]) a keytable for a RC-6 MCE remote is loaded by default. You can choose a different keymap which may also use another ir-protocol.
*** defaults *** defaults
#+BEGIN_SRC yaml :tangle roles/serial-ir/defaults/main.yml #+BEGIN_SRC yaml :tangle roles/serial-ir/defaults/main.yml
--- ---
# file: roles/serial-ir/defaults/main.yml
serial_ir_device: ttyS0 serial_ir_device: ttyS0
#+END_SRC #+END_SRC
*** tasks *** tasks
#+BEGIN_SRC yaml :tangle roles/serial-ir/tasks/main.yml #+BEGIN_SRC yaml :tangle roles/serial-ir/tasks/main.yml
--- ---
# file: roles/serial-ir/tasks/main.yml
- name: apt | install setserial - name: apt | install setserial
apt: apt:
@ -5758,22 +5761,30 @@ serial_ir_device: ttyS0
#+END_SRC #+END_SRC
*** templates *** templates
**** load serial_ir on startup **** load serial_ir on startup
#+BEGIN_SRC conf :tangle roles/serial-ir/templates/modules-load.d/serial_ir.conf.j2 #+BEGIN_SRC jinja2 :tangle roles/serial-ir/templates/modules-load.d/serial_ir.conf.j2
{{ ansible_managed | comment }}
serial_ir serial_ir
#+END_SRC #+END_SRC
**** serial_ir module options **** serial_ir module options
#+BEGIN_SRC jinja2 :tangle roles/serial-ir/templates/modprobe.d/serial_ir.conf.j2 #+BEGIN_SRC jinja2 :tangle roles/serial-ir/templates/modprobe.d/serial_ir.conf.j2
#COM1 equivalent, /dev/ttyS0 {{ ansible_managed | comment }}
{% if serial_ir_device == "ttyS0" %} {% if serial_ir_device == "ttyS0" %}
#COM1 equivalent, /dev/ttyS0
options serial_ir irq=4 io=0x3f8 options serial_ir irq=4 io=0x3f8
{% elif serial_ir_device == "ttyS1" %} {% elif serial_ir_device == "ttyS1" %}
#COM2 equivalent, /dev/ttyS1 #COM2 equivalent, /dev/ttyS1
options serial_ir irq=3 io=0x2f8 options serial_ir irq=3 io=0x2f8
{% endif %} {% endif %}
{% if serial_ir_device in ("ttyS0", "ttyS1") %}
install serial_ir setserial /dev/{{serial_ir_device}} uart none; /sbin/modprobe --ignore-install serial_ir install serial_ir setserial /dev/{{serial_ir_device}} uart none; /sbin/modprobe --ignore-install serial_ir
{% endif %}
#+END_SRC #+END_SRC
**** setserial options **** setserial options
#+BEGIN_SRC jinja2 :tangle roles/serial-ir/templates/serial.conf.j2 #+BEGIN_SRC jinja2 :tangle roles/serial-ir/templates/serial.conf.j2
{{ ansible_managed | comment }}
{% if serial_ir_device == "ttyS0" %} {% if serial_ir_device == "ttyS0" %}
#COM1 equivalent, /dev/ttyS0 #COM1 equivalent, /dev/ttyS0
/dev/ttyS0 uart none /dev/ttyS0 uart none

View File

@ -1,2 +1,4 @@
--- ---
# file: roles/serial-ir/defaults/main.yml
serial_ir_device: ttyS0 serial_ir_device: ttyS0

View File

@ -1,4 +1,5 @@
--- ---
# file: roles/serial-ir/tasks/main.yml
- name: apt | install setserial - name: apt | install setserial
apt: apt:

View File

@ -1,8 +1,12 @@
#COM1 equivalent, /dev/ttyS0 {{ ansible_managed | comment }}
{% if serial_ir_device == "ttyS0" %} {% if serial_ir_device == "ttyS0" %}
#COM1 equivalent, /dev/ttyS0
options serial_ir irq=4 io=0x3f8 options serial_ir irq=4 io=0x3f8
{% elif serial_ir_device == "ttyS1" %} {% elif serial_ir_device == "ttyS1" %}
#COM2 equivalent, /dev/ttyS1 #COM2 equivalent, /dev/ttyS1
options serial_ir irq=3 io=0x2f8 options serial_ir irq=3 io=0x2f8
{% endif %} {% endif %}
{% if serial_ir_device in ("ttyS0", "ttyS1") %}
install serial_ir setserial /dev/{{serial_ir_device}} uart none; /sbin/modprobe --ignore-install serial_ir install serial_ir setserial /dev/{{serial_ir_device}} uart none; /sbin/modprobe --ignore-install serial_ir
{% endif %}

View File

@ -1 +1,3 @@
{{ ansible_managed | comment }}
serial_ir serial_ir

View File

@ -1,3 +1,5 @@
{{ ansible_managed | comment }}
{% if serial_ir_device == "ttyS0" %} {% if serial_ir_device == "ttyS0" %}
#COM1 equivalent, /dev/ttyS0 #COM1 equivalent, /dev/ttyS0
/dev/ttyS0 uart none /dev/ttyS0 uart none