bundlewrap/bundles/homeassistant/metadata.py

70 lines
1.8 KiB
Python
Raw Normal View History

2022-12-22 16:36:26 +00:00
defaults = {
'apt': {
'packages': {
2022-12-24 16:51:42 +00:00
'autoconf': {},
2022-12-22 16:36:26 +00:00
'bluez': {},
2022-12-24 16:51:42 +00:00
'build-essential': {},
2022-12-22 16:36:26 +00:00
'libffi-dev': {},
'libjpeg-dev': {},
'libopenjp2-7': {},
2022-12-24 16:51:42 +00:00
'libssl-dev': {},
'libtiff6': {},
2022-12-22 16:36:26 +00:00
'libturbojpeg0-dev': {},
2022-12-24 16:51:42 +00:00
'python3-packaging': {},
2022-12-22 16:36:26 +00:00
'tzdata': {},
2022-12-24 16:51:42 +00:00
'zlib1g-dev': {},
2022-12-22 16:36:26 +00:00
},
},
'backups': {
'paths': {
'/opt/homeassistant',
'/var/opt/homeassistant',
},
},
}
2022-12-22 16:53:10 +00:00
@metadata_reactor.provides(
2023-02-05 16:28:52 +00:00
'icinga2_api/homeassistant/services',
2022-12-22 16:53:10 +00:00
)
def icinga_check_for_new_release(metadata):
return {
'icinga2_api': {
'homeassistant': {
'services': {
'HOMEASSISTANT UPDATE': {
2022-12-24 16:51:42 +00:00
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_homeassistant_update',
2022-12-22 16:53:10 +00:00
'vars.notification.mail': True,
'check_interval': '60m',
},
},
},
},
}
2022-12-22 16:53:10 +00:00
@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': '/auth/authorize',
'website_check_string': 'Home Assistant',
2022-12-22 16:53:10 +00:00
'locations': {
'/': {
'target': 'http://127.0.0.1:8123',
'websockets': True,
2022-12-22 16:53:10 +00:00
},
},
},
},
},
}