roles/Zigbee2MQTT: Deploy using Podman
Zigbee2MQTT is very similar to ZwaveJS2Mqtt: it is a daemon process that communicates with the Zigbee radio and integrates with Home Assistant using MQTT. Naturally, I decided to deploy it in the same way as ZwaveJS2Mqtt, using a systemd unit to run it in a container with Podman.
This commit is contained in:
1
roles/zigbee2mqtt/templates/configuration.yaml.j2
Normal file
1
roles/zigbee2mqtt/templates/configuration.yaml.j2
Normal file
@@ -0,0 +1 @@
|
||||
{{ zigbee2mqtt_config|to_nice_yaml(indent=2) }}
|
||||
26
roles/zigbee2mqtt/templates/zigbee2mqtt.service.j2
Normal file
26
roles/zigbee2mqtt/templates/zigbee2mqtt.service.j2
Normal file
@@ -0,0 +1,26 @@
|
||||
[Unit]
|
||||
Description=Zigbee2MQTT
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
NotifyAccess=all
|
||||
ExecStartPre=/usr/bin/setfacl -m zigbee2mqtt:rw {{ zigbee2mqtt_device }}
|
||||
ExecStartPre=-/usr/bin/podman container rm --ignore -f zigbee2mqtt
|
||||
ExecStart=/usr/bin/podman run \
|
||||
--pull never \
|
||||
--sdnotify=conmon --cgroups=no-conmon \
|
||||
--rm \
|
||||
--network=host \
|
||||
--name zigbee2mqtt \
|
||||
-v /var/lib/zigbee2mqtt:/app/data:Z \
|
||||
--uidmap 0:{{ zigbee2mqtt_user.uid }}:1 \
|
||||
--gidmap 0:{{ zigbee2mqtt_user.group }}:1 \
|
||||
--uidmap 1:5100001:1024 \
|
||||
--gidmap 1:5100001:1024 \
|
||||
--device {{ zigbee2mqtt_device }}:{{ zigbee2mqtt_container_device }}:rw \
|
||||
docker.io/koenkk/zigbee2mqtt:latest
|
||||
ProtectSystem=full
|
||||
UMask=0077
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user