added beacon and udev for rfxcom

This commit is contained in:
= 2020-12-25 13:24:47 +01:00
parent 4b9e15a9e5
commit 643e1ccc64
4 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,13 @@
beacons:
inotify:
- files:
/dev:
mask:
- create
- delete
exclude:
- /dev/gpiochip3
- /dev/serial
- /dev/ttyUSB0
- /dev/ttyUSB1
- disable_during_state_run: True

View File

@ -0,0 +1,5 @@
SUBSYSTEM=="tty", \
ACTION=="add", \
DRIVERS=="ftdi_sio", \
ATTRS{interface}=="RFXtrx433", \
SYMLINK+="rfxtrx433"

View File

@ -1,3 +1,4 @@
include: include:
- k3s.firewalld - k3s.firewalld
- k3s.network - k3s.network
- k3s.usb-devices

30
k3s/usb-devices.sls Normal file
View File

@ -0,0 +1,30 @@
Install PyInotify:
pkg.installed:
- name: python3-pyinotify
Add the rfxcom433 beacon file:
file.managed:
- name: /etc/salt/minion.d/beacons.conf
- source: salt://k3s/files/etc/salt/minion.d/beacons.conf
- user: root
- group: root
- mode: "0644"
Restart salt-minion:
service.running:
- name: salt-minion
- onchanges:
- file: Add the rfxcom433 beacon file
Add the rfxcom udev rule:
file.managed:
- name: /etc/udev/rules.d/90-RFXtrx433.rules
- user: root
- group: root
- mode: "0644"
reload udev rules:
cmd.run:
- name: udevadm control --reload
- onchanges:
- file: Add the rfxcom udev rule