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',
},
},
},
},
},
}