From 926f9aa3a532a9651ffaafc066b8810bc204c72d Mon Sep 17 00:00:00 2001 From: yuri Date: Sun, 18 Dec 2022 02:37:15 +0100 Subject: [PATCH] Make websockets and Web Serial work, set PATH variable in service file --- playbooks/roles/esphome/files/esphome.service | 3 ++- playbooks/roles/esphome/handlers/main.yml | 2 ++ playbooks/roles/esphome/tasks/main.yml | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/playbooks/roles/esphome/files/esphome.service b/playbooks/roles/esphome/files/esphome.service index 65e134c..9ff4ea2 100644 --- a/playbooks/roles/esphome/files/esphome.service +++ b/playbooks/roles/esphome/files/esphome.service @@ -2,9 +2,10 @@ Description=ESPHome [Service] -ExecStart=/home/esphome/.local/bin/esphome dashboard config/ +ExecStart=/home/esphome/.local/bin/esphome dashboard /home/esphome/.local/bin/config/ WorkingDirectory=/home/esphome/.local/bin User=esphome +Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/esphome/.local/bin [Install] WantedBy=multi-user.target diff --git a/playbooks/roles/esphome/handlers/main.yml b/playbooks/roles/esphome/handlers/main.yml index 2524898..10e13dd 100644 --- a/playbooks/roles/esphome/handlers/main.yml +++ b/playbooks/roles/esphome/handlers/main.yml @@ -1,4 +1,6 @@ +--- - name: Restart esphome ansible.builtin.systemd: service: esphome.service state: restarted + daemon_reload: true diff --git a/playbooks/roles/esphome/tasks/main.yml b/playbooks/roles/esphome/tasks/main.yml index 36e1250..ed90309 100644 --- a/playbooks/roles/esphome/tasks/main.yml +++ b/playbooks/roles/esphome/tasks/main.yml @@ -7,6 +7,7 @@ - name: Ensure esphome user exists ansible.builtin.user: name: esphome + shell: /bin/bash - name: Ensure esphome dependencies are installed become_user: esphome ansible.builtin.pip: