home.hass add metadata

This commit is contained in:
Sophie Schiller 2022-12-22 17:53:10 +01:00
parent c407a4520a
commit 107fd6872b
2 changed files with 58 additions and 1 deletions

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',
},
},
},
},
}
@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" hostname = "172.19.138.25"
bundles = [] bundles = [
'homeassistant',
'nginx'
]
groups = ["debian-bullseye"] groups = ["debian-bullseye"]
[metadata.backups] [metadata.backups]
@ -13,3 +16,16 @@ ipv6_accept_ra = true
[metadata.vm] [metadata.vm]
cpu = 2 cpu = 2
ram = 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'