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

@ -5730,12 +5730,15 @@ As configured in the role yavdr-remote ([[*create /etc/rc_maps.cfg][/etc/rc_maps
*** defaults
#+BEGIN_SRC yaml :tangle roles/serial-ir/defaults/main.yml
---
# file: roles/serial-ir/defaults/main.yml
serial_ir_device: ttyS0
#+END_SRC
*** tasks
#+BEGIN_SRC yaml :tangle roles/serial-ir/tasks/main.yml
---
# file: roles/serial-ir/tasks/main.yml
- name: apt | install setserial
apt:
@ -5758,22 +5761,30 @@ serial_ir_device: ttyS0
#+END_SRC
*** templates
**** 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
#+END_SRC
**** serial_ir module options
#+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" %}
#COM1 equivalent, /dev/ttyS0
options serial_ir irq=4 io=0x3f8
{% elif serial_ir_device == "ttyS1" %}
#COM2 equivalent, /dev/ttyS1
options serial_ir irq=3 io=0x2f8
{% endif %}
{% if serial_ir_device in ("ttyS0", "ttyS1") %}
install serial_ir setserial /dev/{{serial_ir_device}} uart none; /sbin/modprobe --ignore-install serial_ir
{% endif %}
#+END_SRC
**** setserial options
#+BEGIN_SRC jinja2 :tangle roles/serial-ir/templates/serial.conf.j2
{{ ansible_managed | comment }}
{% if serial_ir_device == "ttyS0" %}
#COM1 equivalent, /dev/ttyS0
/dev/ttyS0 uart none

View File

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

View File

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

View File

@ -1,8 +1,12 @@
#COM1 equivalent, /dev/ttyS0
{{ ansible_managed | comment }}
{% if serial_ir_device == "ttyS0" %}
#COM1 equivalent, /dev/ttyS0
options serial_ir irq=4 io=0x3f8
{% elif serial_ir_device == "ttyS1" %}
#COM2 equivalent, /dev/ttyS1
options serial_ir irq=3 io=0x2f8
{% endif %}
{% if serial_ir_device in ("ttyS0", "ttyS1") %}
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

View File

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