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: