Added service to automatically trigger udev rules after systemstart

This commit is contained in:
Tobias Lehmann 2024-03-14 14:25:12 +01:00
parent 3ba7a8acd1
commit 4c444c9642
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,28 @@
- hosts: "leh01"
become: true
vars:
tasks:
# UDEV rules to allow access to Coral USB from LXC als Service einrichten
- name: "Systemd service for UDEV rules to allow access to Coral USB from LXC -> Create configuration"
tags: always
template:
src: "../templates/coral-usb/coralusb-udev-rule.service.j2"
dest: /etc/systemd/system/coralusb-udev-rule.service
owner: root
group: root
mode: '0644'
- name: Systemd Service for UDEV rules -> init (coralusb-udev-rule.service)
tags: always
systemd:
daemon_reload: yes
enabled: yes
state: restarted
name: coralusb-udev-rule
- name: Systemd service for UDEV rules -> restart
tags: always
systemd:
daemon_reload: yes
state: restarted
name: coralusb-udev-rule

View File

@ -0,0 +1,11 @@
[Unit]
Description=Systemd service for UDEV rules required that lxc can access Coral USB
#Wants=network.target
[Service]
ExecStartPre=udevadm control --reload-rules
ExecStart=udevadm trigger
[Install]
#WantedBy=multi-user.target
WantedBy=basic.target