bundlewrap/bundles/homeassistant/metadata.py

67 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': {},
2022-12-22 16:36:26 +00:00
'libtiff5': {},
'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',
},
},
},
},
}
@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
},
},
},
},
},
}