diff --git a/files/homeassistant.service b/files/homeassistant.service index d8b236c..88f6f64 100644 --- a/files/homeassistant.service +++ b/files/homeassistant.service @@ -5,7 +5,6 @@ After=network-online.target [Service] Type=simple User=homeassistant -WorkingDirectory=/home/homeassistant/.homeassistant ExecStart=/srv/homeassistant/bin/hass -c "/home/homeassistant/.homeassistant" [Install] diff --git a/tasks/main.yml b/tasks/main.yml index 07ac41f..6804822 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -4,6 +4,7 @@ - python3 - python3-dev - python3-venv + - python3-virtualenv - python3-pip - libffi-dev - libssl-dev @@ -21,6 +22,14 @@ name: homeassistant virtualenv: /srv/homeassistant +- name: Fix permissions. + ansible.builtin.file: + path: /srv/homeassistant + state: directory + owner: homeassistant + group: homeassistant + recurse: yes + - name: Create home-assistant systemd service. ansible.builtin.copy: src: homeassistant.service @@ -34,3 +43,4 @@ name: homeassistant state: started enabled: yes + daemon-reload: yes