homassistant #56

Merged
kunsi merged 6 commits from homassistant into main 2022-12-24 17:32:39 +00:00
2 changed files with 58 additions and 1 deletions
Showing only changes of commit 107fd6872b - Show all commits

View file

@ -21,3 +21,44 @@ defaults = {
},
},
}
@metadata_reactor.provides(
'icinga2_api/homeassistant/services/HOMESSISTANT UPDATE',
)
def icinga_check_for_new_release(metadata):
return {
'icinga2_api': {
'homeassistant': {
'services': {
'HOMEASSISTANT UPDATE': {
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_github_for_new_release homeassistant/core {}'.format(metadata.get('homeassistant/version')),
'vars.notification.mail': True,
'check_interval': '60m',
Review

The update check should probably check homeassistant itself if it knows about updates, instead of relying on a hardcoded metadatum.

The update check should probably check homeassistant itself if it knows about updates, instead of relying on a hardcoded metadatum.
Review

Update check has been rewritten.

Update check has been rewritten.
},
},
},
},
}
@metadata_reactor.provides(
'nginx/vhosts/homeassistant',
)
def nginx(metadata):
if not node.has_bundle('nginx'):
raise DoNotRunAgain
return {
'nginx': {
'vhosts': {
'homeassistant': {
'domain': metadata.get('homeassistant/domain'),
'website_check_path': '/',
'website_check_string': 'Homeassistant',
'locations': {
'/': {
'target': 'http://127.0.0.1:8123',
},
},
},
},
},
}

View file

@ -1,5 +1,8 @@
hostname = "172.19.138.25"
bundles = []
bundles = [
'homeassistant',
'nginx'
]
groups = ["debian-bullseye"]
[metadata.backups]
@ -13,3 +16,16 @@ ipv6_accept_ra = true
[metadata.vm]
cpu = 2
ram = 2
[metadata.homeassistant]
domain = 'hass.home.kunbox.net'
version = '2022.12.8'
[metadata.nginx]
restrict-to = [
'172.19.136.0/25',
'172.19.138.0/24',
]
[metadata.nginx.vhosts.homeassistant]
ssl = '_.home.kunbox.net'