diff --git a/bundles/homeassistant/files/homeassistant.service b/bundles/homeassistant/files/homeassistant.service index d97cec7..a650f17 100644 --- a/bundles/homeassistant/files/homeassistant.service +++ b/bundles/homeassistant/files/homeassistant.service @@ -8,6 +8,8 @@ User=homeassistant WorkingDirectory=/var/opt/homeassistant ExecStart=/opt/homeassistant/venv/bin/hass -c "/var/opt/homeassistant" RestartForceExitStatus=100 +Restart=on-failure +RestartSec=2 [Install] WantedBy=multi-user.target diff --git a/bundles/homeassistant/items.py b/bundles/homeassistant/items.py index 6ceeec4..5751178 100644 --- a/bundles/homeassistant/items.py +++ b/bundles/homeassistant/items.py @@ -37,6 +37,13 @@ actions = { 'needs': { 'directory:/opt/homeassistant', 'user:homeassistant', + }, + }, + 'homeassistant_install': { + 'command': 'sudo -u homeassistant /opt/homeassistant/venv/bin/pip install homeassistant', + 'unless': 'test -f /opt/homeassistant/venv/bin/hass', + 'needs': { + 'action:homeassistant_create_virtualenv', 'pkg_apt:bluez', 'pkg_apt:libffi-dev', 'pkg_apt:libssl-dev', @@ -45,17 +52,10 @@ actions = { 'pkg_apt:autoconf', 'pkg_apt:build-essential', 'pkg_apt:libopenjp2-7', - 'pkg_apt:libtiff5', + 'pkg_apt:libtiff6', 'pkg_apt:libturbojpeg0-dev', 'pkg_apt:tzdata', }, - }, - 'homeassistant_install': { - 'command': 'sudo -u homeassistant /opt/homeassistant/venv/bin/pip install homeassistant', - 'unless': 'test -f /opt/homeassistant/venv/bin/hass', - 'needs': { - 'action:homeassistant_create_virtualenv', - }, 'triggers': { 'svc_systemd:homeassistant:restart', }, diff --git a/bundles/homeassistant/metadata.py b/bundles/homeassistant/metadata.py index 0b41f39..2ecf827 100644 --- a/bundles/homeassistant/metadata.py +++ b/bundles/homeassistant/metadata.py @@ -8,7 +8,7 @@ defaults = { 'libjpeg-dev': {}, 'libopenjp2-7': {}, 'libssl-dev': {}, - 'libtiff5': {}, + 'libtiff6': {}, 'libturbojpeg0-dev': {}, 'python3-packaging': {}, 'tzdata': {}, @@ -22,6 +22,8 @@ defaults = { }, }, } + + @metadata_reactor.provides( 'icinga2_api/homeassistant/services', ) @@ -40,6 +42,7 @@ def icinga_check_for_new_release(metadata): }, } + @metadata_reactor.provides( 'nginx/vhosts/homeassistant', )