2022-12-22 17:59:27 +00:00
|
|
|
from bundlewrap.metadata import atomic
|
|
|
|
|
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(
|
|
|
|
'icinga2_api/homeassistant/services/HOMESSISTANT UPDATE',
|
|
|
|
)
|
|
|
|
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': '/',
|
|
|
|
'website_check_string': 'Homeassistant',
|
|
|
|
'locations': {
|
|
|
|
'/': {
|
|
|
|
'target': 'http://127.0.0.1:8123',
|
2022-12-22 19:01:35 +00:00
|
|
|
'websockets': True,
|
2022-12-22 16:53:10 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|